本文整理汇总了PHP中Base_ThemeCommon::get_template_file方法的典型用法代码示例。如果您正苦于以下问题:PHP Base_ThemeCommon::get_template_file方法的具体用法?PHP Base_ThemeCommon::get_template_file怎么用?PHP Base_ThemeCommon::get_template_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base_ThemeCommon
的用法示例。
在下文中一共展示了Base_ThemeCommon::get_template_file方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: manage
public function manage()
{
if (!Base_EpesiStoreCommon::admin_access()) {
return;
}
$button_label = Base_EssClientCommon::has_license_key() ? __('License Key') : __('Register EPESI!');
Base_ActionBarCommon::add(Base_ThemeCommon::get_template_file('Base_EpesiStore', 'icon.png'), $button_label, $this->create_callback_href(array($this, 'display_registration_form')));
Base_ActionBarCommon::add('view', __('Invoices'), $this->create_callback_href(array($this, 'display_invoices')));
$setup = $this->init_module('Base_Setup');
$setup->set_inline_display();
if (Base_SetupCommon::is_simple_setup()) {
if (!$this->isset_module_variable('filter_set')) {
eval_js('base_setup__last_filter="' . (!Base_EssClientCommon::has_license_key() ? '' : (Base_EpesiStoreCommon::is_update_available() ? 'updates' : 'store')) . '";');
$this->set_module_variable('filter_set', true);
}
$this->display_module($setup, array(true), 'admin');
return;
}
Base_ActionBarCommon::add('settings', __('Simple view'), $this->create_callback_href(array($this, 'switch_simple'), true));
$tb = $this->init_module('Utils_TabbedBrowser');
$tb->set_tab('Modules Setup', array($this, 'setup_admin'), array($setup));
$tb->set_tab('Epesi Store', array($this, 'form_main_store'), array());
$tb->tag();
$this->display_module($tb);
}
示例2: submit_contact
public static function submit_contact($values, $mode)
{
if ($mode == 'display') {
$ret = array();
$in = self::Instance();
$filename = self::get_photo($values['id']);
if ($filename) {
$file = $in->get_data_dir() . $filename;
} else {
$file = Base_ThemeCommon::get_template_file('CRM/Contacts/Photo', 'placeholder.png');
$ret['photo_note'] = __('Click to change');
}
$ret['photo_link'] = Module::create_href(array('upload_new_photo' => $values['id'])) . ' ' . Utils_TooltipCommon::open_tag_attrs(__('Click to change the photo'), false);
$ret['photo_src'] = $file;
} else {
$ret = $values;
}
if (isset($_REQUEST['upload_new_photo']) && $_REQUEST['upload_new_photo'] == $values['id']) {
unset($_REQUEST['upload_new_photo']);
$x = ModuleManager::get_instance('/Base_Box|0');
if (!$x) {
trigger_error('There is no base box module instance', E_USER_ERROR);
}
$x->push_main('CRM/Contacts/Photo', 'body', array($values));
}
return $ret;
}
示例3: print_structure
private function print_structure($t = array(), $level = 0, $path = null) {
if(count($t) > 0) {
if($path===null) {
$this->_sub = 0;
$ret = '<div class=utils_tree_root>';
} else {
$ret = '<div class=utils_tree_submenu id=utils_tree_'.$this->_id.'_'.$this->_sub.'>';
$this->_sub++;
}
foreach( $t as $k => $v ) {
$ret .= '<div id=utils_tree_node_'.$this->_id.' class=utils_tree_node onmouseover=\'if(typeof(utils_tree_hl)!="undefined")utils_tree_hl(this)\' onmouseout=\'if(typeof(utils_tree_rg)!="undefined")utils_tree_rg(this)\'><table><tr>';
if(isset($v['sub']) && count($v['sub']) > 0)
$ret .= '<td id=utils_tree_opener_'.$this->_id.'_'.($this->_sub).' class=utils_tree_opener_active_closed onclick="tree_node_visibility_toggle('.$this->_id.', '.($this->_sub).')"><img id=utils_tree_opener_img_'.$this->_id.'_'.($this->_sub).' src="'.Base_ThemeCommon::get_template_file($this->get_type(),'opener_active_closed.gif').'"></td>';
else
$ret .= '<td class=utils_tree_opener_inactive><img src="'.Base_ThemeCommon::get_template_file($this->get_type(),'opener_inactive.gif').'"></td>';
if(isset($v['selected']) && $v['selected'] == 1)
$ret .= "<td class=utils_tree_node_content_selected>".$v['name']."</td>";
else
$ret .= "<td class=utils_tree_node_content>".$v['name']."</td>";
if(isset($v['visible']) && $v['visible'] == 1 && $path!==null)
array_push($this->_opened_paths, $path);
if(isset($v['opened']) && $v['opened'] == 1 && is_array($v['sub']) && !empty($v['sub']))
array_push($this->_opened_paths, $path.'_'.$this->_sub);
$ret .= "</tr></table></div>";
if(isset($v['sub']) && is_array($v['sub'])) {
$ret .= $this->print_structure($v['sub'], $level + 1, $path.'_'.$this->_sub);
}
}
$ret .= "</div>";
return $ret;
}
return '';
}
示例4: get_ini_file
public static function get_ini_file()
{
if (Base_BoxCommon::$ini_file) {
$ini = Base_BoxCommon::$ini_file;
} else {
$ini = Base_ThemeCommon::get_template_file('Base_Box', 'default.ini');
}
return $ini;
}
示例5: get_ini_file
public static function get_ini_file()
{
if (Base_BoxCommon::$ini_file) {
$ini = Base_BoxCommon::$ini_file;
} elseif (file_exists($ini = Base_ThemeCommon::get_template_file('Base_Box', 'default.ini'))) {
return $ini;
} else {
$ini = __DIR__ . '/default.ini';
}
return file_exists($ini) ? $ini : null;
}
示例6: ajax_open_tag_attrs
/**
* Returns string that when placed as tag attribute
* will enable ajax request to set a tooltip when placing mouse over that element.
*
* @param callback method that will be called to get tooltip content
* @param array parameters that will be passed to the callback
* @return string HTML tag attributes
*/
public static function ajax_open_tag_attrs( $callback, $args, $max_width=300 ) {
if(MOBILE_DEVICE) return '';
static $tooltip_id = 0;
static $tooltip_cleared = false;
if (isset($_REQUEST['__location']) && $tooltip_cleared!=$_REQUEST['__location']) {
$tooltip_cleared = $_REQUEST['__location'];
$tooltip_id = 0;
}
$tooltip_id++;
$_SESSION['client']['utils_tooltip']['callbacks'][$tooltip_id] = array('callback'=>$callback, 'args'=>$args);
$loading_message = '<center><img src='.Base_ThemeCommon::get_template_file('Utils_Tooltip','loader.gif').' /><br/>'.__('Loading...').'</center>';
return ' onMouseMove="if(typeof(Utils_Tooltip__showTip)!=\'undefined\')Utils_Tooltip__load_ajax_Tip(this,event,'.$max_width.')" tip="'.$loading_message.'" tooltip_id="'.$tooltip_id.'" onMouseOut="if(typeof(Utils_Tooltip__hideTip)!=\'undefined\')Utils_Tooltip__hideTip()" onMouseUp="if(typeof(Utils_Tooltip__hideTip)!=\'undefined\')Utils_Tooltip__hideTip()" ';
}
示例7: show
public static function show($name, $function = '', $mode = null, $first_day_of_week = null, $pos_js = null, $label = null, $default = null)
{
// label seems to be unused and always null.
if ($label === null) {
if ($mode == 'month') {
$label = __('Select month');
} elseif ($mode == 'year') {
$label = __('Select year');
} else {
$label = __('Select date');
}
}
return '<a class="button" ' . self::create_href($name, $function, $mode, $first_day_of_week, $pos_js, $default) . '>' . $label . ' <img style="vertical-align: middle;" src=' . Base_ThemeCommon::get_template_file('Utils_PopupCalendar', 'select.png') . '>' . '</a>';
}
示例8: display
public static function display($header, $content, $info = false)
{
$l = Variable::get('logo_file', false);
if (!$l) {
$l = Base_ThemeCommon::get_template_file('images/logo-small.png');
}
$smarty = Base_ThemeCommon::init_smarty();
$smarty->assign('header', $header);
$smarty->assign('contents', $content);
$smarty->assign('info', $info);
$smarty->assign('footer', '');
$smarty->assign('logo', $l);
$smarty->assign('url', get_epesi_url());
Base_ThemeCommon::display_smarty($smarty, 'Utils_FrontPage', 'default');
}
示例9: prepare_header
public static function prepare_header(&$tcpdf, $title = '', $subject = '', $printed_by = true, $logo_filename = null, $l = array())
{
if ($title !== null) {
if ($logo_filename === null) {
$logo_filename = Libs_TCPDFCommon::get_logo_filename();
}
if ($logo_filename !== false && !file_exists($logo_filename)) {
$logo_filename = Base_ThemeCommon::get_template_file(Libs_TCPDF::module_name(), 'logo-small.png');
}
$margins = $tcpdf->getMargins();
if ($logo_filename) {
$logo_size = getimagesize($logo_filename);
$logo_height = $logo_size[1] * PDF_HEADER_LOGO_WIDTH / $logo_size[0];
} else {
$logo_height = 0;
}
$tcpdf->SetHeaderMargin(10);
$tcpdf->SetTopMargin($logo_height + $margins['top']);
$tcpdf->SetHeaderData($logo_filename, $logo_filename ? PDF_HEADER_LOGO_WIDTH : 0, $title, $subject);
} else {
$tcpdf->setPrintHeader(false);
}
//set some language-dependent strings
$l['a_meta_charset'] = "UTF-8";
$l['a_meta_dir'] = "ltr";
$l['a_meta_language'] = "pl";
$who = null;
if (CRM_ContactsInstall::is_installed()) {
$who = CRM_ContactsCommon::get_contact_by_user_id(Acl::get_user());
}
if ($who !== null) {
$who = $who['last_name'] . ' ' . $who['first_name'];
} else {
$who = Base_UserCommon::get_user_login(Acl::get_user());
}
$when = date('Y-m-d H:i:s');
if (!isset($l['w_page'])) {
$l['w_page'] = '';
if ($printed_by) {
$product_name = EPESI;
$url = EPESI == 'EPESI' ? ' (http://epe.si)' : '';
$l['w_page'] .= __('Printed with %s by %s, on %s, ', array($product_name . $url, $who, $when));
}
$l['w_page'] .= __('Page');
}
$tcpdf->setLanguageArray($l);
self::SetFont($tcpdf, self::$default_font, '', 9);
}
示例10: applet
public function applet()
{
Base_ThemeCommon::load_css($this->get_type());
print '<div id="google">';
print '
<form method="get" action="http://www.google.com/search" target="_blank">
<fieldset style="border: 0px;">
<a href="http://www.google.com/search"><img src="' . Base_ThemeCommon::get_template_file('Applets/Google', 'Logo_40wht.gif') . '" alt="Google" style="border: 0px; width: 128px; height: 53px;" /></a>
<center>
<table>
<tr>
<td><input name="q" size="30" maxlength="255" value="" type="text" /></td>
<td><input class="button" name="sa" value="' . __('Search') . '" type="submit" /></td>
</tr>
</table>
</center>
</fieldset>
</form>
';
print '</div>';
}
示例11: get_error_closing_button
public static function get_error_closing_button()
{
return ' <a href="javascript:void(0);" onclick="this.parentNode.innerHTML=\'\'"><img src="' . Base_ThemeCommon::get_template_file('Libs_QuickForm', 'close.png') . '"></a>';
}
示例12: crm_event_get
//.........这里部分代码省略.........
return null;
}
$numdays = date('t', $iday);
$cday = date('d', $iday);
$tday = date('d', strtotime($r['date']));
if ($cday != $tday && ($tday <= $numdays || $numdays != $cday)) {
return null;
}
}
$next['id'] = $r['id'];
}
if ($r['recurrence_type'] > 0) {
$next['id'] = $r['id'] . '_' . $day;
}
$base_unix_time = strtotime(date('1970-01-01 00:00:00'));
// $next['start'] = Base_RegionalSettingsCommon::reg2time(Base_RegionalSettingsCommon::time2reg(date('Y-m-d',$iday).' '.date('H:i:s',strtotime($r['time'])), true, false, true, false));
// $next['end'] = Base_RegionalSettingsCommon::reg2time(date('Y-m-d',$iday).' '.Base_RegionalSettingsCommon::time2reg(date('Y-m-d',$iday).' '.date('H:i:s',strtotime($r['time'])+$r['duration']), true, false, true, false));
$next['start'] = date('Y-m-d', $iday) . ' ' . date('H:i:s', strtotime($r['time']));
$next['end'] = date('Y-m-d', $iday) . ' ' . date('H:i:s', strtotime($r['time']) + $r['duration']);
$next['start'] = strtotime($next['start']);
$next['end'] = strtotime($next['end']);
if ($r['duration'] == -1) {
$next['timeless'] = $day;
}
$next['duration'] = intval($r['duration']);
$next['title'] = (string) $r['title'];
$next['description'] = (string) $r['description'];
$next['color'] = 'gray';
if ($r['status'] == 0 || $r['status'] == 1) {
switch ($r['priority']) {
case 0:
$next['color'] = 'green';
break;
case 1:
$next['color'] = 'yellow';
break;
case 2:
$next['color'] = 'red';
break;
}
}
if ($r['status'] == 2) {
$next['color'] = 'blue';
}
if ($r['status'] == 3) {
$next['color'] = 'gray';
}
if ($r['recurrence_type']) {
$next['title'] = '<img src="' . Base_ThemeCommon::get_template_file('CRM_Calendar_Event', 'recurrence.png') . '" border=0 hspace=0 vspace=0 align=left>' . $next['title'];
}
$next['view_action'] = Utils_RecordBrowserCommon::create_record_href('crm_meeting', $r['id'], 'view', array('day' => $day));
if (Utils_RecordBrowserCommon::get_access('crm_meeting', 'edit', $r) !== false) {
$next['edit_action'] = Utils_RecordBrowserCommon::create_record_href('crm_meeting', $r['id'], 'edit');
if ($r['status'] <= 1) {
$r_new = $r;
if ($r['status'] == 0) {
$r_new['status'] = 1;
}
$next['actions'] = array(array('icon' => Base_ThemeCommon::get_template_file('CRM/Meeting', 'close_event.png'), 'href' => self::get_status_change_leightbox_href($r_new, false, array('id' => 'status'))));
}
} else {
$next['edit_action'] = false;
$next['move_action'] = false;
}
if (Utils_RecordBrowserCommon::get_access('crm_meeting', 'delete', $r) == false) {
$next['delete_action'] = false;
}
$start_time = Base_RegionalSettingsCommon::time2reg($next['start'], 2, false, $r['duration'] != -1);
$event_date = Base_RegionalSettingsCommon::time2reg($next['start'], false, 3, $r['duration'] != -1);
$end_time = Base_RegionalSettingsCommon::time2reg($next['end'], 2, false, $r['duration'] != -1);
$inf2 = array(__('Date') => '<b>' . $event_date . '</b>');
if ($r['duration'] == -1) {
$inf2 += array(__('Time') => __('Timeless event'));
} else {
$inf2 += array(__('Time') => $start_time . ' - ' . $end_time, __('Duration') => Base_RegionalSettingsCommon::seconds_to_words($r['duration']));
}
$emps = array();
foreach ($r['employees'] as $e) {
$e = CRM_ContactsCommon::contact_format_no_company($e, true);
$e = str_replace(' ', ' ', $e);
if (mb_strlen($e, 'UTF-8') > 33) {
$e = mb_substr($e, 0, 30, 'UTF-8') . '...';
}
$emps[] = $e;
}
$next['busy_label'] = $r['employees'];
$cuss = array();
foreach ($r['customers'] as $c) {
$c = CRM_ContactsCommon::display_company_contact(array('customers' => $c), true, array('id' => 'customers'));
$cuss[] = str_replace(' ', ' ', $c);
}
$inf2 += array(__('Event') => '<b>' . $next['title'] . '</b>', __('Description') => $next['description'], __('Assigned to') => implode('<br>', $emps), __('Contacts') => implode('<br>', $cuss), __('Status') => Utils_CommonDataCommon::get_value('CRM/Status/' . $r['status'], true), __('Access') => Utils_CommonDataCommon::get_value('CRM/Access/' . $r['permission'], true), __('Priority') => Utils_CommonDataCommon::get_value('CRM/Priority/' . $r['priority'], true), __('Notes') => Utils_AttachmentCommon::count('crm_meeting/' . $r['id']));
// $next['employees'] = implode('<br>',$emps);
// $next['customers'] = implode('<br>',$cuss);
$next['employees'] = $r['employees'];
$next['customers'] = $r['customers'];
$next['status'] = $r['status'] <= 2 ? 'active' : 'closed';
$next['custom_tooltip'] = '<center><b>' . __('Meeting') . '</b></center><br>' . Utils_TooltipCommon::format_info_tooltip($inf2) . '<hr>' . CRM_ContactsCommon::get_html_record_info($r['created_by'], $r['created_on'], null, null);
return $next;
}
示例13: manage_permissions
public function manage_permissions() {
$this->help('Permissions Editor','permissions');
$this->init();
$gb = $this->init_module('Utils/GenericBrowser','permissions_'.$this->tab, 'permissions_'.$this->tab);
$gb->set_table_columns(array(
array('name'=>__('Access type'), 'width'=>'100px'),
array('name'=>__('Clearance required'), 'width'=>'30'),
array('name'=>__('Applies to records'), 'width'=>'60'),
array('name'=>__('Fields'), 'width'=>'100px')
));
$ret = DB::Execute('SELECT * FROM '.$this->tab.'_access AS acs ORDER BY action DESC');
$tmp = DB::GetAll('SELECT * FROM '.$this->tab.'_access_clearance AS acs');
$clearance = array();
foreach ($tmp as $t) $clearance[$t['rule_id']][] = $t['clearance'];
$tmp = DB::GetAll('SELECT * FROM '.$this->tab.'_access_fields AS acs');
$fields = array();
foreach ($tmp as $t) $fields[$t['rule_id']][] = $t['block_field'];
$all_clearances = array_flip(Base_AclCommon::get_clearance(true));
$all_fields = array();
foreach ($this->table_rows as $v)
$all_fields[$v['id']] = $v['name'];
$actions = $this->get_permission_actions();
$rules = array();
while ($row = $ret->FetchRow()) {
if (!isset($clearance[$row['id']])) $clearance[$row['id']] = array();
if (!isset($fields[$row['id']])) $fields[$row['id']] = array();
$action = $actions[$row['action']];
$crits = Utils_RecordBrowserCommon::parse_access_crits($row['crits'], true);
$crits = Utils_RecordBrowserCommon::crits_to_words($this->tab, $crits, false);
$crits_text = '';
foreach ($crits as $c) {
switch ($c) {
case 'and': $crits_text .= '<span class="joint">'.__('and').'</span><br>'; break;
case 'or': $crits_text .= '<span class="joint">'.__('or').'</span> '; break;
default: $crits_text .= $c.' ';
}
}
foreach ($fields[$row['id']] as $k=>$v)
if (isset($all_fields[$v]))
$fields[$row['id']][$k] = $all_fields[$v];
else
unset($fields[$row['id']][$k]);
foreach ($clearance[$row['id']] as $k=>$v)
if (isset($all_clearances[$v])) $clearance[$row['id']][$k] = $all_clearances[$v];
else unset($clearance[$row['id']][$k]);
$c_all_fields = count($all_fields);
$c_fields = count($fields[$row['id']]);
$props = $c_all_fields?($c_all_fields-$c_fields)/$c_all_fields:0;
$color = dechex(255-68*$props).dechex(187+68*$props).'BB';
$fields_value = ($c_all_fields-$c_fields).' / '.$c_all_fields;
if ($props!=1) $fields_value = Utils_TooltipCommon::create($fields_value, '<b>'.__('Excluded fields').':</b><hr>'.implode('<br>',$fields[$row['id']]), false);
$rules[$row['action']][$row['id']] = array(
$action,
'<span class="Utils_RecordBrowser__permissions_crits">'.implode(' <span class="joint">'.__('and').'</span><br>',$clearance[$row['id']]).'</span>',
array('value'=>'<span class="Utils_RecordBrowser__permissions_crits">'.$crits_text.'</span>', 'overflow_box'=>false),
array('style'=>'background-color:#'.$color, 'value'=>$fields_value)
);
}
foreach ($actions as $a=>$l)
if (isset($rules[$a]))
foreach ($rules[$a] as $id=>$vals) {
$gb_row = $gb->get_new_row();
$gb_row->add_data_array($vals);
if (Base_AdminCommon::get_access('Utils_RecordBrowser', 'permissions')==2) {
$gb_row->add_action($this->create_callback_href(array($this, 'edit_permissions_rule'), array($id)), 'edit', 'Edit');
$gb_row->add_action($this->create_callback_href(array($this, 'edit_permissions_rule'), array($id, true)), 'copy', __('Clone rule'), Base_ThemeCommon::get_template_file('Utils/Attachment','copy_small.png'));
$gb_row->add_action($this->create_confirm_callback_href(__('Are you sure you want to delete this rule?'), array($this, 'delete_permissions_rule'), array($id)), 'delete', 'Delete');
}
}
if (Base_AdminCommon::get_access('Utils_RecordBrowser', 'permissions')==2)
Base_ActionBarCommon::add('add',__('Add new rule'), $this->create_callback_href(array($this, 'edit_permissions_rule'), array(null)));
Base_ThemeCommon::load_css('Utils_RecordBrowser', 'edit_permissions');
$this->display_module($gb);
eval_js('utils_recordbrowser__crits_initialized = false;');
}
示例14: dashboard
private function dashboard()
{
load_js($this->get_module_dir() . 'ab.js');
$default_dash = $this->get_module_variable('default');
$config_mode = $this->get_module_variable('config_mode', false);
if ($default_dash || Base_DashboardCommon::has_permission_to_manage_applets()) {
if ($config_mode) {
Base_ActionBarCommon::add('back', __('Done'), $this->create_callback_href(array($this, 'switch_config_mode')));
} else {
Base_ActionBarCommon::add('settings', __('Config'), $this->create_callback_href(array($this, 'switch_config_mode')));
}
}
if ($default_dash || !Base_DashboardCommon::has_permission_to_manage_applets()) {
$tabs = DB::GetAll('SELECT * FROM base_dashboard_default_tabs ORDER BY pos');
} else {
$tabs = DB::GetAll('SELECT * FROM base_dashboard_tabs WHERE user_login_id=%d ORDER BY pos', array(Base_AclCommon::get_user()));
if (!$tabs) {
Base_DashboardCommon::set_default_applets();
$tabs = DB::GetAll('SELECT * FROM base_dashboard_tabs WHERE user_login_id=%d ORDER BY pos', array(Base_AclCommon::get_user()));
}
}
if ($config_mode) {
// *** New tab code ****
$f = $this->init_module('Libs_QuickForm');
$f->addElement('hidden', 'tab_name', 'Tab Name', array('id' => 'dashboard_tab_name'));
$f->addElement('hidden', 'id', 'Tab ID', array('id' => 'dashboard_tab_id'));
$f->display();
if ($f->validate()) {
$vals = $f->exportValues();
$name = $vals['tab_name'];
if ($name) {
$id = $vals['id'];
$table = 'base_dashboard_' . ($default_dash ? 'default_' : '') . 'tabs';
if ($id) {
DB::Execute('UPDATE ' . $table . ' SET name=%s WHERE id=%d', array($name, $id));
} else {
if ($default_dash) {
$max = DB::GetOne('SELECT max(pos)+1 FROM ' . $table);
if ($max === false || $max === null) {
$max = 0;
}
DB::Execute('INSERT INTO ' . $table . '(name,pos) VALUES(%s,%d)', array($name, $max));
} else {
$max = DB::GetOne('SELECT max(pos)+1 FROM ' . $table . ' WHERE user_login_id=%d', array(Base_AclCommon::get_user()));
if ($max === false || $max === null) {
$max = 0;
}
DB::Execute('INSERT INTO ' . $table . '(name,pos,user_login_id) VALUES(%s,%d,%d)', array($name, $max, Base_AclCommon::get_user()));
}
}
location(array());
return;
}
}
eval_js('edit_dashboard_tab=function(id){if(get_new_dashboard_tab_name("' . __('Enter label for the Dashboard tab') . '","' . __('Label cannot be empty') . '",id)){' . $f->get_submit_form_js() . '}}');
}
if ($config_mode) {
print '<table style="width:100%;"><tr><td style="width:75%;vertical-align:top;">';
}
$init_tabs_js = array();
if (count($tabs) > 1 || $config_mode) {
foreach ($tabs as $tab) {
$label = $tab['name'];
$buttons = array();
if ($config_mode) {
$label .= ' ';
if ($tab['pos'] > $tabs[0]['pos']) {
$label .= '<a ' . $this->create_callback_href(array($this, 'move_tab'), array($tab['id'], $tab['pos'], -1)) . '><img src="' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'roll-left.png') . '" onMouseOver="this.src=\'' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'roll-left-hover.png') . '\';" onMouseOut="this.src=\'' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'roll-left.png') . '\';" width="14" height="14" alt="<" border="0"></a>';
}
if ($tab['pos'] < $tabs[count($tabs) - 1]['pos']) {
$label .= '<a ' . $this->create_callback_href(array($this, 'move_tab'), array($tab['id'], $tab['pos'], +1)) . '><img src="' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'roll-right.png') . '" onMouseOver="this.src=\'' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'roll-right-hover.png') . '\';" onMouseOut="this.src=\'' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'roll-right.png') . '\';" width="14" height="14" alt="<" border="0"></a>';
}
$label .= '<a href="javascript:void(0);" onclick="edit_dashboard_tab(' . $tab['id'] . ');"><img src="' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'configure.png') . '" onMouseOver="this.src=\'' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'configure-hover.png') . '\';" onMouseOut="this.src=\'' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'configure.png') . '\';" width="14" height="14" alt="<" border="0"></a>';
$label .= '<a ' . $this->create_confirm_callback_href(__('Delete this tab and all applets assigned to it?'), array($this, 'delete_tab'), $tab['id']) . '><img src="' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'close.png') . '" onMouseOver="this.src=\'' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'close-hover.png') . '\';" onMouseOut="this.src=\'' . Base_ThemeCommon::get_template_file('/Base/Dashboard', 'close.png') . '\';" width="14" height="14" alt="<" border="0"></a>';
}
$this->tb->set_tab($label, array($this, 'display_dashboard'), $tab['id'], $config_mode, $buttons);
$init_tabs_js[] = $tab['id'];
}
if ($config_mode) {
// *** New tab button ****
$this->tb->start_tab(__('Add new Tab'));
$this->tb->set_href('href="javascript:void(0);" onclick="edit_dashboard_tab(null);"');
$this->tb->end_tab();
}
$remember_tab = Base_User_SettingsCommon::get('Base_Dashboard', 'remember_tab');
if ($remember_tab) {
if (isset($_REQUEST['__homepage_req_session__']) && isset($_SESSION['client']['dashboard_tab'])) {
$this->tb->switch_tab($_SESSION['client']['dashboard_tab']);
//force switch tab
} elseif (isset($_SESSION['client']['dashboard_tab'])) {
$this->tb->set_default_tab($_SESSION['client']['dashboard_tab']);
} else {
$this->tb->set_default_tab($this->tb->get_tab());
}
$_SESSION['client']['dashboard_tab'] = $this->tb->get_tab();
}
$this->display_module($this->tb);
$this->tb->tag();
} else {
$this->display_dashboard($tabs[0]['id']);
//.........这里部分代码省略.........
示例15: mobile_table
public static function mobile_table($cols, $data, $enable_sort = true)
{
if ($enable_sort && is_string($enable_sort) && !isset($_GET['order'])) {
$x = explode(' ', $enable_sort);
foreach ($cols as $i => $v) {
if ($x[0] == $v['order']) {
$_GET['order'] = $i;
}
}
if (isset($_GET['order'])) {
if (count($x) < 2) {
$_GET['order_dir'] = 'asc';
} else {
$_GET['order_dir'] = $x[1];
}
}
}
$th = Base_ThemeCommon::init_smarty();
$all_width = 0;
foreach ($cols as $v) {
if (array_key_exists('display', $v) && $v['display'] == false) {
continue;
}
if (isset($v['width'])) {
$all_width += $v['width'];
}
}
$headers = array();
foreach ($cols as $i => $v) {
if (array_key_exists('display', $v) && $v['display'] == false) {
continue;
}
if (isset($v['order'])) {
$is_order = true;
}
$headers[$i] = array();
if (isset($_GET['order']) && isset($_GET['order_dir']) && $i == $_GET['order']) {
$sort_direction = $_GET['order_dir'] == 'desc' ? 'asc' : 'desc';
$sort = 'style="padding-right: 12px; background-image: url(' . Base_ThemeCommon::get_template_file('Utils_GenericBrowser', 'sort-' . $sort_direction . 'ending.png') . '); background-repeat: no-repeat; background-position: right;"';
} else {
$sort = '';
$sort_direction = 'asc';
}
$headers[$i]['label'] = (isset($v['preppend']) ? $v['preppend'] : '') . (isset($v['order']) ? '<a href="mobile.php?' . http_build_query(array_merge($_GET, array('order' => $i, 'order_dir' => $sort_direction))) . '">' . '<span ' . $sort . '>' . $v['name'] . '</span></a>' : '<span>' . $v['name'] . '</span>') . (isset($v['append']) ? $v['append'] : '');
$headers[$i]['attrs'] = '';
if ($all_width && isset($v['width'])) {
$headers[$i]['attrs'] .= 'style="width: ' . intval(100 * $v['width'] / $all_width) . '%" ';
}
$headers[$i]['attrs'] .= 'nowrap="1" ';
}
$th->assign('cols', array_values($headers));
//sort data
if ($enable_sort && isset($_GET['order']) && isset($_GET['order_dir'])) {
$col = array();
foreach ($data as $j => $d) {
foreach ($d as $i => $c) {
if (isset($cols[$i]['order']) && $i == $_GET['order']) {
if (is_array($c)) {
if (isset($c['order_value'])) {
$xxx = $c['order_value'];
} else {
$xxx = $c['value'];
}
} else {
$xxx = $c;
}
if (isset($cols[$i]['order_preg'])) {
$ret = array();
preg_match($cols[$i]['order_preg'], $xxx, $ret);
$xxx = isset($ret[1]) ? $ret[1] : '';
}
$xxx = strip_tags(strtolower($xxx));
$col[$j] = $xxx;
}
}
}
asort($col);
$data2 = array();
foreach ($col as $j => $v) {
$data2[] = $data[$j];
}
if ($_GET['order_dir'] != 'asc') {
$data2 = array_reverse($data2);
}
$data = $data2;
}
$out_data = array();
foreach ($data as $row) {
foreach ($row as $k => $cell) {
if (!isset($cols[$k]) || array_key_exists('display', $cols[$k]) && $cols[$k]['display'] == false) {
continue;
}
if (!is_array($cell)) {
$cell .= ' ';
$out_data[] = array('label' => $cell, 'attrs' => '');
} else {
if (!isset($cell['attrs'])) {
$cell['attrs'] = '';
}
if (!isset($cell['label'])) {
//.........这里部分代码省略.........