Changeset 3731 for branches/2.2/mobile/inc
- Timestamp:
- 02/03/11 17:13:42 (13 years ago)
- Location:
- branches/2.2/mobile/inc
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/mobile/inc/class.mobiletemplate.inc.php
r3727 r3731 15 15 $template = $GLOBALS['phpgw']->session->appsession('mobile.layout','mobile'); 16 16 17 $this->template->set_file(Array('home_t' => $template=="mini"?'pc_template.tpl':'template.tpl')); 18 $this->template->set_block('home_t', 'mobile_home'); 17 if($template == "mini_desktop") { 18 $this->template->set_file(array('home_t' => 'pc_template.tpl')); 19 $this->template->set_file(array('home_t_search_bar' => 'search_bar.tpl')); 20 $this->template->set_block('home_t_search_bar','search_bar'); 21 $this->template->set_var('search',$this->template->fp('out','search_bar')); 22 $this->template->set_var('lang_mini_mobile', lang('mini mobile')); 23 $this->template->set_var('lang_search_error_message',lang("need choose one option")); 24 } else { 25 $this->template->set_file(array('home_t' => 'template.tpl')); 26 $this->template->set_var('lang_mini_desktop', lang('mini desktop')); 27 } 28 29 30 31 $this->template->set_block('home_t', 'mobile_home'); 19 32 $this->template->set_block('home_t','success_message'); 20 $this->template->set_block('home_t','error_message'); 33 $this->template->set_block('home_t','error_message'); 21 34 } 22 35 … … 51 64 $this->template->parse("message_box", $type."_message", true); 52 65 } 53 } 66 } 54 67 55 68 /* … … 79 92 $this->print_header(); 80 93 $this->init_mobile(); 81 $class=='ui_home' && $method=='index'?$this->print_logout():$this->print_navbar();94 if(!($class == 'ui_home' && $method == 'index')) $this->print_navbar(); 82 95 $filename = 'inc/class.'.$class.'.inc.php'; 83 if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')=="mini") {84 $ui_home = CreateObject('mobile.ui_home');85 $ui_home->index(array());86 }87 96 include_once($filename); 88 97 $obj = new $class(); 89 98 $obj -> $method($_REQUEST); 99 100 if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile') == "mini_desktop") { 101 $ui_home = CreateObject('mobile.ui_home'); 102 $ui_home->index($_REQUEST); 103 } 104 90 105 $this->template->pfp('out', 'mobile_home'); 91 106 } … … 96 111 // setting timezone preference 97 112 $zones = $obj->getTimezones(); 98 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] : sprintf("%s", array_search("America/Sao_Paulo", $zones)); 99 } 100 101 /* 102 * @function print_logout 103 * @abstract Exibe label e link para Logout 104 * @author Diego Moreno 105 */ 106 public function print_logout(){ 107 $this-> template->set_var('lang_logout', lang('logout')); 108 $this-> template->set_var('href_logout', 'login.php?cd=1'); 113 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] : sprintf("%s", array_search("America/Sao_Paulo", $zones)); 114 115 $this->template->set_var('global_title', lang('expresso mini')); 116 $this->template->set_var('lang_logout', lang('logout')); 117 $this->template->set_var('lang_search', lang('search')); 118 119 $this->template->set_var('href_logout', 'login.php?cd=1'); 109 120 } 110 121 … … 115 126 */ 116 127 private function print_navbar(){ 117 $this-> print_logout(); 118 $this-> template->set_var('lang_back', lang('Back')); 119 $this-> template->set_var('lang_home', lang('home')); 120 $this-> template->set_var('lang_email', lang('E-mail')); 121 $this-> template->set_var('lang_contacts', lang('Contact Center')); 122 $this-> template->set_var('lang_calendar', lang('Calendar')); 123 $this-> template->set_var('href_back', 'javascript:history.back()'); 124 $this-> template->set_var('href_cc', 'index.php?menuaction=mobile.ui_mobilecc.init_cc'); 125 $this-> template->set_var('href_email', "index.php?menuaction=mobile.ui_mobilemail.change_folder&folder=0"); 126 $this-> template->set_var('href_calendar', "index.php?menuaction=mobile.ui_mobilecalendar.index"); 127 $this-> template->set_var('href_home', "index.php?menuaction=mobile.ui_home.index"); 128 $this->template->set_var('lang_back', lang('Back')); 129 $this->template->set_var('lang_home', lang('home')); 130 $this->template->set_var('lang_email', lang('E-mail')); 131 $this->template->set_var('lang_contacts', lang('Contact Center')); 132 $this->template->set_var('lang_calendar', lang('Calendar')); 133 $this->template->set_var('href_back', 'javascript:history.back()'); 134 $this->template->set_var('href_cc', 'index.php?menuaction=mobile.ui_mobilecc.init_cc'); 135 $this->template->set_var('href_email', "index.php?menuaction=mobile.ui_mobilemail.change_folder&folder=0"); 136 $this->template->set_var('href_calendar', "index.php?menuaction=mobile.ui_mobilecalendar.index"); 137 $this->template->set_var('href_home', "index.php?menuaction=mobile.ui_home.index"); 128 138 } 129 139 … … 135 145 private function print_header(){ 136 146 $GLOBALS['phpgw']->accounts->read_repository(); 137 $var = Array( 138 'css' => $this->get_mobile_css(), 139 'title' => lang("expresso mini") 140 ); 141 $this->template->set_var($var); 142 } 143 144 145 public function get_mobile_css() { 146 $css = "/mobile/templates/%s.css"; 147 148 global $path, $link; 149 150 $path = PHPGW_SERVER_ROOT . str_replace( '/', SEP, $css ); 151 152 $link = '<LINK href="%s" type="text/css" rel="StyleSheet">'; 153 $link = sprintf( $link, 154 "{$GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ]}{$css}" 155 ); 156 157 function _css( $css ) 158 { 159 global $link, $path; 160 161 if ( file_exists( sprintf( $path, str_replace( '/', SEP, $css ) ) ) ) 162 return sprintf( $link, $css ); 163 164 return ''; 165 } 166 167 $css = _css( 'css/mobile' ); 168 $css .= _css( $GLOBALS['phpgw_info']['server']['template_set'].'/css/base'); 169 $css .= _css( $GLOBALS['phpgw_info']['server']['template_set'].'/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']); 170 171 return ( $css ); 172 147 $var = Array('title' => lang("expresso mini")); 148 $this->template->set_var($var); 173 149 } 174 150 -
branches/2.2/mobile/inc/class.ui_home.inc.php
r3727 r3731 22 22 23 23 function change_template($params) { 24 25 24 $GLOBALS['phpgw']->session->appsession('mobile.layout','mobile',$params['template']); 26 header("location: index.php ");25 header("location: index.php?menuaction=mobile.ui_mobilemail.change_folder&folder=0"); 27 26 } 28 27 … … 49 48 $this->template->set_var('lang_selected', lang("selected")); 50 49 51 $this->template->set_var('search',$this->template->fp('out','search_bar'));52 53 50 $accountId = $GLOBALS['phpgw_info']['user']['account_id']; 54 51 … … 59 56 $this->set_folder_block($default_folders, "default_folders_box"); 60 57 61 if(isset($params["expand_folders"]) && $params["expand_folders"] == 1) 62 { 63 $personal_folders = $this->imap_functions->get_folders_list(array('noSharedFolders' => true, 'folderType' => 'personal', 'noQuotaInfo' => true)); 64 $this->set_folder_block($personal_folders, "personal_folders_box", sizeof($default_folders)); 65 $this->template->set_var('expand_folders', 0); 66 } else { 67 $this->template->set_var('expand_folders', 1); 68 } 58 $personal_folders = $this->imap_functions->get_folders_list(array('noSharedFolders' => true, 'folderType' => 'personal', 'noQuotaInfo' => true)); 59 $this->set_folder_block($personal_folders, "personal_folders_box", sizeof($default_folders)); 69 60 70 61 $this->template->set_var('quota_percent', $total_quota["quota_percent"]); … … 92 83 ) ); 93 84 94 $events 85 $events = $this->bocalendar->cached_events; 95 86 96 87 foreach($events[$year.$this->common->complete_string($month,2,"R","0").$this->common->complete_string($day,2,"R","0")] as $index=>$event) … … 105 96 $GLOBALS['phpgw_info']['mobiletemplate']->set_error_msg($params["error_message"]); 106 97 $GLOBALS['phpgw_info']['mobiletemplate']->set_success_msg($params["success_message"]); 107 if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')=="mini") 98 99 if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')=="mini_desktop") { 108 100 $GLOBALS['phpgw_info']['mobiletemplate']->set_home($this->template->fp('out', 'page')); 109 else 101 } else { 102 $this->template->set_var('search',$this->template->fp('out','search_bar')); 110 103 $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'page')); 104 } 111 105 112 106 } … … 149 143 150 144 $p = $this->template; 151 $p->set_file( 152 Array( 153 'search' => 'home_search.tpl', 154 'home_search_bar' => 'search_bar.tpl' 155 ) 156 ); 145 $p->set_file(array('home_search' => 'home_search.tpl')); 146 $p->set_file(array('home_search_bar' => 'search_bar.tpl')); 157 147 158 148 //Langs gerais da página 159 $p->set_block(' search','home_search');160 $p->set_block(" search","row_events");161 $p->set_block(" search","no_events");149 $p->set_block('home_search','main'); 150 $p->set_block("home_search","row_events"); 151 $p->set_block("home_search","no_events"); 162 152 $p->set_block('home_search_bar','search_bar'); 163 153 … … 184 174 $p->set_var('show_more_events',"none"); 185 175 $p->set_var('contacts_request_from', 186 isset($params["request_from"])? 187 $params["request_from"]:"none"); 188 189 $p->set_var('search',$p->fp('out','search_bar')); 176 isset($params["request_from"])? 177 $params["request_from"]:"none"); 178 179 if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop") { 180 $p->set_var('search',$p->fp('out','search_bar')); 181 } 190 182 191 183 //E-mails … … 194 186 if($params['default_folders']==="1") { 195 187 if($params['personal_folders']!=="1") 196 $mail_params['folderType'] = 'default'; 188 $mail_params['folderType'] = 'default'; 197 189 } 198 190 else { … … 324 316 } 325 317 326 $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out',' home_search'));318 $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out','main')); 327 319 328 320 } -
branches/2.2/mobile/inc/class.ui_mobilecalendar.inc.php
r3696 r3731 41 41 $this->template->set_var('lang_search',lang("search")); 42 42 43 $this->template->set_var('search',$this->template->fp('out','search_bar')); 43 if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop") 44 $this->template->set_var('search',$this->template->fp('out','search_bar')); 44 45 45 46 if(!function_exists("get_events")){ -
branches/2.2/mobile/inc/class.ui_mobilecc.inc.php
r3710 r3731 146 146 "none":$this->page_info["request_from"]); 147 147 148 $this->template->set_var('search',$this->template->fp('out','search_bar')); 148 if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop") 149 $this->template->set_var('search',$this->template->fp('out','search_bar')); 149 150 150 151 //Combo de catálogos -
branches/2.2/mobile/inc/class.ui_mobilemail.inc.php
r3697 r3731 446 446 $p->set_var("lang_more",lang("more")); 447 447 $p->set_var("lang_messages",lang("messages")); 448 $p->set_var('search',$p->fp('out','search_bar')); 448 449 if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop") 450 $p->set_var('search',$p->fp('out','search_bar')); 449 451 450 452 $max_per_page =
Note: See TracChangeset
for help on using the changeset viewer.