本文整理汇总了PHP中Base_ThemeCommon::load_css方法的典型用法代码示例。如果您正苦于以下问题:PHP Base_ThemeCommon::load_css方法的具体用法?PHP Base_ThemeCommon::load_css怎么用?PHP Base_ThemeCommon::load_css使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base_ThemeCommon
的用法示例。
在下文中一共展示了Base_ThemeCommon::load_css方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
public static function get($id, $content, $header = '', $big = 0)
{
if (MOBILE_DEVICE) {
return '';
}
static $init = true;
if ($init) {
Base_ThemeCommon::load_css('Libs/Leightbox', 'default', false);
load_js('modules/Libs/Leightbox/leightbox.js');
$init = false;
}
ob_start();
print '<div id="' . $id . '" big="1" class="leightbox">';
print '<input type="hidden" id="' . $id . '_bigsize" value="' . ($big ? 1 : 0) . '" />';
if ($big) {
eval_js('s = $(\'' . $id . '\').style;' . 's.top = \'5%\';' . 's.left = \'5%\';' . 's.width = \'90%\';' . 's.height = \'90%\';' . 's.padding = \'0px\';');
}
$smarty = Base_ThemeCommon::init_smarty();
$smarty->assign('close_href', 'href="javascript:leightbox_deactivate(\'' . $id . '\')"');
$smarty->assign('content', $content);
$smarty->assign('header', $header);
$smarty->assign('close_label', __('Close'));
$smarty->assign('resize_label', __('Resize'));
$smarty->assign('close_href', 'href="javascript:leightbox_deactivate(\'' . $id . '\')"');
Base_ThemeCommon::display_smarty($smarty, 'Libs_Leightbox');
print '</div>';
return ob_get_clean();
}
示例2: applet
public function applet($values, &$opts)
{
//available applet options: toggle,href,title,go,go_function,go_arguments,go_contruct_arguments
Base_ThemeCommon::load_css($this->get_type());
$opts['title'] = $values['title'];
print '<div id="Applets_Note"><div class="note-' . $values['bcolor'] . '">';
print $values['text'];
//print (str_replace("\n",'<br>',$values['text']));
print '</div></div>';
}
示例3: body
public function body($arg = null, $rb = null, $uid = null)
{
if (isset($arg) && isset($rb)) {
$this->group = $rb->tab . '/' . $arg['id'];
if (Utils_WatchdogCommon::get_category_id($rb->tab) !== null) {
$this->watchdog_category = $rb->tab;
$this->watchdog_id = $arg['id'];
}
$this->set_view_func(array('Utils_RecordBrowserCommon', 'create_default_linked_label'), array($rb->tab, $arg['id']));
}
if (!isset($this->group) && !$uid) {
trigger_error('Key not given to attachment module', E_USER_ERROR);
}
$_SESSION['client']['utils_attachment_group'] = $this->group;
load_js('modules/Utils/Attachment/attachments.js');
Base_ThemeCommon::load_css('Utils_Attachment', 'browse');
$this->rb = $this->init_module(Utils_RecordBrowser::module_name(), 'utils_attachment', 'utils_attachment');
$defaults = array('permission' => Base_User_SettingsCommon::get('CRM_Common', 'default_record_permission'), 'func' => serialize($this->func), 'args' => serialize($this->args));
$rb_cols = array();
$single_group = is_string($this->group) || count($this->group) == 1;
if ($this->force_multiple) {
$single_group = false;
}
if ($single_group) {
$group = is_string($this->group) ? $this->group : reset($this->group);
$defaults['local'] = $group;
} else {
// force attached to display
$rb_cols['attached_to'] = true;
$this->rb->set_button(false);
}
$this->rb->set_defaults($defaults);
$this->rb->set_additional_actions_method(array($this, 'add_actions'));
$this->rb->set_header_properties(array('sticky' => array('width' => 1, 'display' => false), 'attached_to' => array('width' => "16em"), 'edited_on' => array('width' => "12em"), 'title' => array('width' => "20em")));
if ($uid) {
$this->rb->set_button(false);
$this->rb->disable_actions(array('delete'));
$this->display_module($this->rb, array(array(':Created_by' => $uid), $rb_cols, array('sticky' => 'DESC', 'edited_on' => 'DESC')), 'show_data');
} else {
$crits = array();
if (!is_array($this->group)) {
$this->group = array($this->group);
}
if (isset($_SESSION['attachment_copy']) && count($this->group) == 1 && $_SESSION['attachment_copy']['group'] != $this->group) {
$this->rb->new_button(Base_ThemeCommon::get_template_file(Utils_Attachment::module_name(), 'link.png'), __('Paste'), Utils_TooltipCommon::open_tag_attrs($_SESSION['attachment_copy']['text']) . ' ' . $this->create_callback_href(array($this, 'paste')));
}
if ($this->group) {
$g = array_map(array('DB', 'qstr'), $this->group);
$crits['id'] = DB::GetCol('SELECT attachment FROM utils_attachment_local WHERE local IN (' . implode(',', $g) . ')');
} else {
$crits['id'] = 0;
}
$this->display_module($this->rb, array($crits, $rb_cols, array('sticky' => 'DESC', 'edited_on' => 'DESC')), 'show_data');
}
}
示例4: create_href
public static function create_href($name, $function = '', $mode = null, $first_day_of_week = null, $pos_js = null, $default = null, $id = null)
{
Base_ThemeCommon::load_css('Utils_PopupCalendar');
load_js('modules/Utils/PopupCalendar/js/main2.js');
load_js('modules/Utils/PopupCalendar/datepicker.js');
if (!isset($mode)) {
$mode = 'day';
}
if (!isset($first_day_of_week)) {
if (Acl::is_user()) {
$first_day_of_week = self::get_first_day_of_week();
} else {
$first_day_of_week = 0;
}
} elseif (!is_numeric($first_day_of_week)) {
trigger_error('Invalid first day of week', E_USER_ERROR);
}
$calendar = '<div id="Utils_PopupCalendar">' . '<table cellspacing="0" cellpadding="0" border="0"><tr><td id="datepicker_' . $name . '_header">error</td></tr>' . '<tr><td id="datepicker_' . $name . '_view">calendar not loaded</td></tr></table></div>';
$entry = 'datepicker_' . $name . '_calendar';
$butt = $id === null ? 'datepicker_' . $name . '_button' : $id;
$smarty = Base_ThemeCommon::init_smarty();
$smarty->assign('calendar', $calendar);
ob_start();
Base_ThemeCommon::display_smarty($smarty, 'Utils_PopupCalendar');
$cal_out = ob_get_clean();
print '<div id="' . $entry . '" class="utils_popupcalendar_popup" style="display:none;z-index:2050;width:1px;">' . $cal_out . '</div>';
if (!isset($pos_js)) {
$pos_js = 'popup.clonePosition(\'' . $butt . '\',{setWidth:false,setHeight:false,offsetTop:$(\'' . $butt . '\').getHeight()});';
}
eval_js('if(Epesi.ie)$(\'' . $entry . '\').style.position="fixed";else $(\'' . $entry . '\').absolutize();');
$ret = 'onClick="var popup=$(\'' . $entry . '\');' . $pos_js . ';$(\'' . $entry . '\').toggle()" href="javascript:void(0)" id="' . $butt . '"';
$function .= ';$(\'' . $entry . '\').hide()';
if ($default) {
if (!is_numeric($default)) {
$default = strtotime($default);
}
$args = date('Y', $default) . ',' . (date('n', $default) - 1) . ',' . date('d', $default);
} else {
$args = '';
}
$js = 'var datepicker_' . $name . ' = new Utils_PopupCalendar("' . Epesi::escapeJS($function, true, false) . '", \'' . $name . '\',\'' . $mode . '\',\'' . $first_day_of_week . '\',';
$months = array(__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December'));
$days = array(__('Sun'), __('Mon'), __('Tue'), __('Wed'), __('Thu'), __('Fri'), __('Sat'));
$js .= 'new Array(\'' . implode('\',\'', $months) . '\'),';
$js .= 'new Array(\'' . implode('\',\'', $days) . '\')';
$js .= ');' . 'datepicker_' . $name . '.show(' . $args . ')';
eval_js($js);
// eval_js('$(\''.$entry.'\').absolutize();');
return $ret;
}
示例5: applet
public function applet($values, &$opts)
{
//available applet options: toggle,href,title,go,go_function,go_arguments,go_contruct_arguments
Base_ThemeCommon::load_css('Applets_Weather');
$opts['title'] = __('Weather');
$rssfeed = $values['rssfeed'] . '?p=' . $values['zipcode'] . '&u=' . $values['temperature'];
$name = md5($this->get_path() . $rssfeed);
//div for updating
print '<div id="Applets_Weather"><div id="rssfeed_' . $name . '"><span>' . __('Loading Weather...') . '</span></div></div>';
//interval execution
eval_js_once('var rssfeedcache = Array();' . 'rssfeedfunc = function(name,fee,num,cache){' . 'if(!$(\'rssfeed_\'+name)) return;' . 'if(cache && typeof rssfeedcache[name] != \'undefined\')' . '$(\'rssfeed_\'+name).innerHTML = rssfeedcache[name];' . 'else ' . 'new Ajax.Updater(\'rssfeed_\'+name,\'modules/Applets/Weather/refresh.php\',{' . 'method:\'post\',' . 'onComplete:function(r){rssfeedcache[name]=r.responseText},' . 'parameters:{feed:fee, number:num, cid: Epesi.client_id}});' . '}');
eval_js_once('setInterval(\'rssfeedfunc(\\\'' . $name . '\\\',\\\'' . Epesi::escapeJS($rssfeed, false) . '\\\' , 2 , 0)\',1799993)');
//29 minutes and 53 seconds
//get rss now!
eval_js('rssfeedfunc(\'' . $name . '\',\'' . Epesi::escapeJS($rssfeed, false) . '\' , 2 , 1)');
}
示例6: construct
public function construct($indicator = null, $action = '', $target = '', $on_submit = null, $form_name = null)
{
if (!$form_name) {
$form_name = 'libs_qf_' . md5($this->get_path());
}
if ($target == '' && $action != '') {
$target = '_blank';
}
if (!isset($on_submit)) {
$on_submit = $this->get_submit_form_js_by_name($form_name, true, $indicator, '') . "return false;";
}
$this->qf = new HTML_QuickForm($form_name, 'post', $action, $target, array('onSubmit' => $on_submit), true);
$this->qf->addElement('hidden', 'submited', 0);
$this->qf->setRequiredNote('<span class="required_note_star">*</span> <span class="required_note">' . __('denotes required field') . '</span>');
eval_js_once("set_qf_sub0 = function(fn){var x=\$(fn);if(x)x.submited.value=0}");
eval_js("set_qf_sub0('" . addslashes($form_name) . "')");
Base_ThemeCommon::load_css('Libs_QuickForm');
}
示例7: 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>';
}
示例8: applet
public function applet()
{
Base_ThemeCommon::load_css($this->get_type());
print '<div id="calc">';
print '
<center>
<form name="Calc">
<table border="0">
<tr>
<td>
<input class="text" type="text" name="Input" Size="16">
<br>
</td>
</tr>
<tr>
<td>
<input type="button" class="key" name="one" value=" 1 " OnClick="Calc.Input.value += \'1\'">
<input type="button" class="key" name="two" value=" 2 " OnCLick="Calc.Input.value += \'2\'">
<input type="button" class="key" name="three" value=" 3 " OnClick="Calc.Input.value += \'3\'">
<input type="button" class="key" name="plus" value=" + " OnClick="Calc.Input.value += \' + \'"><br>
<input type="button" class="key" name="four" value=" 4 " OnClick="Calc.Input.value += \'4\'">
<input type="button" class="key" name="five" value=" 5 " OnCLick="Calc.Input.value += \'5\'">
<input type="button" class="key" name="six" value=" 6 " OnClick="Calc.Input.value += \'6\'">
<input type="button" class="key" name="minus" value=" - " OnClick="Calc.Input.value += \' - \'"><br>
<input type="button" class="key" name="seven" value=" 7 " OnClick="Calc.Input.value += \'7\'">
<input type="button" class="key" name="eight" value=" 8 " OnCLick="Calc.Input.value += \'8\'">
<input type="button" class="key" name="nine" value=" 9 " OnClick="Calc.Input.value += \'9\'">
<input type="button" class="key" name="times" value=" x " OnClick="Calc.Input.value += \' * \'"><br>
<input type="button" class="key" name="clear" value=" c " OnClick="Calc.Input.value = \'\'">
<input type="button" class="key" name="zero" value=" 0 " OnClick="Calc.Input.value += \'0\'">
<input type="button" class="key" name="DoIt" value=" = " OnClick="Calc.Input.value = eval(Calc.Input.value)">
<input type="button" class="key" name="div" value=" / " OnClick="Calc.Input.value += \' / \'">
</td>
</tr>
</table>
</form>
</center>
';
print '</div>';
}
示例9: edit_permissions
public function edit_permissions($permission_name = null)
{
if ($this->is_back()) {
Base_BoxCommon::pop_main();
}
Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
Base_ThemeCommon::load_css('Base_Acl', 'edit_permissions');
$gb = $this->init_module('Utils_GenericBrowser', 'acl_editor', 'acl_editor');
$gb->set_table_columns(array(array('name' => ' ', 'width' => 20)));
$sql = 'SELECT id, name FROM base_acl_permission';
$args = array();
$perm_id = null;
if ($permission_name) {
$sql .= ' WHERE name=%s';
$args[] = $permission_name;
$perm_id = DB::GetOne('SELECT id FROM base_acl_permission WHERE name=%s', array($permission_name));
}
$sql .= ' ORDER BY name ASC';
$perms = DB::GetAssoc($sql, $args);
Base_ActionBarCommon::add('add', __('Add rule'), $this->create_callback_href(array($this, 'edit_rule'), array(null, $perm_id)));
foreach ($perms as $p_id => $p_name) {
$gb_row = $gb->get_new_row();
$gb_row->add_data(array('value' => _V($p_name), 'class' => 'Base_Acl__permission', 'attrs' => 'colspan="2"'));
$gb_row->no_actions();
$perms = DB::GetAssoc('SELECT id, id FROM base_acl_rules WHERE permission_id=%d', array($p_id));
foreach ($perms as $r_id) {
$clearances = DB::GetAssoc('SELECT id, clearance FROM base_acl_rules_clearance WHERE rule_id=%d', array($r_id));
$gb_row = $gb->get_new_row();
$gb_row->add_action($this->create_confirm_callback_href(__('Are you sure you want to delete this rule?'), array($this, 'delete_rule'), array($r_id)), 'delete', __('Delete Rule'));
$gb_row->add_action($this->create_callback_href(array($this, 'edit_rule'), array($r_id, $p_id)), 'edit', __('Edit Rule'));
$gb_row->add_data(Base_AclCommon::display_clearances($clearances));
}
}
$this->display_module($gb);
eval_js('base_acl__initialized = false;');
}
示例10: tooltip_leightbox_mode
public static function tooltip_leightbox_mode() {
static $init = null;
if (!isset($_REQUEST['__location'])) $loc = true;
else $loc = $_REQUEST['__location'];
if ($init!==$loc) {
Base_ThemeCommon::load_css('Utils/Tooltip','leightbox_mode');
Libs_LeightboxCommon::display('tooltip_leightbox_mode', '<center><span id="tooltip_leightbox_mode_content" /></center>');
$init = $loc;
}
return Libs_LeightboxCommon::get_open_href('tooltip_leightbox_mode').' onmousedown="Utils_Tooltip__leightbox_mode(this)" ';
}
示例11: body
public function body($pdf = false, $charts = false)
{
if ($this->is_back()) {
return false;
}
if ($this->date_range == 'error') {
return;
}
Base_ThemeCommon::load_css('Utils/RecordBrowser/Reports');
$this->pdf = $pdf || isset($_REQUEST['rb_reports_enable_pdf']);
$this->csv = isset($_REQUEST['rb_reports_enable_csv']);
unset($_REQUEST['rb_reports_enable_pdf']);
$this->charts = $charts;
if ($this->pdf) {
$this->pdf_ob = $this->init_module(Libs_TCPDF::module_name(), 'L');
$this->pdf_ob->set_title($this->pdf_title);
$this->pdf_ob->set_subject($this->pdf_subject);
$this->pdf_ob->prepare_header();
$this->pdf_ob->AddPage();
} elseif (!$this->charts && !$this->csv) {
Base_ActionBarCommon::add('report', __('Charts'), $this->create_callback_href(array($this, 'body'), array(false, true)));
}
if ($this->charts) {
$this->make_charts();
} else {
$this->make_table();
}
if ($this->csv) {
$this->set_module_variable('csv', $this->csv_ob);
}
if ($charts) {
Base_ActionBarCommon::add('report', __('Table'), $this->create_back_href());
return true;
} else {
if (!$this->csv) {
if ($this->pdf) {
Base_ActionBarCommon::add('save', __('Download PDF'), 'target="_blank" href="' . $this->pdf_ob->get_href($this->pdf_filename) . '"');
self::$pdf_ready = 1;
} elseif ($this->pdf_title != '' && self::$pdf_ready == 0) {
if (count($this->gb_captions) < 20) {
Base_ActionBarCommon::add('print', __('Create PDF'), $this->create_href(array('rb_reports_enable_pdf' => 1)));
} else {
Base_ActionBarCommon::add('print', __('Create PDF'), '', __('Too many columns to prepare printable version - please limit number of columns'));
}
}
}
if ($this->pdf_filename && !$this->pdf) {
if ($this->csv) {
Base_ActionBarCommon::add('save', __('Download CSV'), 'target="_blank" href="' . $this->get_module_dir() . '/csv.php?' . http_build_query(array('p' => $this->get_path(), 'id' => CID, 'filename' => $this->pdf_filename)) . '"');
} else {
Base_ActionBarCommon::add('print', __('Create CSV'), $this->create_href(array('rb_reports_enable_csv' => 1)));
}
}
}
return false;
}
示例12: 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;');
}
示例13: applet
public function applet($conf, &$opts)
{
$opts['go'] = true;
$gb = $this->init_module(Utils_GenericBrowser::module_name(), null, 'agendaX');
$columns = array(array('name' => __('Start'), 'order' => 'e.starts', 'width' => 25, 'wrapmode' => 'nowrap'), array('name' => __('Title'), 'order' => 'e.title', 'width' => 50));
$gb->set_table_columns($columns);
$start = date('Y-m-d', time());
$end = date('Y-m-d', time() + $conf['days'] * 24 * 60 * 60);
$gb->set_default_order(array(__('Start') => 'ASC'));
CRM_Calendar_EventCommon::$filter = '(' . CRM_FiltersCommon::get_my_profile() . ')';
$data = array();
Base_ThemeCommon::load_css('CRM_Calendar', 'agenda');
$custom_events = DB::GetAssoc('SELECT id, handler_callback FROM crm_calendar_custom_events_handlers ORDER BY group_name');
$ret = array();
if (!empty($custom_events)) {
$c = 0;
foreach ($custom_events as $id => $cb) {
if ($conf['events_handlers__' . $id]) {
$cb = explode('::', $cb);
if (!is_callable($cb)) {
continue;
}
$add = call_user_func($cb, 'get_all', $start, $end, CRM_Calendar_EventCommon::$filter);
foreach ($add as $v) {
$ret[str_pad($v['start'], 16, '0', STR_PAD_LEFT) . '__' . $c] = $v;
$c++;
}
}
}
}
ksort($ret);
foreach ($ret as $row) {
if (isset($row['status']) && $row['status'] == 'closed') {
continue;
}
if (!isset($row['view_action'])) {
$ex = Utils_CalendarCommon::process_event($row);
$view_action = '<a ' . $this->create_callback_href(array($this, 'view_event'), $row['id']) . '>';
$ev_id = explode('_', $row['id'], 2);
$ev_id = $ev_id[0];
} else {
$tmp = Utils_CalendarCommon::process_event($row);
$ex = $row;
$ex['start'] = $tmp['start'];
$view_action = '<a ' . $row['view_action'] . '>';
}
//////////////////////////
// left column
$date = $ex['start'];
///////////////////
// right column
$title = Utils_TooltipCommon::create($row['title'], $row['custom_tooltip']);
$day = isset($row['timeless']) && $row['timeless'] ? $row['timeless'] : Base_RegionalSettingsCommon::time2reg($row['start'], false, true, true, false);
if ($day < date('Y-m-d')) {
$class = 'past';
} elseif ($day == date('Y-m-d')) {
$class = 'today';
} elseif ($day == date('Y-m-d', strtotime('+1 day'))) {
$class = 'tomorrow';
} else {
$class = 'other';
}
$gb_row = $gb->get_new_row();
$gb_row->set_attrs('class="CRM_Calendar_applet__' . $class . '"');
$gb_row->add_data(array('value' => $date, 'order_value' => isset($row['timeless']) && $row['timeless'] ? strtotime($row['timeless']) : $row['start']), array('value' => $view_action . $title . '</a>'));
}
$this->display_module($gb, array(false), 'automatic_display');
}
示例14: year
public function year() {
$theme = $this->pack_module('Base/Theme');
Base_ThemeCommon::load_css('Utils_Calendar', 'common');
$theme->assign('nextyear_href', $this->create_unique_href(array('date'=>(date('Y',$this->date)+1).date('-m-d',$this->date))));
$theme->assign('nextyear_label',__('Next year'));
$theme->assign('today_href', $this->create_unique_href(array('date'=>date('Y-m-d'))));
$theme->assign('today_label', __('Today'));
$theme->assign('prevyear_href', $this->create_unique_href(array('date'=>(date('Y',$this->date)-1).date('-m-d',$this->date))));
$theme->assign('prevyear_label', __('Previous year'));
$theme->assign('info', __('Double click on cell to add event'));
$link_text = $this->create_unique_href_js(array('date'=>'__YEAR__-__MONTH__-__DAY__'));
$theme->assign('popup_calendar', Utils_PopupCalendarCommon::show('week_selector', $link_text,'year'));
$day_headers = array();
$day = strtotime('Sun');
$day = strtotime('+'.Utils_PopupCalendarCommon::get_first_day_of_week().' days', $day);
for ($i=0; $i<7; $i++) {
$day_headers[] = __date('D', $day);
$day = strtotime('+1 day', $day);
}
$theme->assign('month_view_label', __('Year calendar'));
$year = array();
$ret = call_user_func(array($this->event_module.'Common','get_event_days'),date('Y-01-01',$this->date),(date('Y',$this->date)+1).'-01-01');
for ($i=1; $i<=12; $i++) {
$date = strtotime(date('Y',$this->date).'-'.str_pad($i, 2, '0', STR_PAD_LEFT).'-15');
$month = $this->month_array($date, $ret);
$year[] = array('month' => $month,
'month_link' => $this->create_unique_href(array('action'=>'switch','time'=>$date, 'tab'=>'Month')),
'month_label' => __date('F', $date),
'year_label' => date('Y', $date)
);
}
$theme->assign('year', $year);
$theme->assign('day_headers', $day_headers);
$navigation_bar_additions = '';
$theme->assign('navigation_bar_additions', $navigation_bar_additions);
$theme->display('year');
}
示例15: body
//.........这里部分代码省略.........
}
if (isset($filters['edit'])) {
if (!isset($filters['delete_restore'])) {
$e_where[] = ' ehd.field!=' . DB::qstr('id');
}
} else {
if (isset($filters['delete_restore'])) {
$e_where[] = ' ehd.field=' . DB::qstr('id');
}
}
if ($filters['start_date']) {
$date = DB::qstr(date('Y-m-d', strtotime($filters['start_date'])));
$af_where .= ' AND uaf.created_on >= ' . $date;
$c_where .= ($c_where ? ' AND' : '') . ' created_on >= ' . $date;
$e_where[] = ' edited_on >= ' . $date;
}
if ($filters['end_date']) {
$date = DB::qstr(date('Y-m-d 23:59:59', strtotime($filters['end_date'])));
$af_where .= ' AND uaf.created_on <= ' . $date;
$c_where .= ($c_where ? ' AND' : '') . ' created_on <= ' . $date;
$e_where[] = ' edited_on <= ' . $date;
}
if (!empty($e_where)) {
$e_where = ' WHERE' . implode(' AND', $e_where);
} else {
$e_where = '';
}
if ($c_where) {
$c_where = ' WHERE' . $c_where;
}
$postgre_cast_type = DB::is_postgresql() ? '::varchar' : '';
// **** files ****
if (isset($filters['file'])) {
$tables[] = 'SELECT uaf.id AS id,uaf.created_on AS edited_on,uaf.created_by AS edited_by, ual.local AS r_id, ' . DB::qstr('') . ' AS tab, ' . DB::qstr('file') . ' AS action FROM utils_attachment_file uaf INNER JOIN utils_attachment_data_1 ua ON uaf.attach_id=ua.id INNER JOIN utils_attachment_local ual ON ua.id=ual.attachment WHERE original!=' . DB::qstr('') . ' AND ' . $af_where;
}
// **** edit ****
if (isset($filters['edit']) || isset($filters['delete_restore'])) {
foreach ($rb_tabs as $k => $t) {
$tables[] = 'SELECT id, edited_on, edited_by, ' . $k . '_id' . $postgre_cast_type . ' as r_id, ' . DB::qstr($k) . ' as tab, ' . DB::qstr('edit') . ' as action FROM ' . $k . '_edit_history eh LEFT JOIN ' . $k . '_edit_history_data ehd ON ehd.edit_id=eh.id' . $e_where;
}
}
// **** create ****
if (isset($filters['new'])) {
foreach ($rb_tabs as $k => $t) {
$tables[] = 'SELECT 0 AS id, created_on AS edited_on, created_by AS edited_by, id' . $postgre_cast_type . ' as r_id, ' . DB::qstr($k) . ' as tab, ' . DB::qstr('create') . ' as action FROM ' . $k . '_data_1' . $c_where;
}
}
if (!empty($tables)) {
$tables = implode(' UNION ', $tables);
$limit = DB::GetOne('SELECT COUNT(*) FROM (' . $tables . ') AS tmp');
$limit = $gb->get_limit($limit);
$ret = DB::SelectLimit('SELECT * FROM (' . $tables . ') AS tmp ORDER BY edited_on DESC', $limit['numrows'], $limit['offset']);
while ($row = $ret->FetchRow()) {
$user = Base_UserCommon::get_user_label($row['edited_by']);
$action = '';
$link = '';
switch ($row['action']) {
case 'edit':
$details = DB::GetAssoc('SELECT field, old_value FROM ' . $row['tab'] . '_edit_history_data WHERE edit_id=%d', array($row['id']));
if (isset($details['id'])) {
$action = $details['id'] == 'DELETED' ? __('Deleted') : __('Restored');
} else {
$action = __('Edited');
$action = '<a ' . Utils_TooltipCommon::tooltip_leightbox_mode() . ' ' . Utils_TooltipCommon::ajax_open_tag_attrs(array('Utils_RecordBrowserCommon', 'get_edit_details_label'), array($row['tab'], $row['r_id'], $row['id']), 500) . '>' . $action . '</a>';
}
$r_id = $row['r_id'];
break;
case 'create':
$action = __('Created');
$r_id = $row['r_id'];
break;
case 'file':
$action = __('Attachment') . ': ';
$action .= $row['id'] == 0 ? __('New') : __('Updated');
$id = explode('/', $row['r_id']);
$row['tab'] = $id[0];
$r_id = $id[1];
break;
case 'note':
$action = __('Note') . ': ';
$action .= $row['id'] == 0 ? __('New') : __('Updated');
$id = explode('/', $row['r_id']);
$row['tab'] = $id[0];
$r_id = $id[1];
break;
}
if (!Utils_RecordBrowserCommon::get_access($row['tab'], 'view', Utils_RecordBrowserCommon::get_record($row['tab'], $r_id))) {
$link = __('Access restricted');
$action = strip_tags($action);
} else {
$link = Utils_TooltipCommon::create('<img src="' . Base_ThemeCommon::get_template_file('Utils_RecordBrowser', 'info.png') . '">', Utils_RecordBrowserCommon::get_html_record_info($row['tab'], $r_id), false);
$link .= ' ';
$link .= Utils_RecordBrowserCommon::create_default_linked_label($row['tab'], $r_id, false, false);
}
$gb->add_row(Base_RegionalSettingsCommon::time2reg($row['edited_on']), $user, $rb_tabs[$row['tab']], $link, $action);
}
}
Base_ThemeCommon::load_css('Utils_RecordBrowser', 'changes_list');
$this->display_module($gb);
}