noalyss Version-9
Public Member Functions
Noalyss\Mobile Class Reference

Main class for Mobile device. More...

+ Collaboration diagram for Noalyss\Mobile:

Public Member Functions

 display_menu ()
 Display the menu available for this folder. More...
 
 execute_menu ($p_access_code)
 execute the menu @global type $g_user @staticvar int $level More...
 
 load_module ($p_access_code)
 Load a module with all its data from database thanks the access_code @global \Noalyss\type $g_user. More...
 
 page_start ()
 HTML Page @staticvar int $already_call. More...
 

Detailed Description

Main class for Mobile device.

Definition at line 37 of file mobile.class.php.

Member Function Documentation

◆ display_menu()

Noalyss\Mobile::display_menu ( )

Display the menu available for this folder.

Definition at line 150 of file mobile.class.php.

151 {
152 if (DEBUGNOALYSS>1)
153 {
154 echo __CLASS__."→".__FUNCTION__;
155 }
157 $user=new \Noalyss_user($cn);
158
159 $aModule=$cn->get_array("select *
160 from profile_mobile pm
161 join menu_ref mr on (pm.me_code=mr.me_code)
162 where p_id=$1 order by pmo_order", [$user->get_profile()]);
163 require_once NOALYSS_TEMPLATE."/mobile-display_menu.php";
164 }
static connect()

References $cn, and Dossier\connect().

+ Here is the call graph for this function:

◆ execute_menu()

Noalyss\Mobile::execute_menu (   $p_access_code)

execute the menu @global type $g_user @staticvar int $level

Parameters
type$p_access_code
Returns
type

Definition at line 173 of file mobile.class.php.

174 {
175 global $g_user,$g_parameter,$cn;
176 $aModule=$this->load_module($p_access_code);
177 if ( empty($aModule)) {
178 return;
179 }
180 /*-- Load the standard headers if needed -- */
181 if ( $aModule['pmo_default'] == 1) {
182 $this->page_start();
183 }
184
185 echo HtmlInput::anchor("❮"._("Retour"), "mobile.php?".http_build_query(["gDossier"=>Dossier::id()]));
186
187 if ($aModule['me_file']!="")
188 {
189 if ($aModule['me_parameter']!=="")
190 {
191 // if there are paramter put them in superglobal
192 $array=compute_variable($aModule['me_parameter']);
194 }
195 if (DEBUGNOALYSS==2)
196 {
197 echo $aModule['me_file'], " param : ", $aModule['me_parameter'];
198 }
199 /*
200 * Log the file we input to put in the folder test-noalyss for replaying it
201 */
202 if (LOGINPUT)
203 {
204 $file_loginput=fopen($_ENV['TMP'].'/scenario-'.$_SERVER['REQUEST_TIME'].'.php', 'a+');
205 fwrite($file_loginput, "include '".$aModule['me_file']."';");
206 fwrite($file_loginput, "\n");
207 fclose($file_loginput);
208 }
209 // if file is not a plugin, include the file, otherwise
210 // include the plugin launcher
211 if ($aModule['me_type']!='PL')
212 {
213 if (file_exists($aModule['me_file']))
214 {
215 require_once $aModule['me_file'];
216 }
217 elseif (file_exists(NOALYSS_INCLUDE.'/'.$aModule['me_file']))
218 {
219 require_once NOALYSS_INCLUDE.'/'.$aModule['me_file'];
220 }
221 else
222 {
223 echo echo_warning(_("Fichier non trouvé"));
224 }
225 }
226 else
227 {
228 require 'extension_get.inc.php';
229 }
230
231 exit();
232 }
233 elseif ($aModule['me_javascript']!='')
234 {
235 $js=noalyss_str_replace('<DOSSIER>', dossier::id(), $aModule['me_javascript']);
236 echo create_script($js);
237 }
238 }
compute_variable($p_string)
the string has the format a=b&c=d, it is parsed and an array[][key,value] is returned
Definition: ac_common.php:1250
put_global($array)
Put in superglobal (get,post,request) the value contained in the parameter field (me_parameter)
Definition: ac_common.php:1233
echo_warning($p_string)
warns
Definition: ac_common.php:589
noalyss_str_replace($search, $replace, $string)
Definition: ac_common.php:1553
global $g_parameter
global $g_user
if no group available , then stop
$input_from id
Definition: balance.inc.php:63
static id()
return the 'gDossier' value after a check
static anchor($p_text, $p_url="", $p_js="", $p_style=' class="line" ', $p_title="click", array $p_attribute=[])
Return a simple anchor with a url or a javascript if $p_js is not null then p_url will be javascript:...
load_module($p_access_code)
Load a module with all its data from database thanks the access_code @global \Noalyss\type $g_user.
page_start()
HTML Page @staticvar int $already_call.
for($e=0; $e< count($afiche); $e++) exit
create_script($p_string)
create the HTML for adding the script tags around of the script
if( $delta< 0) elseif( $delta==0)

References $array, $cn, $g_parameter, $g_user, $js, HtmlInput\anchor(), compute_variable(), create_script(), echo_warning(), elseif, exit, id, Dossier\id(), noalyss_str_replace(), and put_global().

+ Here is the call graph for this function:

◆ load_module()

Noalyss\Mobile::load_module (   $p_access_code)

Load a module with all its data from database thanks the access_code @global \Noalyss\type $g_user.

Parameters
type$p_access_code
Returns
type

Definition at line 46 of file mobile.class.php.

47 {
48 global $g_user;
50 $aModule=$cn->get_row("
51 select
52 me_file,me_parameter,me_javascript,me_type,menu_ref.me_code,
53 pmo_id,pmo_order,pmo_default
54 from menu_ref
55 join profile_mobile using (me_code)
56 where
57 me_code=$1 and
58 (me_file is not null or trim(me_file) <>'' or
59 me_javascript is not null or trim (me_javascript) <> '')
60 and profile_mobile.p_id=$2",
61 array($p_access_code,$g_user->get_profile()));
62
63 if (count($aModule)==0)
64 {
65 return [];
66 }
67 return $aModule;
68 }

References $cn, $g_user, and Dossier\connect().

+ Here is the call graph for this function:

◆ page_start()

Noalyss\Mobile::page_start ( )

HTML Page @staticvar int $already_call.

Returns
type

Definition at line 74 of file mobile.class.php.

75 {
76 global $version_noalyss;
77 // check not called twiced
78 static $already_call=0;
79 if ($already_call==1)
80 return;
81 $already_call=1;
82
83 $style="style-classic7.css";
84
85 $title="NOALYSS";
86 echo '<!doctype html>';
87 printf("\n");
88
89 echo "<HTML>";
90
91 echo "<HEAD>";
92 echo '<meta charset="utf-8">';
93 echo "<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">";
94 echo "
95 <TITLE>$title</TITLE>
96 <link rel=\"icon\" type=\"image/ico\" href=\"favicon.ico\" />
97 <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
98 <LINK id=\"bootstrap\" REL=\"stylesheet\" type=\"text/css\" href=\"css/bootstrap.min.css\" media=\"screen\"/>
99 <LINK id=\"fontello\" REL=\"stylesheet\" type=\"text/css\" href=\"css/font/fontello/css/fontello.css\" media=\"screen\"/>
100 <LINK id=\"pagestyle\" REL=\"stylesheet\" type=\"text/css\" href=\"css/".$style."?version=".$version_noalyss."\" media=\"screen\"/>
101 <link rel=\"stylesheet\" type=\"text/css\" href=\"css/style-print.css?version=".$version_noalyss."\" media=\"print\"/>";
102
103 // preload font
104 echo '<link rel="preload" href="./css/font/OpenSansRegular.woff" as="font" crossorigin="anonymous" />';
105 echo '<link rel="preload" href="./css/font/SansationLight/SansationLight.woff" as="font" crossorigin="anonymous" />';
106 echo '<link rel="preload" href="./css/font/fontello/fontello.woff" as="font" crossorigin="anonymous" />';
107
108 echo '<script language="javascript" src="js/calendar.js"></script>
109 <script type="text/javascript" src="js/lang/calendar-en.js"></script>';
110
111 if (isset($_SESSION[SESSION_KEY.'g_lang'])&&$_SESSION[SESSION_KEY.'g_lang']=='fr_FR.utf8')
112 {
113 echo '<script type="text/javascript" src="js/lang/calendar-fr.js"></script>';
114 }
115 elseif (isset($_SESSION[SESSION_KEY.'g_lang'])&&$_SESSION[SESSION_KEY.'g_lang']=='nl_NL.utf8')
116 {
117 echo '<script type="text/javascript" src="js/lang/calendar-nl.js"></script>';
118 }
119
120 echo '
121 <script language="javascript" src="js/calendar-setup.js"></script>
122 <LINK REL="stylesheet" type="text/css" href="css/calendar-blue.css" media="screen">
123 ';
124 // language
125 if (isset($_SESSION[SESSION_KEY.'g_lang']))
126 {
127 set_language();
128 }
129
130 echo load_all_script();
131 echo ' </HEAD> ';
132
133 echo "<BODY>";
134 echo '<div id="info_div"></div>';
135 echo '<div id="error_div">'.
136 HtmlInput::title_box(_("Erreur"), 'error_div', 'hide').
137 '<div id="error_content_div">'.
138 '</div>'.
139 '<p style="text-align:center">'.
140 HtmlInput::button_action('Valider',
141 '$(\'error_div\').style.visibility=\'hidden\';$(\'error_content_div\').innerHTML=\'\';').
142 '</p>'.
143 '</div>';
144 }
set_language()
set the lang thanks the _SESSION['g_lang'] var.
Definition: ac_common.php:754
static button_action($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
button Html with javascript
static title_box($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n')
Title for boxes, you can customize the symbol thanks symbol with the mode "custom".
global $version_noalyss
Definition: constant.php:26
load_all_script()
load all the javascript only one time

References $style, $title, $version_noalyss, HtmlInput\button_action(), elseif, load_all_script(), set_language(), and HtmlInput\title_box().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: