当前位置: 首页>>代码示例>>PHP>>正文


PHP current_theme函数代码示例

本文整理汇总了PHP中current_theme函数的典型用法代码示例。如果您正苦于以下问题:PHP current_theme函数的具体用法?PHP current_theme怎么用?PHP current_theme使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了current_theme函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: profile_load

 function profile_load(&$a, $nickname, $profile = 0, $profiledata = array())
 {
     $user = q("SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1", dbesc($nickname));
     if (!$user && count($user) && !count($profiledata)) {
         logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
         notice(t('Requested account is not available.') . EOL);
         $a->error = 404;
         return;
     }
     $pdata = get_profiledata_by_nick($nickname, $user[0]['uid'], $profile);
     if ($pdata === false || !count($pdata) && !count($profiledata)) {
         logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
         notice(t('Requested profile is not available.') . EOL);
         $a->error = 404;
         return;
     }
     // fetch user tags if this isn't the default profile
     if (!$pdata['is-default']) {
         $x = q("SELECT `pub_keywords` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1", intval($pdata['profile_uid']));
         if ($x && count($x)) {
             $pdata['pub_keywords'] = $x[0]['pub_keywords'];
         }
     }
     $a->profile = $pdata;
     $a->profile_uid = $pdata['profile_uid'];
     $a->profile['mobile-theme'] = get_pconfig($a->profile['profile_uid'], 'system', 'mobile_theme');
     $a->profile['network'] = NETWORK_DFRN;
     $a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename'];
     //		if (!$profiledata)
     //			$_SESSION['theme'] = $a->profile['theme'];
     $_SESSION['mobile-theme'] = $a->profile['mobile-theme'];
     /**
      * load/reload current theme info
      */
     $a->set_template_engine();
     // reset the template engine to the default in case the user's theme doesn't specify one
     $theme_info_file = "view/theme/" . current_theme() . "/theme.php";
     if (file_exists($theme_info_file)) {
         require_once $theme_info_file;
     }
     if (!x($a->page, 'aside')) {
         $a->page['aside'] = '';
     }
     if (local_user() && local_user() == $a->profile['uid'] && $profiledata) {
         $a->page['aside'] .= replace_macros(get_markup_template('profile_edlink.tpl'), array('$editprofile' => t('Edit profile'), '$profid' => $a->profile['id']));
     }
     $block = get_config('system', 'block_public') && !local_user() && !remote_user() ? true : false;
     // To-Do:
     // By now, the contact block isn't shown, when a different profile is given
     // But: When this profile was on the same server, then we could display the contacts
     if ($profiledata) {
         $a->page['aside'] .= profile_sidebar($profiledata, true);
     } else {
         $a->page['aside'] .= profile_sidebar($a->profile, $block);
     }
     /*if(! $block)
     	 $a->page['aside'] .= contact_block();*/
     return;
 }
开发者ID:vinzv,项目名称:friendica,代码行数:59,代码来源:identity.php

示例2: field_preprocess

 /**
  * If exists, this method can process local alternative values for
  * realizing the template. Type information structure dependant.
  * @param object $data the hash of label content fields
  */
 function field_preprocess(&$data)
 {
     global $CFG;
     $data->disciplinimage = str_replace(' ', '_', $data->disciplinoption);
     if (!file_exists($CFG->dirroot . "/theme/" . current_theme() . '/lppix/disciplin/' . $data->disciplinimage . ".jpg")) {
         $data->disciplinimage = 'other';
     }
 }
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:13,代码来源:customlabel.class.php

示例3: preprocess_data

 /**
  * If exists, this method can process local alternative values for
  * realizing the template. Type information structure dependant.
  * @param object $data the hash of label content fields
  */
 function preprocess_data()
 {
     global $CFG;
     $this->data->stepimage = str_replace(' ', '_', $this->data->stepoption);
     if (!file_exists($CFG->dirroot . "/theme/" . current_theme() . '/lppix/taosteps/' . $this->data->stepimage . ".jpg")) {
         $this->data->stepimage = 'outofsteps';
     }
 }
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:13,代码来源:customlabel.class.php

示例4: show

 /**
  * Display the specified category.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function show($id)
 {
     $category = Category::find($id);
     if (!$category) {
         abort(404);
     }
     $viewData = ['category' => $category, 'pageTitle' => 'Category: ' . $category->title];
     if (current_theme_exists() && theme_view_exists(current_theme(), 'categories.show')) {
         return response(current_theme_view('categories.show', $viewData));
     }
     return view('categories.show', $viewData);
 }
开发者ID:monkblog,项目名称:monkblog-php,代码行数:19,代码来源:CategoriesController.php

示例5: get_name

 /**
  *
  *
  */
 function get_name()
 {
     // $textlib = textlib_get_instance();
     $this->data->customlabelcss = customlabel_get_stylesheet($this->type);
     $this->data->currenttheme = current_theme();
     $this->data->title = $this->title;
     $name = $this->make_template();
     if (empty($name)) {
         // arbitrary name
         $name = "customlabel{$customlabel->instance}";
     }
     return $name;
 }
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:17,代码来源:customtype.class.php

示例6: getHome

 public function getHome()
 {
     $recentPosts = Post::where('is_published', '=', true)->orderBy('published_at', 'desc')->take(4)->get();
     $featuredPost = $recentPosts->shift();
     $more = false;
     if (Post::where('is_published', '=', true)->count() > 5) {
         $more = true;
     }
     $viewData = ['pageTitle' => 'Home', 'featuredPost' => $featuredPost, 'recentPosts' => $recentPosts, 'more' => $more];
     if (current_theme_exists() && theme_view_exists(current_theme(), 'home')) {
         return response(current_theme_view('home', $viewData));
     }
     return view('home', $viewData);
 }
开发者ID:monkblog,项目名称:monkblog-php,代码行数:14,代码来源:HomeController.php

示例7: less_compiler

function less_compiler($theme, $override = array())
{
    global $CFG;
    $swatch = $theme->settings->subtheme;
    $responsive = $theme->settings->responsive;
    $awesome = $theme->settings->awesome;
    // TODO: add setting for padding between breadcrumb and fixed navbar.
    $extra_padding = 0;
    $padding = 0;
    $icon_color = 'inherit';
    $icon_opacity = 1;
    if ($swatch == 'random') {
        $colors = array('inherit', 'red', 'yellow', 'pink', 'purple', 'orange', 'blue', 'green');
        $color_key = array_rand($colors);
        $icon_color = $colors[$color_key];
        $opacities = array(0.2, 0.4, 0.6, 0.8, 1);
        $opacity_key = array_rand($opacities);
        $icon_opacity = $colors[$opacity_key];
        $swatches = array('amelia', 'cerulean', 'cosmo', 'cyborg', 'journal', 'readable', 'simplex', 'slate', 'spacelab', 'spruce', 'superhero', 'united');
        $swatch = $swatches[array_rand($swatches)];
        $responsive = rand(0, 1);
        $awesome = rand(0, 1);
        $extra_padding = rand(0, 1);
        if ($extra_padding == 1) {
            $padding = 20;
        }
    }
    $cache_name = md5(serialize(array($swatch, $responsive, $awesome, $extra_padding, $icon_color, $icon_opacity)));
    $current_theme = current_theme();
    $cachedir = "{$CFG->cachedir}/theme/{$current_theme}";
    $cachefile = "{$cachedir}/{$cache_name}.css";
    $themedir = $theme->dir;
    $themewww = $current_theme;
    if (isset($CFG->themewww)) {
        $themewww = "{$CFG->themewww}/{$current_theme}";
    }
    $less_variables = array('swatch' => "'{$swatch}'", 'navbarMargin' => $padding, 'php_fontAwesomePath' => "'{$themewww}/pix/font'", 'iconColor' => $icon_color, 'iconOpacity' => $icon_opacity, 'php_iconSpritePath' => "'{$themewww}/pix/glyphicons-halflings.png'", 'php_iconWhiteSpritePath' => "'{$themewww}/pix/glyphicons-halflings-white.png'", 'php_horizontalComponentOffset' => '200px');
    if ($awesome) {
        $import_dirs[] = "{$themedir}/style/font-awesome";
    } else {
        $import_dirs[] = "{$themedir}/style/glyphicons";
    }
    $import_dirs[] = "{$themedir}/style";
    $less_input = less_input($swatch, $responsive);
    $output = compile($less_input, $less_variables, $import_dirs);
    $search[] = 'fonts/';
    $replace[] = $less_variables['php_fontAwesomePath'] . '/';
    $output = str_replace($search, $replace, $output);
    return $output;
}
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:50,代码来源:lib.php

示例8: load_page

/**
 * @brief Load page template in dependence of the template mode
 * 
 * @todo Check if this is really needed.
 */
function load_page(&$a)
{
    if (isset($_GET["mode"]) and $_GET["mode"] == "minimal") {
        require "view/theme/frio/minimal.php";
    } elseif (isset($_GET["mode"]) and $_GET["mode"] == "none") {
        require "view/theme/frio/none.php";
    } else {
        $template = 'view/theme/' . current_theme() . '/' . (x($a->page, 'template') ? $a->page['template'] : 'default') . '.php';
        if (file_exists($template)) {
            require_once $template;
        } else {
            require_once str_replace('theme/' . current_theme() . '/', '', $template);
        }
    }
}
开发者ID:rabuzarus,项目名称:frio,代码行数:20,代码来源:frio_boot.php

示例9: offline_get_static_files

/**
 * Retrieve all static files for the turbo manifest
 *
 * @return string[] The array of static files
 */
function offline_get_static_files()
{
    global $CFG, $THEME;
    // Include static JavaScript files
    $files = array($CFG->wwwroot . '/lib/javascript-static.js', $CFG->wwwroot . '/lib/javascript-deprecated.js', $CFG->wwwroot . '/lib/javascript-mod.php', $CFG->wwwroot . '/lib/overlib/overlib.js', $CFG->wwwroot . '/lib/overlib/overlib_cssstyle.js', $CFG->wwwroot . '/lib/cookies.js', $CFG->wwwroot . '/lib/ufo.js', $CFG->wwwroot . '/lib/dropdown.js', $CFG->wwwroot . '/blocks/admin_tree/admintree.js', $CFG->wwwroot . '/mod/forum/forum.js', $CFG->wwwroot . '/pix/t/stop.gif', $CFG->wwwroot . '/pix/t/go.gif');
    foreach (get_list_of_plugins() as $module) {
        $files[] = $CFG->wwwroot . '/mod/' . $module . '/icon.gif';
    }
    $themefiles = offline_get_files_from_dir($CFG->dirroot . '/theme/' . current_theme());
    $themefiles = str_replace($CFG->dirroot . '/theme', $CFG->themewww, $themefiles);
    $files = array_merge($files, $THEME->get_stylesheet_urls(), $themefiles);
    $files[] = $CFG->wwwroot . '/lib/offline/gears_init.js';
    $files = str_replace('&', '&', $files);
    return $files;
}
开发者ID:ajv,项目名称:Offline-Caching,代码行数:20,代码来源:lib.php

示例10: show

 /**
  * Display the specified resource.
  * GET /options/{id}
  *
  * @param  $slug
  *
  * @return Response
  */
 public function show($slug)
 {
     $themes = [];
     $currentTheme = current_theme();
     $id = '';
     $optionTabs = OptionTab::all();
     $optionTab = OptionTab::where('slug', '=', $slug)->get()->first();
     $slug = $optionTab->slug;
     $pageTitle = $optionTab->display_name . ' Options';
     $options = $optionTab->options->all();
     if ($slug == 'themes') {
         $themes = theme_manager()->all();
         $id = $optionTab->options->first()->id;
     }
     return view('options.index', compact('slug', 'optionTabs', 'options', 'pageTitle', 'themes', 'currentTheme', 'id'));
 }
开发者ID:monkblog,项目名称:monkblog-php,代码行数:24,代码来源:OptionsController.php

示例11: customlabel_get_stylesheet

/**
* get a suitable CSS for a class
* @uses $CFG
*/
function customlabel_get_stylesheet($classname)
{
    global $CFG;
    $theme = current_theme();
    $css = $CFG->themewww . "/{$theme}/customlabel/{$classname}/customlabel.css";
    $cssloc = $CFG->dirroot . "/theme/{$theme}/customlabel/{$classname}/customlabel.css";
    if (file_exists($cssloc)) {
        return $css;
    }
    $css = $CFG->wwwroot . "/mod/customlabel/type/{$classname}/customlabel.css";
    $cssloc = $CFG->dirroot . "/mod/customlabel/type/{$classname}/customlabel.css";
    if (file_exists($cssloc)) {
        return $css;
    }
    return '';
}
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:20,代码来源:locallib.php

示例12: get_content

 function get_content()
 {
     global $CFG, $ME, $COURSE;
     //get list of themes
     $themes = get_list_of_themes();
     if ($this->content !== NULL) {
         return $this->content;
     }
     $this->content->footer = '';
     $this->content->text = '';
     $context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
     if (has_capability('block/session_theme:switchthemes', $context)) {
         $this->content->text .= popup_form($ME . '?id=' . $COURSE->id . '&theme=', $themes, 'sessionthemeform', current_theme(), 'choose', '', '', true);
         $this->content->footer .= '';
     } else {
         $this->content = '';
     }
     return $this->content;
 }
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:19,代码来源:block_session_theme.php

示例13: __construct

 function __construct($data)
 {
     global $CFG;
     parent::__construct($data);
     $this->type = 'sequenceheading';
     $this->fields = array();
     $field = new StdClass();
     $field->name = 'heading';
     $field->size = 80;
     $field->type = 'textfield';
     $this->fields['heading'] = $field;
     $field = new StdClass();
     $field->name = 'shortdesc';
     $field->type = 'textarea';
     $this->fields['shortdesc'] = $field;
     $field = new StdClass();
     $field->name = 'imageurl';
     $field->type = 'textfield';
     $field->size = 60;
     if (!is_file($CFG->dirroot . '/theme/' . current_theme() . '/pix/customlabel_icons/defaultsequenceheading.png')) {
         $field->default = $CFG->wwwroot . '/mod/customlabel/type/sequenceheading/defaultsequenceheading.jpg';
     } else {
         $field->default = $CFG->wwwroot . '/theme/' . current_theme() . '/pix/customlabel_icons/defaultsequenceheading.png';
     }
     $this->fields['imageurl'] = $field;
     $field = new StdClass();
     $field->name = 'overimagetext';
     $field->type = 'textfield';
     $field->size = 20;
     $this->fields['overimagetext'] = $field;
     $field = new StdClass();
     $field->name = 'imageposition';
     $field->type = 'list';
     $field->options = array('none', 'left', 'right');
     $field->default = 'left';
     $this->fields['imageposition'] = $field;
     $field = new StdClass();
     $field->name = 'verticalalign';
     $field->type = 'list';
     $field->options = array('top', 'middle', 'bottom');
     $field->default = 'top';
     $this->fields['verticalalign'] = $field;
 }
开发者ID:SmartPlanetInternational,项目名称:moodle-mod_customlabel,代码行数:43,代码来源:customlabel.class.php

示例14: icon_check

function icon_check($icon_name, $type)
{
    global $CFG, $USER, $THEME;
    if ($type == 'mod') {
        $icon_name_mod = '/theme/' . current_theme() . '/pix/' . $icon_name;
    } else {
        $icon_name_mod = '/theme/' . current_theme() . '/' . $icon_name;
    }
    if ($icon_name == 'pix/i/course.gif') {
        //echo $CFG->dirroot.$icon_name_mod;
        // echo ' '.$USER->id.' ';
        print_r($USER);
    }
    if (file_exists($CFG->dirroot . $icon_name_mod)) {
        echo $CFG->wwwroot . $icon_name_mod;
    } else {
        echo '/' . $icon_name;
    }
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:19,代码来源:styles.php

示例15: __construct

 function __construct()
 {
     parent::__construct();
     $a = get_app();
     $theme = current_theme();
     // setTemplateDir can be set to an array, which Smarty will parse in order.
     // The order is thus very important here
     $template_dirs = array('theme' => "view/theme/{$theme}/" . SMARTY3_TEMPLATE_FOLDER . "/");
     if (x($a->theme_info, "extends")) {
         $template_dirs = $template_dirs + array('extends' => "view/theme/" . $a->theme_info["extends"] . "/" . SMARTY3_TEMPLATE_FOLDER . "/");
     }
     $template_dirs = $template_dirs + array('base' => "view/" . SMARTY3_TEMPLATE_FOLDER . "/");
     $this->setTemplateDir($template_dirs);
     $this->setCompileDir('view/smarty3/compiled/');
     $this->setConfigDir('view/smarty3/config/');
     $this->setCacheDir('view/smarty3/cache/');
     $this->left_delimiter = $a->get_template_ldelim('smarty3');
     $this->right_delimiter = $a->get_template_rdelim('smarty3');
     // Don't report errors so verbosely
     $this->error_reporting = E_ALL & ~E_NOTICE;
 }
开发者ID:ZerGabriel,项目名称:friendica,代码行数:21,代码来源:friendica_smarty.php


注:本文中的current_theme函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。