public function __construct($content) { $template = new Template(); $template->vars = $content; $this->html = $template->render('html.tpl.php'); $this->header = $template->render('header.tpl.php'); $this->body = $template->render('body.tpl.php'); $this->footer = $template->render('footer.tpl.php'); }
function renderfile($file) { $view = new Template(); $view->navbar = $view->render('navbar_v.php'); $view->title = "Login"; $view->content = $view->render($file); echo $view->render('main.php'); return $view; }
public function send($address, $subject) { if ($this->active) { $headers = $this->getHeaders(); $this->mail($address, $subject, $this->template->render($this->data), $headers, '-f blspark1@gmail.com'); } else { echo $this->template->render($this->data); } }
public function indexAction() { $this->_template = new Template(); $this->_template->url = './index.php'; $this->_template->lang = $this->_lang; $this->_template->dictionary = $this->_dictionary; $this->_template->wwwRoot = $this->_wwwRoot; if ($this->_lang == 'ru') { $this->_template->license = file_get_contents('./templates/gpl-3.0_ru.txt'); } else { $this->_template->license = file_get_contents('./templates/gpl-3.0_en.txt'); } echo $this->_template->render('./templates/install.php'); }
public function index() { if ($this->config->item('updates.do_check')) { $this->load->library('GitHub_lib'); $this->load->helper('date'); // Latest commits Template::set('commits', $this->github_lib->user_timeline('ci-bonfire', 'Bonfire')); $tags = $this->github_lib->repo_refs('ci-bonfire', 'Bonfire'); $version = 0.0; foreach ($tags as $tag => $ref) { if ($tag > $version) { $version = $tag; } } Template::set('update_message', 'You are running Bonfire version <b>'. BONFIRE_VERSION .'</b>. The latest available version is <b>'. $version .'</b>.'); } Template::render(); }
/** * Display the available shortcuts and the details of the keys setup for * these shortcut options. * * Manages adding, editing and deleting of the shortcut keys. * * @return void */ public function index() { if (isset($_POST['add_shortcut'])) { if ($this->add()) { Template::set_message(lang('ui_shortcut_success'), 'success'); } else { Template::set_message(lang('ui_shortcut_add_error'), 'error'); } } elseif (isset($_POST['remove_shortcut'])) { if ($this->remove()) { Template::set_message(lang('ui_shortcut_remove_success'), 'success'); } else { Template::set_message(lang('ui_shortcut_remove_error'), 'error'); } } elseif (isset($_POST['save'])) { if ($this->save_settings()) { Template::set_message(lang('ui_shortcut_save_success'), 'success'); } else { Template::set_message(lang('ui_shortcut_save_error'), 'error'); } } // Read available shortcuts from the application config Template::set('current', config_item('ui.current_shortcuts')); Template::set('settings', $this->settings_lib->find_all_by('module', 'core.ui')); Template::set('toolbar_title', lang('ui_shortcuts')); Template::render(); }
public function add_category() { $data = array(); Template::set_view('v_category_add'); Template::set($data); Template::render(); }
public function index() { if ($this->input->post('submit')) { if ($this->save_settings()) { Template::set_message(lang('mod_settings_saved'), 'success'); redirect(SITE_AREA . '/settings/comments'); } else { Template::set_message(lang('md_settings_error'), 'error'); } } // Read our current settings $settings = $this->settings_model->select('name,value')->find_all_by('module', 'comments'); Template::set('settings', $settings); if (!isset($this->role_model)) { $this->load->model('roles/role_model'); } $roles = array(); $tmpRoles = $this->role_model->select('role_id, role_name, default')->where('deleted', 0)->find_all(); if (isset($tmpRoles) && is_array($tmpRoles) && count($tmpRoles)) { foreach ($tmpRoles as $role) { $roles = $roles + array($role->role_id => $role->role_name); } } Template::set('roles', $roles); Template::set('toolbar_title', lang('mod_settings_title')); Template::set_view('comments/settings/index'); Template::render(); }
public static function main($tmplData) { //echo "Render::main()"; global $ini; $tmplData['{{content}}'] = Template::render($ini['mainTemplate'], $tmplData); Template::display($ini['layoutTemplate'], $tmplData); }
public function index() { if ($this->settings_lib->item('updates.do_check') && function_exists('curl_version')) { $this->load->library('GitHub_lib'); $this->load->helper('date'); // Latest commits Template::set('commits', $this->github_lib->user_timeline('ci-bonfire', 'Bonfire', 'develop')); $tags = $this->github_lib->repo_refs('ci-bonfire', 'Bonfire'); $version = 0.0; if (is_object($tags) && count($tags)) { foreach ($tags as $tag => $ref) { if ($tag > $version) { $version = $tag; } } if (BONFIRE_VERSION === $version) { Template::set('update_message', 'You are running Bonfire version <b>' . BONFIRE_VERSION . '</b>. This is the latest available version of Bonfire.'); } else { Template::set('update_message', 'You are running Bonfire version <b>' . BONFIRE_VERSION . '</b>. The latest <b>stable</b> version available is <b>' . $version . '</b>.'); } } else { Template::set('update_message', 'You are running Bonfire version <b>' . BONFIRE_VERSION . '</b>. <b>Unable to retrieve the latest version at this time.</b>'); } } Template::render(); }
public function edit() { $this->load->library('form_validation'); $server_type = $this->uri->segment(5); if ($this->input->post('submit')) { $this->form_validation->set_rules('server_type', lang('db_server_type'), 'required|trim|max_length[20]|xss_clean'); $this->form_validation->set_rules('hostname', lang('db_hostname'), 'required|trim|max_length[120]|xss_clean'); $this->form_validation->set_rules('database', lang('db_dbname'), 'required|trim|max_length[120]|xss_clean'); $this->form_validation->set_rules('username', lang('bf_username'), 'trim|xss_clean'); $this->form_validation->set_rules('password', lang('bf_password'), 'trim|xss_clean'); if ($this->form_validation->run() !== FALSE) { unset($_POST['server_type'], $_POST['submit']); if (write_db_config(array($server_type => $_POST)) == TRUE) { Template::set_message(lang('db_successful_save'), 'success'); $this->activity_model->log_activity($this->auth->user_id(), $server_type . ' : ' . lang('db_successful_save_act'), 'database'); } else { Template::set_message(lang('db_erroneous_save'), 'error'); $this->activity_model->log_activity($this->auth->user_id(), $server_type . ' : ' . lang('db_erroneous_save_act'), 'database'); } } } $settings = read_db_config($server_type); if (!empty($settings)) { Template::set('db_settings', $settings[$server_type]); } Template::set('server_type', $server_type); Template::render(); }
/** * Builds the control * * @return string */ public function build() { $result=''; $this->rows=$this->get_data(); $rendered=''; $this->count=0; if (($this->rows!=null) && ($this->item_template!=null)) { $template=new Template(PATH_APP.'view/'.$this->item_template.EXT); foreach($this->rows as $row) { $rendered.=$template->render(array('item' => $row, 'control' => $this, 'count' => $this->count, 'total_count'=>$this->total_count)); $this->current=&$row; $this->current_index=$this->count++; } } if ($this->container_template!=null) { $view=new Template(PATH_APP.'view/'.$this->container_template.EXT); $result=$view->render(array('total_count'=>$this->total_count, 'count'=>$this->count, 'control' => $this, 'content' => $rendered)); } else $result=$rendered; return $result; }
/** * Render * * @param type $template */ public function render($template = NULL) { $template or $template = $this->template; $tpl = new Template($template); $tpl->item = $this; return $tpl->render(); }
public function modmanifest() { // load the models if (isset($_POST['submit'])) { $showSpecies = $this->input->post('chkShowSpecies', true); $showGender = $this->input->post('chkShowGender', true); $showThumbnail = $this->input->post('chkShowThumbnail', true); $setting_data = array('setting_value' => $showSpecies); $update_settings = $this->settings->update_setting('modManifest_show_species', $setting_data); $setting_data = array('setting_value' => $showGender); $update_settings = $this->settings->update_setting('modManifest_show_gender', $setting_data); $setting_data = array('setting_value' => $showThumbnail); $update_settings = $this->settings->update_setting('modManifest_show_thumbnail', $setting_data); $message = "Settings updated sucessfully."; $flash['status'] = 'success'; $flash['message'] = text_output($message); } $data['checkboxes']['show_species'] = array('name' => 'chkShowSpecies', 'id' => 'chkShowSpecies', 'value' => 'true'); $data['checkboxes']['show_gender'] = array('name' => 'chkShowGender', 'id' => 'chkShowGender', 'value' => 'true'); $data['checkboxes']['show_thumbnail'] = array('name' => 'chkShowThumbnail', 'id' => 'chkShowThumbnail', 'value' => 'true'); $set_species = $this->settings->get_setting('modManifest_show_species'); $set_gender = $this->settings->get_setting('modManifest_show_gender'); $set_thumbnail = $this->settings->get_setting('modManifest_show_thumbnail'); $data['temp'] = $set_species; $data['checkboxes']['show_species']['checked'] = $set_species; $data['checkboxes']['show_gender']['checked'] = $set_gender; $data['checkboxes']['show_thumbnail']['checked'] = $set_thumbnail; $data['submit'] = array('type' => 'submit', 'class' => 'button-main', 'name' => 'submit', 'value' => 'submit', 'content' => ucwords(lang('actions_submit'))); $data['header'] = "Manifest Details Configuration"; $view_loc = "admin_modmanifest"; $this->_regions['content'] = Location::view($view_loc, $this->skin, 'admin', $data); $this->_regions['title'] .= $data['header']; Template::assign($this->_regions); Template::render(); }
public function render() { // Get Template and Page if (!file_exists(BASEPATH.'/app/views/'.Routes::getController().'/'.Routes::getMethod().'.php')) trigger_error('View file "'.Routes::getController().'/'.Routes::getMethod().'.php" was not found.'); Template::render($this->vars, true); }
public function edit($id) { // find article if (($article = Posts::find(array('id' => $id))) === false) { return Response::redirect($this->admin_url . '/posts'); } // process post request if (Input::method() == 'POST') { if (Posts::update($id)) { // redirect path return Response::redirect($this->admin_url . '/posts/edit/' . $id); } } // get comments $comments = Comments::list_all(array('post' => $id)); $pending = array(); foreach ($comments as $comment) { if ($comment->status == 'pending') { $pending[] = $comment->id; } } $pending = count($pending); // get posts page $page = Pages::find(array('id' => Config::get('metadata.posts_page'))); Template::render('posts/edit', array('article' => $article, 'comments' => $comments, 'page' => $page, 'pending' => $pending)); }
public function getStringAsHTML($sKey, $aParams = array(), $sLanguageId = null, $sDefaultValue = null) { $mResult = TranslationPeer::getString($sKey, $sLanguageId, $sDefaultValue, $aParams, true); $oTemplate = new Template(TemplateIdentifier::constructIdentifier('result'), null, true); $oTemplate->replaceIdentifier('result', $mResult); return $oTemplate->render(); }
public function index() { $this->load->helper('typography'); // $this->load->helper('form'); $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); $this->form_validation->set_rules('card_holder', 'Card Holder Name', 'trim|required|xss_clean'); $this->form_validation->set_rules('card_number', 'Card Number', 'trim|required|numeric|exact_length[16]|xss_clean'); $this->form_validation->set_rules('card_csv', 'CSV', 'trim|required|numeric|exact_length[3]|xss_clean'); $this->form_validation->set_rules('card_type', 'Card Type', 'required'); $this->form_validation->set_rules('billing_address', 'Billing Address', 'required'); $this->form_validation->set_rules('billing_postcode', 'Post Code', 'required'); $this->form_validation->set_rules('credit_phonenumber', 'Phone Number', 'required'); if ($this->form_validation->run() == FALSE) { Template::render(); } else { $this->load->view('formsuccess'); $success = TRUE; Template::set('success', $success); Template::render(); } }
/** * Display a form with various site settings including site name and * registration settings * * @return void */ public function index() { $this->load->config('extended_settings'); $extended_settings = config_item('extended_settings_fields'); if (isset($_POST['save'])) { if ($this->saveSettings($extended_settings)) { Template::set_message(lang('settings_saved_success'), 'success'); } else { Template::set_message(lang('settings_error_success'), 'error'); $settingsError = $this->settings_lib->getError(); if ($settingsError) { Template::set_message($settingsError, 'error'); } } redirect(SITE_AREA . '/settings/settings'); } // Read the current settings $settings = $this->settings_lib->find_all(); // Get the available languages $this->load->helper('translate/languages'); Template::set_view('settings/settings/index'); Template::set('extended_settings', $extended_settings); Template::set('languages', list_languages()); Template::set('selected_languages', unserialize($settings['site.languages'])); Template::set('settings', $settings); Template::set('showDeveloperTab', $this->auth->has_permission($this->permissionDevView)); Template::render(); }
public function generate($gen_name = '') { $class_name = $this->load_generator($gen_name); $class = new $class_name(); Template::set('content', $class->render()); Template::render('two_left'); }
/** * Put your own methods below this... */ function alertstatus() { $this->auth->check_access('site/settings', TRUE); /* load models */ $this->load->model('alertstatus_model', 'alert'); $alerts = $this->alert->get_alerts(); if ($alerts->num_rows() > 0) { foreach ($alerts->result() as $alert) { $imgstat = 'off'; if ($alert->alert_active == 'y') { $imgstat = 'on'; } $data['alerts'][$alert->alert_id] = array('img' => array('src' => Location::asset('images/alerts', $alert->alert_image . '-' . $imgstat . '.png'), 'alt' => $alert->alert_name, 'class' => $imgstat, 'currStat' => $alert->alert_image, 'id' => 'al' . $alert->alert_id), 'name' => $alert->alert_name, 'desc' => $alert->alert_description, 'active' => $alert->alert_active, 'id' => $alert->alert_id, 'imgbase' => $alert->alert_image); $data_js['img'][$alert->alert_id] = array('src' => $alert->alert_image . '-hover.png', 'id' => $alert->alert_id); } } $data['loading'] = array('src' => Location::asset('images/alerts', 'black-bg-loading.gif'), 'alt' => '', 'class' => 'image'); $data['imglocation'] = base_url() . Location::asset('images/alerts', ''); $data['activealert'] = $this->alert->get_current_alert(); $data['header'] = 'Alert Status'; $data['text'] = 'Set the current alert status of your ship by clicking on the proper alert claxon.'; $this->_regions['content'] = Location::view('admin_alertstatus', $this->skin, 'admin', $data); $this->_regions['javascript'] = Location::js('admin_alertstatus_js', $this->skin, 'admin'); $this->_regions['title'] .= $data['header']; Template::assign($this->_regions); Template::render(); }
public function render() { if ($this->callback) { $callback = Cogear::prepareCallback($this->callback); $this->setValues(call_user_func($callback)); } $this->setAttributes(); $code = array(); foreach ($this->values as $key => $value) { $attributes = $this->attributes; $attributes['value'] = $key; if ($key === $this->value) { $attributes['checked'] = 'checked'; } $code[] = HTML::tag('input', $attributes) . $value; } $code = implode("<br/>", $code); if ($this->wrapper) { $tpl = new Template($this->wrapper); $tpl->assign($this->attributes); $tpl->code = $code; $code = $tpl->render(); } return $code; }
public function edit() { $server_type = $this->uri->segment(5); if ($this->input->post('submit')) { //echo '<pre>'; print_r($_POST); die(); unset($_POST['server_type'], $_POST['submit']); if (write_db_config(array($server_type => $_POST)) == TRUE) { Template::set_message('Your settings were successfully saved.', 'success'); } else { Template::set_message('There was an error saving the settings.', 'error'); } } $settings = read_db_config($server_type); Template::set('db_settings', $settings[$server_type]); Template::set('server_type', $server_type); Template::render(); }
public function render() { if ($this->callback) { $callback = Callback::prepare($this->callback); is_callable($callback) && $this->setValues(call_user_func($callback)); } $this->getAttributes(); $code[] = HTML::open_tag('select', $this->attributes); foreach ($this->values as $key => $value) { $attributes = array(); if ($key == $this->value) { $attributes['selected'] = 'selected'; } $attributes['value'] = $key; $code[] = HTML::paired_tag('option', $value, $attributes); } $code[] = HTML::close_tag('select'); $code = implode("\n", $code); if ($this->wrapper) { $tpl = new Template($this->wrapper); $tpl->assign($this->attributes); $tpl->code = $code; $code = $tpl->render(); } return $code; }
public function poem($f3) { $this->get_poem($f3, (int) $f3->get('PARAMS.idpoem')); $f3->set('do_analytics', 1); $template = new Template(); echo $template->render('ui.html'); }
public function draw() { $oldPath = CurrentPath::set(dirname(__FILE__)); $template = new Template('view/view.xml'); print $template->render(array('payment' => $this)); CurrentPath::set($oldPath); }
/** * Displays the homepage of the Bonfire app * * @return void */ public function index() { $this->load->library('installer_lib'); $this->load->model('banner/banner_model'); $this->load->model('department/department_model'); $this->load->model('social_link/social_link_model'); if ($this->general_model->find_by('bf_info', 'info_value', 'info_key', "'status'") == '1') { echo $this->general_model->find_by('bf_info', 'info_value', 'info_key', "'offline_mssage'"); die; } if (!$this->installer_lib->is_installed()) { redirect(site_url('install')); } $B = $this->banner_model->find_all(); if (isset($B)) { foreach ($B as $record) { if (date('m/d/Y', strtotime($record->from)) <= date('m/d/Y') && date('m/d/Y', strtotime($record->end_date)) >= date('m/d/Y')) { $banners[] = $record; } } } $departments = $this->department_model->find_all_by('status', '1'); $social_links = $this->social_link_model->find_all_by('status', '1'); Template::set('banners', $banners[0]); Template::set('departments', $departments); Template::set('social_links', $social_links); $this->load->library('users/auth'); $this->set_current_user(); Template::render(); }
public function testPStringWithHTMLAsTemplate() { $sString = TranslationPeer::getString('simple_quote', 'de', null, array('quoted' => 'String')); $oTemplate = new Template(TemplateIdentifier::constructIdentifier('string'), null, true); $oTemplate->replaceIdentifier('string', $sString); $this->assertSame(">String<", $oTemplate->render()); }
public function index($value = '') { $data = array(); Template::set_view('v_index'); Template::set($data); Template::render(); }
/** * * @return type */ public function render() { if ($this->callback) { $callback = new Callback($this->callback); if ($callback->check()) { $this->options->values = $callback->run(array($this->form)); } } $this->prepareOptions(); $code[] = HTML::open_tag('select', $this->options); foreach ($this->values as $key => $value) { $attributes = array(); if ($this->value instanceof Core_ArrayObject) { $this->value = $this->value->toArray(); } if (is_array($this->value)) { if (in_array($key, $this->value)) { $attributes['selected'] = 'selected'; } } elseif ($key == $this->value) { $attributes['selected'] = 'selected'; } $attributes['value'] = $key; $code[] = HTML::paired_tag('option', $value, $attributes); } $code[] = HTML::close_tag('select'); $code = implode("\n", $code); if ($this->wrapper) { $tpl = new Template($this->wrapper); $tpl->assign($this->options); $tpl->code = $code; $code = $tpl->render(); } return $code; }