本文整理汇总了PHP中theme类的典型用法代码示例。如果您正苦于以下问题:PHP theme类的具体用法?PHP theme怎么用?PHP theme使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了theme类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lien_theme_pere
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;
}
示例2: theme_widget_full_brandlist
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;
}
示例3: permissions_page
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;
}
示例4: open_form
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;
}
示例5: save
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;
}
}
示例6: form_content
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);
}
示例7: theme_widget_hb_pic_list
/**
* 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;
}
示例8: __construct
/**
* 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"));
}
}
示例9: list_of_menus
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);
}
示例10: handle
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);
}
示例11: page_control_panel
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);
}
示例12: get_the_breadcrumb
/**
* [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>';
}
示例13: load_themes
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';
}
}
示例14: show
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>';
}
示例15: link
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);
}