function lien_theme_pere($vtheme) { $vlien_theme_pere = ""; if ($vtheme->idtheme_rel > 0) { $vtheme_pere = new theme($vtheme->idtheme_rel); $nb = $vtheme_pere->nb_questionnaire(); $vlien_theme_pere_temp = "<a class=\"lien_ajax\" onclick=\"maj_module(" . $vtheme_pere->identifiant . ")\">" . htmlentities($vtheme_pere->titre, ENT_QUOTES, "UTF-8") . "</a> (<span class=\"nb_direct\" title=\"" . _NB_QUESTIONNAIRES_DIRECT . "\">" . $nb[1] . "</span>" . _THEME_SEPARATEUR_NB_QUESTIONNAIRE_DIRECT_ARBO . "<span class=\"nb_arbo\" title=\"" . _NB_QUESTIONNAIRES_ARBO . "\">" . $nb[0] . "</span>) > "; $vlien_theme_pere = lien_theme_pere($vtheme_pere) . $vlien_theme_pere_temp; } return $vlien_theme_pere; }
function theme_widget_full_brandlist(&$setting) { $setting['allimg'] = ""; $setting['allurl'] = ""; if ($system->theme) { $theme_dir = kernel::get_themes_host_url() . '/' . theme::getThemeName(); } else { $theme_dir = kernel::get_themes_host_url() . '/' . app::get('site')->getConf('current_theme'); } if (!$setting['pic']) { foreach ($setting['img'] as $value) { $setting['allimg'] .= $rvalue . "|"; $setting['allurl'] .= urlencode($value["url"]) . "|"; } } else { foreach ($setting['pic'] as $key => $value) { if ($value['link']) { if ($value["url"]) { $value["linktarget"] = $value["url"]; } $setting['allimg'] .= $rvalue . "|"; $setting['allurl'] .= urlencode($value["linktarget"]) . "|"; $setting['pic'][$key]['link'] = str_replace('%THEME%', $theme_dir, $value['link']); } } } return $setting; }
public static function permissions_page() { page::title("Permissions"); $out = page::link("admin/permissions/scan", "scan for more permissions"); $out .= "<form method='post' action='" . page::url("admin/permissions/update") . "'>"; $array = array(); $header = array("permissions"); $groups = user_access::get_all_roles(); foreach ($groups as $g) { $header[] = $g->groupname; } $perms = permission::get_all_permissions(); foreach ($perms as $p) { $t_array = array(); $t_array[] = "<b>{$p->permission}</b> <i>{$p->description}</i>"; foreach ($groups as $g) { $o = "<input type='checkbox' name='permissions[" . $p->permission . "][" . $g->gid . "]' "; if (user::has_permission($p->permission, $g->gid)) { $o .= "checked"; } $o .= "/>"; $t_array[] = $o; } $array[] = $t_array; } $out .= theme::t_table($array, $header); $out .= "<input type='submit' value='update'/>"; $out .= "</form>"; return $out; }
public static function open_form($attr = []) { $defaults['action'] = '/capture-handler'; $defaults['method'] = 'post'; $defaults['accept-charset'] = 'UTF-8'; $defaults['enctype'] = 'application/x-www-form-urlencoded'; $defaults['autocomplete'] = 'off'; $defaults['novalidate'] = ''; $defaults['data-parsley-validate'] = ''; $defaults['class'] .= trim('js-parsley ' . $attr['class']); $defaults['success'] = '/' . ci()->uri->uri_string(); $defaults['fail'] = '/' . ci()->uri->uri_string(); $defaults['name'] = 'None Set'; $attr = array_diff_key($defaults, $attr) + array_intersect_key($attr, $defaults); $name = $attr['name']; $success = $attr['success']; $fail = $attr['fail']; $honey_pot = 'team_name'; unset($attr['name']); unset($attr['success']); unset($attr['fail']); $html = theme::element('form', $attr); $html .= '<input type="hidden" name="_form_name" value="' . theme::hash($name) . '">'; $html .= '<input type="hidden" name="_success_goto" value="' . theme::hash($success) . '">'; $html .= '<input type="hidden" name="_fail_goto" value="' . theme::hash($fail) . '">'; $html .= '<div class="capture_field"><input name="' . $honey_pot . '" value=""></div>'; return $html; }
public function save() { access::verify_csrf(); $form = theme::get_edit_form_admin(); if ($form->validate()) { module::set_var("gallery", "page_size", $form->edit_theme->page_size->value); $thumb_size = $form->edit_theme->thumb_size->value; $thumb_dirty = false; if (module::get_var("gallery", "thumb_size") != $thumb_size) { graphics::remove_rule("gallery", "thumb", "gallery_graphics::resize"); graphics::add_rule("gallery", "thumb", "gallery_graphics::resize", array("width" => $thumb_size, "height" => $thumb_size, "master" => Image::AUTO), 100); module::set_var("gallery", "thumb_size", $thumb_size); } $resize_size = $form->edit_theme->resize_size->value; $resize_dirty = false; if (module::get_var("gallery", "resize_size") != $resize_size) { graphics::remove_rule("gallery", "resize", "gallery_graphics::resize"); graphics::add_rule("gallery", "resize", "gallery_graphics::resize", array("width" => $resize_size, "height" => $resize_size, "master" => Image::AUTO), 100); module::set_var("gallery", "resize_size", $resize_size); } module::set_var("gallery", "header_text", $form->edit_theme->header_text->value); module::set_var("gallery", "footer_text", $form->edit_theme->footer_text->value); module::set_var("gallery", "show_credits", $form->edit_theme->show_credits->value); message::success(t("Updated theme details")); url::redirect("admin/theme_options"); } else { $view = new Admin_View("admin.html"); $view->content = $form; print $view; } }
public static function form_content($content_type, $nid = 0) { $content_type = content_database::load_node_type($content_type); if ($nid != 0) { } else { page::title("add new %node", array("%node" => $content_type->name)); } $form = array(); $form['action'] = page::url("node/adding/" . $content_type->type); $form['fields'] = array(); if ($content_type->has_title) { $form['fields']['title'] = array("type" => "input", "label" => "title"); } if ($content_type->has_body) { $form['fields']['body'] = array("type" => "text", "label" => "Body"); } foreach ($content_type->fields as $field) { $fname = $field['field_machine_name']; $form["fields"][$fname] = array("label" => $field['field_name']); switch ($field["field_type"]) { case "TEXT" || "text": $form["fields"][$fname]["type"] = "text"; break; } } $form["fields"]["submit"] = array("type" => "submit", "value" => "save"); return theme::t_form($form); }
/** * ShopEx licence * * @copyright Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn) * @license http://ecos.shopex.cn/ ShopEx License */ function theme_widget_hb_pic_list(&$setting) { $setting['allimg'] = ""; $setting['allurl'] = ""; $theme_dir = kernel::get_themes_host_url() . '/' . theme::getThemeName(); if (!$setting['pic']) { foreach ($setting['img'] as $value) { $setting['allimg'] .= $rvalue . "|"; $setting['allurl'] .= urlencode($value["url"]) . "|"; } } else { foreach ($setting['pic'] as $key => $value) { if ($value['link']) { if ($value["url"]) { $value["linktarget"] = $value["url"]; } $setting['allimg'] .= $rvalue . "|"; $setting['allurl'] .= urlencode($value["linktarget"]) . "|"; $setting['pic'][$key]['link'] = str_replace('%THEME%', $theme_dir, $value['link']); } } } // var_dump($setting["pic"]); return $setting; }
/** * Attempts to load a view and pre-load view data. * * @throws Kohana_Exception if the requested view cannot be found * @param string $name view name * @param string $page_type page type: album, photo, tags, etc * @param string $theme_name view name * @return void */ public function __construct($name, $page_type) { $theme_name = module::get_var("gallery", "active_site_theme"); if (!file_exists("themes/{$theme_name}")) { module::set_var("gallery", "active_site_theme", "default"); theme::load_themes(); Kohana::log("error", "Unable to locate theme '{$theme_name}', switching to default theme."); } parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_site_theme"); if (user::active()->admin) { $this->theme_name = Input::instance()->get("theme", $this->theme_name); } $this->item = null; $this->tag = null; $this->set_global("theme", $this); $this->set_global("user", user::active()); $this->set_global("page_type", $page_type); $this->set_global("page_title", null); if ($page_type == "album") { $this->set_global("thumb_proportion", $this->thumb_proportion()); } $maintenance_mode = Kohana::config("core.maintenance_mode", false, false); if ($maintenance_mode) { message::warning(t("This site is currently in maintenance mode")); } }
public static function list_of_menus() { $array = array(); foreach (self::get_all_menus() as $list) { $array[] = page::link($list->url, $list->name); } return "<h3>Links</h3>" . theme::t_list($array); }
public function handle($request, Clousure $next) { if (isset($_COOKIE['site']['preview']) && $_COOKIE['site']['preview'] == 'true') { config::set('cache.enabled', false); theme::preview(); } return $next($request); }
public static function page_control_panel() { $a = array(); $a[] = page::link("admin/modules", "Modules"); $a[] = page::link("admin/themes", "Themes"); $a[] = page::link("admin/permissions", "Permissions"); return theme::t_list($a); }
/** * [UNFINISHED] Generates a breadcrumb or the current page. * * @return string The breadcrumb HTML */ function get_the_breadcrumb() { global $post; $str = '<ul id="breadcrumbs">'; if (!is_home()) { $str .= sprintf('<li><a href="%1$s">Home</a></li><li class="separator"> / </li>', home_url('/')); if (is_category() || is_single()) { $categories = get_the_category(); if ($categories) { $cats = array(); foreach (array_slice($categories, 0, 3) as $category) { $cats[] = sprintf('<li><a href="%1$s">%2$s</a></li>', get_category_link($category->term_id), $category->cat_name); } $str .= implode('<li class="separator"> / </li>', $cats); } if (is_single()) { $str .= '<li class="separator"> / </li><li>' . get_the_title() . '</li>'; } } elseif (is_page()) { if ($post->post_parent) { $anc = get_post_ancestors($post->ID); $title = get_the_title(); foreach ($anc as $ancestor) { $output = '<li><a href="' . get_permalink($ancestor) . '" title="' . get_the_title($ancestor) . '">' . get_the_title($ancestor) . '</a></li> <li class="separator">/</li>'; } $str .= $output; $str .= '<strong title="' . $title . ' "> ' . $title . '</strong>'; } else { $str .= '<li><strong> ' . get_the_title() . '</strong></li>'; } } } elseif (is_tag()) { single_tag_title(); } elseif (is_day()) { $str .= "<li>Archive for "; theme::time('F jS, Y'); $str .= '</li>'; } elseif (is_month()) { $str .= "<li>Archive for "; theme::time('F, Y'); $str .= '</li>'; } elseif (is_year()) { $str .= "<li>Archive for "; theme::time('Y'); $str .= '</li>'; } elseif (is_author()) { $str .= "<li>Author Archive"; $str .= '</li>'; } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { $str .= "<li>Blog Archives"; $str .= '</li>'; } elseif (is_search()) { $str .= "<li>Search Results"; $str .= '</li>'; } $str .= '</ul>'; }
static function load_themes() { $modules = Kohana::config("core.modules"); array_unshift($modules, THEMEPATH); Kohana::config_set("core.modules", $modules); theme::$name = config::get('s7n.theme'); if (strpos(Router::$current_uri, 'admin') === 0) { theme::$name = 'admin'; } }
public static function show($name, $value = null, $options = [], $extra = []) { $defaults = ['name' => $name, 'style' => '', 'id' => $name, 'class' => '', 'placeholder' => '']; $data = array_diff_key($defaults, (array) $extra) + array_intersect_key((array) $extra, $defaults); if (!is_array($value)) { $value = explode(' ', trim($value)); } echo '<select id="' . $data['id'] . '" name="' . $data['name'] . '[]" style="' . $data['style'] . '" data-placeholder="' . $data['placeholder'] . '" multiple class="' . $data['class'] . ' chosen-select">'; echo theme::dropdown_options($value, $options, $extra); echo '</select>'; }
public function link($link) { $this->loadMetaLink($link); $this->readMetaLink(); $vd = array("type" => $this->rmetas['og:video:type'], "height" => $this->rmetas['og:video:height'], "width" => $this->rmetas['og:video:width'], "video" => $this->rmetas['og:video'], "secure" => $this->rmetas['og:video:secure_url']); // // send into html $arrSectors = array("title" => $this->rmetas['og:title'], "image" => $this->rmetas['og:image'], "descr" => $this->rmetas['og:description'], "video" => addslashes(serialize($vd))); // Lead preview template return \theme::custom_template("embed_link", $arrSectors); }
/** * Initialization. */ static function gallery_ready() { if (!get_cfg_var("date.timezone")) { if (!(rand() % 4)) { Kohana_Log::add("error", "date.timezone setting not detected in " . get_cfg_var("cfg_file_path") . " falling back to UTC. " . "Consult http://php.net/manual/function.get-cfg-var.php for help."); } } identity::load_user(); theme::load_themes(); locales::set_request_locale(); }
public function template($name = '') { if (file::exists($name)) { return $name; } $template = theme::template($name); if (file::exists($template)) { return $template; } $template = application::template($name); return $template; }
public function index() { $this->head->title->append(__('Settings')); $this->template->title = __('Settings'); $form = Formo::factory()->plugin('csrf')->add('text', 'site_title', array('label' => __('Site title'), 'value' => config::get('s7n.site_title')))->add_select('theme', theme::available(), array('label' => __('Theme'), 'value' => config::get('s7n.theme')))->add('submit', 'submit', array('label' => __('Save'))); if ($form->validate()) { config::set('s7n.site_title', $form->site_title->value); config::set('s7n.theme', $form->theme->value); message::info(__('Settings edited successfully'), 'admin/settings'); } $this->template->content = View::factory('settings/settings', $form->get(TRUE)); }
public function __construct(&$app) { parent::__construct(); theme::setNoindex(); theme::setNoarchive(); theme::setNofolow(); theme::prependHeaders('<meta name="robots" content="noindex,noarchive,nofollow" />\\n'); $this->title = app::get('topm')->_('订单中心'); // 检测是否登录 if (!userAuth::check()) { redirect::action('topm_ctl_passport@signin')->send(); exit; } }
/** * Configure the system and display the theme * * @param string $config_file Custom path to the config file * @return void */ public static function init($config_file = '') { if (empty($config_file)) { self::$config_file = __DIR__ . '/../config.php'; } self::$error = new error(); self::$config = self::_get_config($config_file); self::_check_config(self::$config); self::set_vars(self::$config); debug::init(); self::update_check(); theme::init(); theme::display(); }
public function save() { $form = theme::get_edit_form_admin(); if ($form->validate()) { module::set_var("core", "page_size", $form->edit_theme->page_size->value); module::set_var("core", "thumb_size", $form->edit_theme->thumb_size->value); module::set_var("core", "resize_size", $form->edit_theme->resize_size->value); message::success(t("Updated theme details")); url::redirect("admin/theme_details"); } else { $view = new Admin_View("admin.html"); $view->content = $form; print $view; } }
public function choose($type, $theme_name) { access::verify_csrf(); $info = theme::get_info($theme_name); if ($type == "admin" && $info->admin) { module::set_var("gallery", "active_admin_theme", $theme_name); message::success(t("Successfully changed your admin theme to <b>%theme_name</b>", array("theme_name" => $info->name))); } else { if ($type == "site" && $info->site) { module::set_var("gallery", "active_site_theme", $theme_name); message::success(t("Successfully changed your Gallery theme to <b>%theme_name</b>", array("theme_name" => $info->name))); } } url::redirect("admin/themes"); }
/** * Attempts to load a view and pre-load view data. * * @throws Kohana_Exception if the requested view cannot be found * @param string $name view name * @param string $theme_name view name * @return void */ public function __construct($name) { $theme_name = module::get_var("gallery", "active_site_theme"); if (!file_exists("themes/{$theme_name}")) { module::set_var("gallery", "active_site_theme", "admin_default"); theme::load_themes(); Kohana::log("error", "Unable to locate theme '{$theme_name}', switching to default theme."); } parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_admin_theme"); if (user::active()->admin) { $this->theme_name = Input::instance()->get("theme", $this->theme_name); } $this->sidebar = ""; $this->set_global("theme", $this); $this->set_global("user", user::active()); }
/** * page * * @param boolean $realpath * @return base_view_object_interface | string */ public function page($view = null, $data = array()) { $themeName = $params['theme'] ? $params['theme'] : kernel::single('site_theme_base')->get_default('wap'); $theme = theme::uses($themeName); $layout = $this->layout; if (!$layout) { $layoutFlag = !is_null($this->layoutFlag) ? $this->layoutFlag : 'defalut'; $tmplObj = kernel::single('site_theme_tmpl'); $layout = $tmplObj->get_default($this->layoutFlag, $themeName); $layout = $layout ? $layout : (($tmpl_default = $tmplObj->get_default('default', $themeName)) ? $tmpl_default : 'default.html'); } $theme->layout($layout); if (!is_null($view)) { $theme->of($view, $data); } return $theme->render(); }
function compile_widgets($tag_args, &$smarty) { if ($tag_args['id']) { $id = ',' . $tag_args['id']; } $current_file = theme::getCurrentLayoutOrPartial(); $current_file = substr($current_file, strpos($current_file, ':') + 1); if ($tag_args['id']) { return '$s=' . var_export($current_file, 1) . '; $i = intval($__wgbar[$s]++); echo \'<div class="shopWidgets_panel" base_file="\'.$s.\'" base_slot="\'.$i.\'" base_id=' . $tag_args['id'] . ' widgets_theme="">\'; kernel::single(\'site_theme_widget\')->admin_load($s,$i' . $id . ');echo \'</div>\';'; } else { return '$s=' . var_export($current_file, 1) . '; $i = intval($__wgbar[$s]++); echo \'<div class="shopWidgets_panel" base_file="\'.$s.\'" base_slot="\'.$i.\'" base_id="" widgets_theme="">\'; kernel::single(\'site_theme_widget\')->admin_load($s,$i' . $id . ');echo \'</div>\';'; } }
public static function dropdown($name, $value, $extra = []) { $defaults = ['name' => $name, 'style' => '', 'id' => $name, 'class' => '']; $list = array_merge($defaults, $extra); $list['class'] .= ' select3'; $empty = $extra['empty']; unset($extra['empty']); $fa = self::awesomeness(); $fa = array_combine($fa, $fa); echo theme::element('select', $list); if ($empty) { echo '<option value="" selected> </option>'; } foreach ($fa as $fa) { $selected = $value == $fa && $empty == FALSE ? ' selected' : ''; echo '<option ' . $selected . ' value="' . $fa . '" data-icon="fa fa-' . $fa . '">' . ucwords(str_replace(['fa-', '-o'], '', $fa)) . '</option>'; } echo '</select>'; }
public function add_template_vars() { if (!$this->template_engine->assigned('pages')) { $this->assign('pages', Posts::get('page_list')); } //For Asides loop in sidebar.php $this->assign('asides', Posts::get('asides')); if ($this->request->display_entries_by_tag) { if (count($this->include_tag) && count($this->exclude_tag) == 0) { $this->tags_msg = _t('Posts tagged with %s', array(Format::tag_and_list($this->include_tag))); } else { if (count($this->exclude_tag) && count($this->include_tag) == 0) { $this->tags_msg = _t('Posts not tagged with %s', array(Format::tag_and_list($this->exclude_tag))); } else { $this->tags_msg = _t('Posts tagged with %s and not with %s', array(Format::tag_and_list($this->include_tag), Format::tag_and_list($this->exclude_tag))); } } } parent::add_template_vars(); }
function system_theme_action() { $declared_themes = theme::list_of_declared_themes(); foreach ($declared_themes as $theme) { if ($theme->action != null) { theme::update_action($theme->theme_name); switch ($theme->action) { case "setdefault": theme::action_set_default($theme->theme_name); break; case "disable": theme::action_disable_theme($theme->theme_name); break; case "enable": theme::action_enable_theme($theme->theme_name); break; } } } }
public function function_wapheader($params, $template) { $title = theme::getTitle() ? theme::getTitle() : app::get('sysconf')->getConf('site.name'); $keywords = theme::getKeywords(); $description = theme::getDescription(); $noindex = theme::getNoindex() ? 'true' : 'false'; $nofolow = theme::getNofollow() ? 'true' : 'false'; $icon = theme::getIcon() ?: kernel::base_url(1) . '/favicon.ico'; $html = theme::getHeaders() ?: ''; $pagedata['seo'] = compact('title', 'keywords', 'description', 'noindex', 'nofollow', 'icon'); // 通过seo类处理后生成对应的header $html .= view::make('site/common/wapheader.html', $pagedata)->render(); $services = kernel::servicelist("site_view_helper"); foreach ($services as $service) { if (method_exists($service, 'function_wapheader')) { $html .= $service->function_wapheader($params); } } $html = ecos_cactus('site', 'check_demosite', $html); return $html; }
/** * Attempts to load a view and pre-load view data. * * @throws Kohana_Exception if the requested view cannot be found * @param string $name view name * @param string $page_type page type: collection, item, or other * @param string $page_subtype page sub type: album, photo, tags, etc * @param string $theme_name view name * @return void */ public function __construct($name, $page_type, $page_subtype) { parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_site_theme"); if (identity::active_user()->admin) { $theme_name = Input::instance()->get("theme"); if ($theme_name && file_exists(THEMEPATH . $theme_name) && strpos(realpath(THEMEPATH . $theme_name), THEMEPATH) == 0) { $this->theme_name = $theme_name; } } $this->item = null; $this->tag = null; $this->set_global(array("theme" => $this, "theme_info" => theme::get_info($this->theme_name), "user" => identity::active_user(), "page_type" => $page_type, "page_subtype" => $page_subtype, "page_title" => null)); if (module::get_var("gallery", "maintenance_mode", 0)) { if (identity::active_user()->admin) { message::warning(t("This site is currently in maintenance mode. Visit the <a href=\"%maintenance_url\">maintenance page</a>", array("maintenance_url" => url::site("admin/maintenance")))); } else { message::warning(t("This site is currently in maintenance mode.")); } } }