public function __construct($step_number, $step_title, Template $view) { $this->load_language_resources(); $this->init_response($step_number, $view); $env = new InstallDisplayGraphicalEnvironment(); $this->add_language_bar(); $this->init_steps(); $this->update_progress_bar(); $this->full_view->put_all(array('RESTART' => InstallUrlBuilder::welcome()->rel(), 'STEP_TITLE' => $step_title, 'C_HAS_PREVIOUS_STEP' => false, 'C_HAS_NEXT_STEP' => false, 'L_XML_LANGUAGE' => LangLoader::get_message('xml_lang', 'main'), 'PROGRESSION' => floor(100 * $this->current_step / ($this->nb_steps - 1)), 'PHPBOOST_VERSION' => GeneralConfig::load()->get_phpboost_major_version())); parent::__construct($env, $this->full_view); }
public function __construct($step_number, $step_title, Template $view) { $this->load_language_resources(); $this->init_response($step_number, $view); $env = new UpdateDisplayGraphicalEnvironment(); $this->add_language_bar(); $this->init_steps(); $this->update_progress_bar(); $this->full_view->put_all(array('RESTART' => UpdateUrlBuilder::introduction()->rel(), 'STEP_TITLE' => $step_title, 'C_HAS_PREVIOUS_STEP' => false, 'C_HAS_NEXT_STEP' => false, 'L_XML_LANGUAGE' => LangLoader::get_message('xml_lang', 'main'), 'PROGRESSION' => floor(100 * $this->current_step / $this->nb_steps))); parent::__construct($env, $this->full_view); }
private function build_view() { $this->view = new FileTemplate('update/server-config.tpl'); $this->view->put_all(array('MIN_PHP_VERSION' => ServerConfiguration::MIN_PHP_VERSION, 'PHP_VERSION_OK' => $this->server_conf->is_php_compatible(), 'HAS_GD_LIBRARY' => $this->server_conf->has_gd_library())); if (!PHPBoostFoldersPermissions::validate()) { $this->view->put('ERROR', $this->lang['folders.chmod.error']); } try { $this->view->put('URL_REWRITING_KNOWN', true); $this->view->put('URL_REWRITING_AVAILABLE', $this->server_conf->has_url_rewriting()); } catch (UnsupportedOperationException $ex) { $this->view->put('URL_REWRITING_KNOWN', false); } $this->check_folders_permissions(); $this->view->put('CONTINUE_FORM', $this->form->display()); }
private function add_navigation(Template $view) { $form = new HTMLForm('preambleForm', UpdateUrlBuilder::server_configuration()->rel(), false); $action_fieldset = new FormFieldsetSubmit('actions'); $next = new FormButtonSubmitCssImg($this->lang['step.next'], 'fa fa-arrow-right', 'introduction'); $action_fieldset->add_element($next); $form->add_fieldset($action_fieldset); $view->put_all(array('C_PUT_UNDER_MAINTENANCE' => !MaintenanceConfig::load()->is_under_maintenance(), 'SERVER_FORM' => $form->display())); }
/** * @desc Displays the bread crumb. */ public function display(Template $tpl) { if (empty($this->array_links)) { $this->add($this->get_page_title(), REWRITED_SCRIPT); } $tpl->put_all(array('START_PAGE' => TPL_PATH_TO_ROOT . '/', 'L_INDEX' => LangLoader::get_message('home', 'main'))); $output = array_slice($this->array_links, -1, 1); foreach ($this->array_links as $key => $array) { $tpl->assign_block_vars('link_bread_crumb', array('C_CURRENT' => $output[0] == $array, 'URL' => $array[1], 'TITLE' => $array[0])); } }
protected function display_counter(Template $template) { //If the counter is to be displayed, we display it if (GraphicalEnvironmentConfig::load()->is_visit_counter_enabled()) { $compteur = PersistenceContext::get_querier()->select_single_row(DB_TABLE_VISIT_COUNTER, array('ip AS nbr_ip', 'total'), 'WHERE id = 1'); $compteur_total = !empty($compteur['nbr_ip']) ? $compteur['nbr_ip'] : '1'; $compteur_day = !empty($compteur['total']) ? $compteur['total'] : '1'; $template->put_all(array('L_VISIT' => self::$main_lang['guest_s'], 'L_TODAY' => LangLoader::get_message('today', 'date-common'), 'C_COMPTEUR' => true, 'COMPTEUR_TOTAL' => $compteur_total, 'COMPTEUR_DAY' => $compteur_day)); } }
/** * @desc Assign default tpl vars * @access protected * @param Template $template the template on which we gonna assign vars */ protected function assign_common_template_variables(Template $template) { $template->put_all(array('C_VERTICAL_BLOCK' => $this->get_block() == Menu::BLOCK_POSITION__LEFT || $this->get_block() == Menu::BLOCK_POSITION__RIGHT, 'C_HIDDEN_WITH_SMALL_SCREENS' => $this->hidden_with_small_screens)); }
protected function assign_common_template_variables(Template $template) { $has_js_validations = false; $js_tpl = new FileTemplate('framework/builder/form/AddFieldJS.tpl'); foreach ($this->get_related_fields() as $field) { $js_tpl->assign_block_vars('related_field', array('ID' => $field)); $has_js_validations = true; } foreach ($this->events as $event => $handler) { $js_tpl->assign_block_vars('event_handler', array('EVENT' => $event, 'HANDLER' => $handler)); $has_js_validations = true; } foreach ($this->get_js_validations() as $constraint) { $js_tpl->assign_block_vars('constraint', array('CONSTRAINT' => $constraint)); $has_js_validations = true; } $js_tpl->put_all(array('C_DISABLED' => $this->is_disabled(), 'C_HAS_CONSTRAINTS' => $this->has_constraints(), 'ID' => $this->get_id(), 'HTML_ID' => $this->get_html_id(), 'JS_SPECIALIZATION_CODE' => $this->get_js_specialization_code(), 'FORM_ID' => $this->form_id, 'FIELDSET_ID' => $this->fieldset_id)); $template->put('ADD_FIELD_JS', $js_tpl); $description = $this->get_description(); $template->put_all(array('ID' => $this->get_id(), 'HTML_ID' => $this->get_html_id(), 'NAME' => $this->get_html_id(), 'LABEL' => $this->get_label(), 'DESCRIPTION' => $description, 'C_DESCRIPTION' => !empty($description), 'C_REQUIRED' => $this->is_required(), 'C_REQUIRED_AND_HAS_VALUE' => $this->is_required() && (!empty($this->value) || $this->value == '0'), 'VALUE' => $this->get_value(), 'C_HAS_CONSTRAINTS' => $this->has_constraints(), 'CLASS' => $this->get_css_class(), 'FIELD_CLASS' => $this->get_css_field_class(), 'C_HAS_FIELD_CLASS' => $this->get_css_field_class() != '', 'FORM_FIELD_CLASS' => $this->get_css_form_field_class(), 'C_HAS_FORM_FIELD_CLASS' => $this->get_css_form_field_class() != '', 'FORM_ID' => $this->form_id, 'FIELDSET_ID' => $this->fieldset_id, 'C_HAS_LABEL' => !empty($description) || $this->get_label() != '', 'C_DISABLED' => $this->is_disabled(), 'C_READONLY' => $this->is_readonly(), 'C_HIDDEN' => $this->is_hidden(), 'C_PATTERN' => $this->has_pattern(), 'PATTERN' => $this->pattern, 'C_PLACEHOLDER' => $this->has_placeholder(), 'PLACEHOLDER' => $this->placeholder)); }
public function set_title($title) { $this->full_view->put_all(array('TITLE' => $title)); }
private function generate_stats() { $end = $this->get_first_row_index() + $this->get_nb_rows_per_page(); $elements = StringVars::replace_vars(LangLoader::get_message('table_footer_stats', 'common'), array('start' => $this->get_first_row_index() + 1, 'end' => $end > $this->nb_rows || $this->get_nb_rows_per_page() == HTMLTableModel::NO_PAGINATION ? $this->nb_rows : $end, 'total' => $this->nb_rows)); $this->tpl->put_all(array('NUMBER_OF_ELEMENTS' => $elements)); }
private function assign_textarea_template_variables(Template $template) { $template->put_all(array('ROWS' => $this->rows, 'COLS' => $this->cols)); }
private function assign_editor(Template $template) { $editor = $this->formatter->get_editor(); $editor->set_identifier($this->get_html_id()); $template->put_all(array('C_EDITOR_ENABLED' => true, 'EDITOR' => $editor->display(), 'VALUE' => $this->get_raw_value(), 'PREVIEW_BUTTON' => $this->get_preview_button_code())); }
protected function assign_template_fields(Template $template) { $js_tpl = new FileTemplate('framework/builder/form/AddFieldsetJS.tpl'); $js_tpl->put_all(array('ID' => $this->id, 'HTML_ID' => $this->get_html_id(), 'C_DISABLED' => $this->disabled, 'FORM_ID' => $this->form_id)); $template->put('ADD_FIELDSET_JS', $js_tpl); $template->put_all(array('C_DESCRIPTION' => !empty($this->description), 'DESCRIPTION' => $this->description, 'ID' => $this->id, 'HTML_ID' => $this->get_html_id(), 'C_DISABLED' => $this->disabled, 'CSS_CLASS' => $this->css_class, 'FORM_ID' => $this->form_id)); foreach ($this->elements as $element) { $template->assign_block_vars('elements', array(), array('ELEMENT' => $element->display())); } }
/** * @desc Assigns the positions conditions for different printing modes * @param Template $template the template to use * @param int $position the menu position */ public static function assign_positions_conditions($template, $position) { $vertical_position = in_array($position, array(Menu::BLOCK_POSITION__LEFT, Menu::BLOCK_POSITION__RIGHT)); $template->put_all(array('C_HEADER' => $position == Menu::BLOCK_POSITION__HEADER, 'C_SUBHEADER' => $position == Menu::BLOCK_POSITION__SUB_HEADER, 'C_TOP_CENTRAL' => $position == Menu::BLOCK_POSITION__TOP_CENTRAL, 'C_BOTTOM_CENTRAL' => $position == Menu::BLOCK_POSITION__BOTTOM_CENTRAL, 'C_TOP_FOOTER' => $position == Menu::BLOCK_POSITION__TOP_FOOTER, 'C_FOOTER' => $position == Menu::BLOCK_POSITION__FOOTER, 'C_LEFT' => $position == Menu::BLOCK_POSITION__LEFT, 'C_RIGHT' => $position == Menu::BLOCK_POSITION__RIGHT, 'C_VERTICAL' => $vertical_position, 'C_HORIZONTAL' => !$vertical_position)); }