/** * Class constructor * * @param array $config Format config */ protected function __construct(array $config) { $this->_config = $config; // Initiate Fallback format ID Format::$fallback_format = isset($this->_config['default_format']) ? (int) $this->_config['default_format'] : self::FALLBACK_FORMAT; self::_prepare($this->_config); // Store the instance Format::$instance = $this; }
/** * public static function getDatefield( $label_name, $id, $name, $value = '', $date_format = FALSE, $sel_time = FALSE, $alt_name = '', $other_after = '', $other_before = '' ) * * @param string $label_name text contained into the label * @param string $id the id of the element * @param string $name the name of the element * @param string $maxlenght the max number of characters * @param string $value optional default value for the input field * @param string $alt_name the alt name for the field * @param string $date_format optional string with the date format selected * @param bool $sel_time optional if true will show also the time selector * @param string $alt_name optional with the alt value * @param string $other_after optional html code added after the input element * @param string $other_before optional html code added before the label element * * @return string with the html code for the input type="text" with a calendar */ public static function getDatefield($label_name, $id, $name, $value = '', $date_format = FALSE, $sel_time = FALSE, $alt_name = '', $other_after = '', $other_before = '', $other_param = '') { $regset = Format::instance(); if ($date_format == false) { $date_format = $regset->date_token; } if ($alt_name == '') { $alt_name = strip_tags($label_name); } return Form::getLineDatefield('form_line_l', 'floating', $label_name, 'textfield', $id, $name, $value, $date_format, $alt_name, $other_param, $other_after, $other_before); }
function get_courses_filter() { $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $back_url = $this->back_url; $jump_url = $this->jump_url; $next_url = $this->next_url; require_once _base_ . '/lib/lib.form.php'; require_once _lms_ . '/lib/lib.course.php'; $lang =& DoceboLanguage::createInstance('report', 'framework'); YuiLib::load('datasource'); Util::get_js(Get::rel_path('lms') . '/admin/modules/report/courses_filter.js', true, true); Form::loadDatefieldScript(); $time_belt = array(0 => $lang->def('_CUSTOM_BELT'), 7 => $lang->def('_LAST_WEEK'), 31 => $lang->def('_LAST_MONTH'), 93 => $lang->def('_LAST_THREE_MONTH'), 186 => $lang->def('_LAST_SIX_MONTH'), 365 => $lang->def('_LAST_YEAR')); //back to columns category selection if (isset($_POST['undo_filter'])) { //go back at the previous step Util::jump_to($back_url); //... } require_once $GLOBALS['where_framework'] . '/lib/lib.field.php'; $fman = new FieldList(); $fields = $fman->getFlatAllFields(); $custom = array(); foreach ($fields as $key => $val) { $custom[] = array('id' => $key, 'label' => $val, 'selected' => false); } //set $_POST data in $_SESSION['report_tempdata'] if (!isset($_SESSION['report_tempdata']['columns_filter'])) { $_SESSION['report_tempdata']['columns_filter'] = array('org_chart_subdivision' => 0, 'all_courses' => true, 'selected_courses' => array(), 'sub_filters' => array(), 'filter_exclusive' => 1, 'showed_columns' => array(), 'order_by' => 'userid', 'order_dir' => 'asc', 'show_suspended' => false, 'custom_fields' => $custom, 'show_classrooms_editions' => false); } $ref =& $_SESSION['report_tempdata']['columns_filter']; //echo print_r($ref,true); $selector = new Selector_Course(); $selection =& $ref['selected_courses']; $selector->parseForState($_POST); if (isset($_POST['update_tempdata'])) { // parse for date fields $opt_type = array(); foreach ($this->courses_filter_definition as $fd) { $opt_type[$fd['key']] = $fd['type']; } if (isset($_POST['courses_filter'])) { while (list($ind, $filter_data) = each($_POST['courses_filter'])) { if ($opt_type[$filter_data['option']] == _FILTER_DATE) { $_POST['courses_filter'][$ind]['value'] = Format::dateDb($filter_data['value'], 'date'); } } } $temp = array('org_chart_subdivision' => isset($_POST['org_chart_subdivision']) ? 1 : 0, 'all_courses' => $_POST['all_courses'] == 1 ? true : false, 'selected_courses' => $selector->getSelection(), 'sub_filters' => isset($_POST['courses_filter']) ? $_POST['courses_filter'] : array(), 'filter_exclusive' => isset($_POST['filter_exclusive']) ? $_POST['filter_exclusive'] : false, 'showed_columns' => isset($_POST['cols']) ? $_POST['cols'] : array(), 'order_by' => isset($_POST['order_by']) ? $_POST['order_by'] : 'userid', 'order_dir' => isset($_POST['order_dir']) ? $_POST['order_dir'] : 'asc', 'show_suspended' => isset($_POST['show_suspended']) ? $_POST['show_suspended'] > 0 : false, 'custom_fields' => array(), 'show_classrooms_editions' => isset($_POST['show_classrooms_editions']) && $_POST['show_classrooms_editions'] > 0 ? true : false); foreach ($custom as $val) { $temp['custom_fields'][] = array('id' => $val['id'], 'label' => $val['label'], 'selected' => isset($_POST['custom'][$val['id']]) ? true : false); } $ref = $temp; } else { $selector->resetSelection($selection); //get users' custom fields if (!isset($ref['custom_fields'])) { $ref['custom_fields'] = $custom; } else { $t_arr = array(); foreach ($custom as $val) { $is_selected = FALSE; foreach ($ref['custom_fields'] as $fieldrow) { if ($fieldrow['id'] == $val['id']) { $is_selected = $fieldrow['selected']; break; } } $t_arr[] = array('id' => $val['id'], 'label' => $val['label'], 'selected' => $is_selected); } $ref['custom_fields'] = $t_arr; } } //filter setting done, go to next step if (isset($_POST['import_filter']) || isset($_POST['show_filter']) || isset($_POST['pre_filter'])) { $temp_url = $next_url; if (isset($_POST['pre_filter'])) { $temp_url .= '&show=1&nosave=1'; } if (isset($_POST['show_filter'])) { $temp_url .= '&show=1'; } Util::jump_to($temp_url); } cout(Form::getHidden('update_tempdata', 'update_tempdata', 1)); $lang = $this->lang; $temp = count($selection); $show_classrooms_editions = $ref['show_classrooms_editions']; $box = new ReportBox('course_selector'); $box->title = $lang->def('_REPORT_COURSE_SELECTION'); $box->description = false; $box->body .= '<div class="fc_filter_line filter_corr">'; $box->body .= '<input id="all_courses" name="all_courses" type="radio" value="1" ' . ($ref['all_courses'] ? 'checked="checked"' : '') . ' />'; $box->body .= ' <label for="all_courses">' . $lang->def('_ALL_COURSES') . '</label>'; $box->body .= ' <input id="sel_courses" name="all_courses" type="radio" value="0" ' . ($ref['all_courses'] ? '' : 'checked="checked"') . ' />'; $box->body .= ' <label for="sel_courses">' . $lang->def('_SEL_COURSES') . '</label>'; $box->body .= '</div>'; $box->body .= '<div id="selector_container"' . ($ref['all_courses'] ? ' style="display:none"' : '') . '>'; $box->body .= $selector->loadCourseSelector(true); $box->body .= '</div>'; $box->footer = $lang->def('_CURRENT_SELECTION') . ': <span id="csel_foot">' . ($ref['all_courses'] ? $lang->def('_ALL') : ($temp != '' ? $temp : '0')) . '</span>'; cout($box->get()); cout('<script type="text/javascript">courses_count=' . ($temp == '' ? '0' : $temp) . ';' . 'courses_all="' . $lang->def('_ALL') . '";</script>'); //example selection options require_once _base_ . '/lib/lib.json.php'; $seldata = $this->courses_filter_definition; $filter_cases = array('_FILTER_INTEGER' => _FILTER_INTEGER, '_FILTER_DATE' => _FILTER_DATE); $regset = Format::instance(); $date_token = $regset->date_token; $json = new Services_JSON(); $js_seldata = $json->encode($seldata); $js_filter_cases = $json->encode($filter_cases); $out->add('<script type="text/javascript">' . "\n" . 'seldata_JSON=' . $js_seldata . ';' . "\n" . 'filter_cases_JSON=\'' . $js_filter_cases . '\';' . "\n" . 'courses_sel_opt_0=\'' . $lang->def('_COURSES_DROPDOWN_NULL_SELECT') . '\';' . "\n" . 'courses_remove_filter=\'' . $lang->def('_RESET') . '\';' . "\n" . 'var course_date_token=\'' . $date_token . '\';' . "\n" . 'YAHOO.util.Event.addListener(window,"load",courses_init);' . "\n" . '</script>', 'page_head'); //box for course filter conditions $temp =& $_SESSION['report_tempdata']['columns_filter']['sub_filters']; $inc_counter = count($temp); $already = ''; $script_init = 'YAHOO.util.Event.onDOMReady( function() {' . "\n"; if (is_array($temp)) { foreach ($temp as $key => $value) { //create filters html $value['value'] = substr($value['value'], 0, 10); //make sure that the date format is yyyy-mm-dd $index = str_replace('i', '', $key); $already .= '<div id="courses_filter_' . $index . '">'; //generate option selection $already .= '<select id="courses_filter_sel_' . $index . '" name="courses_filter_sel[]">'; $already .= '<option value="0">' . $lang->def('_COURSES_DROPDOWN_NULL_SELECT') . '</option>'; foreach ($seldata as $selval) { if ($value['option'] == $selval['key']) { $selected = ' selected="selected"'; } else { $selected = ''; } $already .= '<option value="' . $selval['key'] . '"' . $selected . '>' . $selval['label'] . '</option>'; } $already .= '</select>'; $already .= '<span id="courses_filter_params_' . $index . '">'; //generate sign selection $signs = array('<', '<=', '=', '>=', '>'); $already .= '<select name="courses_filter[' . $key . '][sign]">'; foreach ($signs as $k2 => $v2) { if ($value['sign'] == $v2) { $selected = ' selected="selected"'; } else { $selected = ''; } $already .= '<option value="' . $v2 . '"' . $selected . '>' . $v2 . '</option>'; } $already .= '</select>'; //generate value input $type = false; foreach ($this->courses_filter_definition as $def) { //this should be a switch if ($value['option'] == $def['key']) { $type = $def['type']; } } $already .= '<input class="align_right" type="text" style="width: ' . ($type == _FILTER_DATE ? '7' : '9') . 'em;" ' . 'name="courses_filter[' . $key . '][value]" value="' . Format::date($value['value'], 'date') . '"' . ' id="courses_filter_' . $index . '_value" />'; if ($type == _FILTER_DATE) { $_year = substr($value['value'], 0, 4); $_month = substr($value['value'], 5, 2); $_day = substr($value['value'], 8, 2); $script_init .= 'YAHOO.dateInput.setCalendar(' . '"courses_filter_' . $index . '_value", ' . '"' . $_month . '/' . $_day . '/' . $_year . '", ' . '"' . $date_token . '");' . "\n"; } //generate hidden index $already .= '<input type="hidden" name="courses_filter[' . $key . '][option]" ' . 'value="' . $value['option'] . '" /></span>'; //generate remove link $already .= '<a href="javascript:courses_removefilter(' . $index . ');">' . $lang->def('_RESET') . '</a>'; $already .= '</div>'; $script_init .= 'YAHOO.util.Event.addListener("courses_filter_sel_' . $index . '", "change", courses_create_filter);'; } } $script_init .= '} );'; $already .= '<script type="text/javascript">' . $script_init . '</script>'; $temp = isset($_SESSION['report_tempdata']['columns_filter']['filter_exclusive']) ? $_SESSION['report_tempdata']['columns_filter']['filter_exclusive'] : 1; $selected = ' checked="checked"'; $box = new ReportBox('course_subfilters'); $box->title = $lang->def('_REPORT_COURSE_CONDITIONS'); $box->description = ''; $box->body = Form::getBreakRow() . '<div id="courses_filter_list">' . $already . '</div>' . '<div class="fc_filter_line filter_corr">' . '<input type="radio" id="filter_exclusive_and" name="filter_exclusive" value="1" ' . ($temp > 0 ? $selected : '') . ' /> <label for="filter_exclusive_and">' . $lang->def('_FILTER_ALL_CONDS') . '</label> ' . '<input type="radio" id="filter_exclusive_or" name="filter_exclusive" value="0" ' . ($temp == 0 ? $selected : '') . ' /> <label for="filter_exclusive_or">' . $lang->def('_FILTER_ONE_COND') . '</label>' . '</div>' . '<div class="fc_filter_line">' . '<span class="yui-button yui-link-button" id="fc_addfilter"> <span class="first-child"> <a href="#" onclick="courses_addfilter();return false;">' . $lang->def('_NEW_FILTER') . '</a> </span> </span>' . '<span class="yui-button yui-link-button" id="fc_cancfilter"> <span class="first-child"> <a href="#" onclick="courses_resetfilters();return false;">' . $lang->def('_FILTER_RESET') . '</a> </span> </span>' . '</div>' . Form::getHidden('inc_counter', 'inc_counter', $inc_counter) . '</div>'; cout($box->get()); function is_showed($which) { if (isset($_SESSION['report_tempdata']['columns_filter'])) { return in_array($which, $_SESSION['report_tempdata']['columns_filter']['showed_columns']); } else { return false; } } //box for columns selection $box = new ReportBox('columns_selection'); $box->title = $lang->def('_SELECT_THE_DATA_COL_NEEDED'); $box->description = false; //Form::openElementSpace() $box->body .= Form::getOpenFieldset($lang->def('_USER_CUSTOM_FIELDS'), 'fieldset_course_fields'); $box->body .= Form::getCheckBox(Lang::t('_LASTNAME', 'standard'), 'col_sel_lastname', 'cols[]', '_TH_LASTNAME', is_showed('_TH_LASTNAME')); $box->body .= Form::getCheckBox(Lang::t('_FIRSTNAME', 'standard'), 'col_sel_firstname', 'cols[]', '_TH_FIRSTNAME', is_showed('_TH_FIRSTNAME')); $box->body .= Form::getCheckBox(Lang::t('_EMAIL', 'standard'), 'col_sel_email', 'cols[]', '_TH_EMAIL', is_showed('_TH_EMAIL')); $box->body .= Form::getCheckBox(Lang::t('_REGISTER_DATE', 'standard'), 'col_sel_register_date', 'cols[]', '_TH_REGISTER_DATE', is_showed('_TH_REGISTER_DATE')); $box->body .= Form::getCheckBox(Lang::t('_SUSPENDED', 'standard'), 'col_sel_suspended', 'cols[]', '_TH_SUSPENDED', is_showed('_TH_SUSPENDED')); foreach ($custom as $key => $val) { $box->body .= Form::getCheckBox($val['label'], 'col_custom_' . $val['id'], 'custom[' . $val['id'] . ']', $val['id'], $ref['custom_fields'][$key]['selected']); } $box->body .= Form::getCloseFieldset(); $out->add('<script type="text/javascript"> function activateClassrooms() { var Y = YAHOO.util.Dom; var b1 = Y.get("not_classrooms"), b2 = Y.get("use_classrooms"); var action = b1.style.display == "none" ? "hide" : "show"; switch (action) { case "hide": { b1.style.display = "block"; b2.style.display = "none"; } break; case "show": { b1.style.display = "none"; b2.style.display = "block"; } break; } } </script>', 'page_head'); $box->body .= Form::getOpenFieldset($lang->def('_COURSE_FIELDS'), 'fieldset_course_fields') . Form::getCheckBox($lang->def('_CATEGORY'), 'col_sel_category', 'cols[]', '_TH_CAT', is_showed('_TH_CAT')) . Form::getCheckBox($lang->def('_CODE'), 'col_sel_coursecode', 'cols[]', '_TH_CODE', is_showed('_TH_CODE')) . Form::getCheckBox($lang->def('_TH_COURSEPATH'), 'col_sel_coursepath', 'cols[]', '_TH_COURSEPATH', is_showed('_TH_COURSEPATH')) . Form::getCheckBox($lang->def('_STATUS'), 'col_sel_status', 'cols[]', '_TH_COURSESTATUS', is_showed('_TH_COURSESTATUS')) . Form::getCheckBox(Lang::t('_CREDITS', 'standard'), 'col_sel_credits', 'cols[]', '_TH_COURSECREDITS', is_showed('_TH_COURSECREDITS')) . Form::getCloseFieldset() . Form::getOpenFieldset(Form::getInputCheckbox('show_classrooms_editions', 'show_classrooms_editions', 1, $show_classrooms_editions, "onclick=activateClassrooms();") . " " . Lang::t('_CLASSROOM_FIELDS', 'report'), 'fieldset_classroom_fields') . '<div id="not_classrooms" style="display:' . ($show_classrooms_editions ? "none" : "block") . '">' . Lang::t('_ACTIVATE_CLASSROOM_FIELDS', 'report') . '</div>' . '<div id="use_classrooms" style="display:' . ($show_classrooms_editions ? "block" : "none") . '">' . Form::getCheckBox(Lang::t('_NAME', 'standard'), 'col_sel_classroomname', 'cols[]', '_TH_CLASSROOM_CODE', is_showed('_TH_CLASSROOM_CODE', $ref)) . Form::getCheckBox(Lang::t('_CODE', 'standard'), 'col_sel_classroomcode', 'cols[]', '_TH_CLASSROOM_NAME', is_showed('_TH_CLASSROOM_NAME', $ref)) . Form::getCheckBox(Lang::t('_DATE_BEGIN', 'standard'), 'col_sel_classroomdatebegin', 'cols[]', '_TH_CLASSROOM_MIN_DATE', is_showed('_TH_CLASSROOM_MIN_DATE', $ref)) . Form::getCheckBox(Lang::t('_DATE_END', 'standard'), 'col_sel_classroomdateend', 'cols[]', '_TH_CLASSROOM_MAX_DATE', is_showed('_TH_CLASSROOM_MAX_DATE', $ref)) . '</div>' . Form::getCloseFieldset() . Form::getOpenFieldset($lang->def('_COURSE_FIELDS_INFO'), 'fieldset_course_fields') . Form::getCheckBox($lang->def('_TH_USER_INSCRIPTION_DATE'), 'user_inscription_date', 'cols[]', '_TH_USER_INSCRIPTION_DATE', is_showed('_TH_USER_INSCRIPTION_DATE')) . Form::getCheckBox($lang->def('_DATE_FIRST_ACCESS'), 'user_start_date', 'cols[]', '_TH_USER_START_DATE', is_showed('_TH_USER_START_DATE')) . Form::getCheckBox($lang->def('_COMPLETED'), 'user_end_date', 'cols[]', '_TH_USER_END_DATE', is_showed('_TH_USER_END_DATE')) . Form::getCheckBox($lang->def('_DATE_LAST_ACCESS'), 'last_access_date', 'cols[]', '_TH_LAST_ACCESS_DATE', is_showed('_TH_LAST_ACCESS_DATE')) . Form::getCheckBox($lang->def('_LEVEL'), 'user_level', 'cols[]', '_TH_USER_LEVEL', is_showed('_TH_USER_LEVEL')) . Form::getCheckBox($lang->def('_STATUS'), 'user_status', 'cols[]', '_TH_USER_STATUS', is_showed('_TH_USER_STATUS')) . Form::getCheckBox($lang->def('_TH_USER_START_SCORE'), 'user_start_score', 'cols[]', '_TH_USER_START_SCORE', is_showed('_TH_USER_START_SCORE')) . Form::getCheckBox($lang->def('_FINAL_SCORE'), 'user_final_score', 'cols[]', '_TH_USER_FINAL_SCORE', is_showed('_TH_USER_FINAL_SCORE')) . Form::getCheckBox($lang->def('_TH_USER_COURSE_SCORE'), 'user_course_score', 'cols[]', '_TH_USER_COURSE_SCORE', is_showed('_TH_USER_COURSE_SCORE')) . Form::getCheckBox($lang->def('_TH_USER_NUMBER_SESSION'), 'user_number_session', 'cols[]', '_TH_USER_NUMBER_SESSION', is_showed('_TH_USER_NUMBER_SESSION')) . Form::getCheckBox($lang->def('_TOTAL_TIME'), 'user_elapsed_time', 'cols[]', '_TH_USER_ELAPSED_TIME', is_showed('_TH_USER_ELAPSED_TIME')) . Form::getCheckBox($lang->def('_TH_ESTIMATED_TIME'), 'estimated_time', 'cols[]', '_TH_ESTIMATED_TIME', is_showed('_TH_ESTIMATED_TIME')) . Form::getCloseFieldset(); cout($box->get()); //other options $box = new ReportBox('other_options'); $box->title = Lang::t('_OTHER_OPTION', 'course'); $box->description = false; $sort_list = array('userid' => Lang::t('_USERID', 'standard'), 'firstname' => Lang::t('_FIRSTNAME', 'standard'), 'lastname' => Lang::t('_LASTNAME', 'standard'), 'email' => Lang::t('_EMAIL', 'standard'), 'course_code' => Lang::t('_COURSE_CODE', 'standard'), 'course_name' => Lang::t('_COURSE_NAME', 'standard'), 'status' => Lang::t('_STATUS', 'standard'), 'level' => Lang::t('_LEVEL', 'standard'), 'date_subscription' => Lang::t('_DATE_INSCR', 'report'), 'date_first_access' => Lang::t('_DATE_FIRST_ACCESS', 'report'), 'date_last_access' => Lang::t('_DATE_LAST_ACCESS', 'report'), 'date_complete' => Lang::t('_DATE_END', 'standard')); $dir_list = array('asc' => Lang::t('_ORD_ASC_TITLE', 'standard'), 'desc' => Lang::t('_ORD_DESC_TITLE', 'standard')); $sort_selected = array_key_exists($ref['order_by'], $sort_list) ? $ref['order_by'] : 'userid'; $dir_selected = array_key_exists($ref['order_dir'], $dir_list) ? $ref['order_dir'] : 'asc'; $sort_dir_dropdown = Form::getInputDropdown('', 'order_dir', 'order_dir', $dir_list, $dir_selected, ''); $box->body .= Form::getDropdown(Lang::t('_ORDER_BY', 'standard'), 'order_by', 'order_by', $sort_list, $sort_selected, $sort_dir_dropdown); $box->body .= Form::getCheckbox(Lang::t('_SHOW_SUSPENDED', 'organization_chart'), 'show_suspended', 'show_suspended', 1, (bool) $ref['show_suspended']); cout($box->get()); }
/** * Loads the template View object, if it is direct request * * @return void * @throws Http_Exception_415 If none of the accept-types are supported */ public function before() { // Execute parent::before first parent::before(); if ($this->bare == FALSE) { // Load the config $this->_config = Config::load('site'); if (Kohana::$profiling) { // Start a new benchmark token $this->_benchmark = Profiler::start('Gleez', ucfirst($this->request->controller()) . ' Controller'); } // Test whether the current request is command line request if (Kohana::$is_cli) { $this->_ajax = FALSE; $this->auto_render = FALSE; } // Test whether the current request is the first request if (!$this->request->is_initial()) { $this->_internal = TRUE; $this->auto_render = FALSE; } // Test whether the current request is ajax request if ($this->request->is_ajax()) { $this->_ajax = TRUE; $this->auto_render = FALSE; } // Test whether the current request is jquery mobile request. ugly hack if (Request::is_mobile() and $this->_config->get('mobile_theme', FALSE)) { $this->_ajax = FALSE; $this->auto_render = TRUE; } // Test whether the current request is datatables request if (Request::is_datatables()) { $this->_ajax = TRUE; $this->auto_render = FALSE; } $this->response->headers('X-Powered-By', Gleez::getVersion(TRUE, TRUE) . ' (' . Gleez::CODENAME . ')'); $this->_auth = Auth::instance(); // Get desired response formats $accept_types = Request::accept_type(); $accept_types = Arr::extract($accept_types, array_keys($this->_accept_formats)); // Set response format to first matched element $this->_response_format = $this->request->headers()->preferred_accept(array_keys($this->_accept_formats)); $site_name = Template::getSiteName(); $url = URL::site(NULL, TRUE); View::bind_global('site_name', $site_name); View::bind_global('site_url', $url); } if ($this->auto_render && $this->bare == FALSE) { // Throw exception if none of the accept-types are supported if (!($accept_types = array_filter($accept_types))) { throw new Http_Exception_415('Unsupported accept-type', 415); } // Initiate a Format instance $this->_format = Format::instance(); // Load the template $this->template = View::factory($this->template); $this->title_separator = $this->_config->get('title_separator', ' | '); $this->_widgets = Widgets::instance(); $this->template->_admin = Theme::$is_admin; // Set the destination & redirect url $this->_desti = array('destination' => $this->request->uri()); $this->redirect = $this->request->query('destination') !== NULL ? $this->request->query('destination') : array(); // Bind the generic page variables $this->template->set('site_name', Template::getSiteName())->set('site_slogan', $this->_config->get('site_slogan', __('Innovate IT')))->set('site_url', URL::site(NULL, TRUE))->set('site_logo', $this->_config->get('site_logo', FALSE))->set('sidebar_left', array())->set('sidebar_right', array())->set('column_class', '')->set('main_column', 12)->set('head_title', $this->title)->set('title', $this->title)->set('subtitle', $this->subtitle)->set('icon', $this->icon)->set('schemaType', $this->schemaType)->set('front', FALSE)->set('mission', FALSE)->set('tabs', FALSE)->set('subtabs', FALSE)->set('actions', FALSE)->set('_user', $this->_auth->get_user())->bind('datatables', $this->_datatables); // Page Title $this->title = ucwords($this->request->controller()); // Assign the default css files $this->_set_default_css(); // Assign the default js files $this->_set_default_js(); // Set default server headers $this->_set_default_server_headers(); // Set default meta data and media $this->_set_default_meta_links(); $this->_set_default_meta_tags(); /** * Make your view template available to all your other views * so easily you could access template variables */ View::bind_global('template', $this->template); } if (Kohana::$environment === Kohana::DEVELOPMENT) { Log::debug('Executing Controller [:controller] action [:action]', array(':controller' => $this->request->controller(), ':action' => $this->request->action())); } }
/** * - load the user preference about the date and time display and GMT * @return array */ private static function dateTime() { self::log("Loading regional settings functions"); // todo : change this class require_once _i18n_ . '/lib.format.php'; Format::instance(); }
function getClientClassObject() { $format = Format::instance(); $date_format = $format->date_token; Form::loadDatefieldScript($date_format); return 'YAHOO.dynamicFilter.renderTypes.get("' . $this->getFieldType() . '", {format: "' . $date_format . '"})'; /* return ' { type: "'.$this->getFieldType().'", getValue: function(id_sel, id_filter) { var o, id = "date_"+id_filter+"_"+id_sel, $D = YAHOO.util.Dom; return YAHOO.lang.JSON.stringify({cond: $D.get(id+"_sel").value, value: $D.get(id).value}); }, setValue: function(id_sel, id_filter, newValue) { if (!newValue) o = {cond: 0, value: ""}; else o = YAHOO.lang.JSON.parse(newValue); var i, s, id = "date_"+id_filter+"_"+id_sel, $D = YAHOO.util.Dom; $D.get(id).value = o.value; s = $D.get(id+"_sel"); for (i=0; i<s.options.length; i++) { if (s.options[i].value == o.cond) { s.selectedIndex = i; break; } } }, render: function(id_sel, id_filter, oEl, id_field) { var id = "date_"+id_filter+"_"+id_sel, txt = document.createElement("INPUT"), but = document.createElement("BUTTON"); txt.id = id; txt.className = "filter_value"; txt.type = "text"; but.id = "trigger_"+id; try{ but.type = "button"; } catch(e) {} but.className = "trigger_calendar"; d = document.createElement("DIV"); d.className = "date_container"; sel = document.createElement("SELECT"); sel.id = id+"_sel"; sel.options[0] = new Option("<",0); sel.options[1] = new Option("<=",1); sel.options[2] = new Option("=",2); sel.options[3] = new Option(">=",3); sel.options[4] = new Option(">",4); sel.className = "condition_select"; d.appendChild(sel); d.appendChild(document.createTextNode(" ")); d.appendChild(txt); d.appendChild(but); oEl.appendChild(d); Calendar.setup({ inputField : id, ifFormat : "'.$format->date_token.'", button : "trigger_"+id, timeFormat : '.(substr($format->time_token, 0, 2) == "%I" ? '12' : '24').', showsTime : true }); } } '; */ }