本文整理汇总了PHP中Themes类的典型用法代码示例。如果您正苦于以下问题:PHP Themes类的具体用法?PHP Themes怎么用?PHP Themes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Themes类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getThemesByDB
/**
* get the Themes config information
*
* @param object &$DBconn
* @return array $arr_data
*
*/
function getThemesByDB(&$DBconn)
{
$config = new Config(&$DBconn);
$config->config_name = 'themes';
$themes_id = $config->getValuebyName();
$themes = new Themes(&$DBconn);
$themes->id = $themes_id;
$arr_data = $themes->selectThemes();
return $arr_data;
}
开发者ID:BackupTheBerlios,项目名称:openology-svn,代码行数:17,代码来源:SystemConfig.php
示例2: setTheme
/**
* Establecer el tema visual a utilizar
*
* @param bool $force Forzar la detección del tema para los inicios de sesión
*/
public static function setTheme($force = false)
{
$theme = Session::getTheme();
if (empty($theme) || $force === true) {
$Theme = new Themes();
$userTheme = $Theme->getUserTheme();
$globalTheme = $Theme->getGlobalTheme();
$theme = $userTheme ? $userTheme : $globalTheme;
Session::setTheme($theme);
}
self::setThemePaths($theme);
Session::setTheme($theme);
}
开发者ID:bitking,项目名称:sysPass,代码行数:18,代码来源:Themes.class.php
示例3: act
/**
* All handlers must implement act() to conform to handler API.
* This is the default implementation of act(), which attempts
* to call a class member method of $this->act_$action(). Any
* subclass is welcome to override this default implementation.
*
* @param string $action the action that was in the URL rule
*/
public function act($action)
{
if (null === $this->handler_vars) {
$this->handler_vars = new SuperGlobal(array());
}
$this->action = $action;
$this->theme->assign('matched_rule', URL::get_matched_rule());
$request = new StdClass();
foreach (URL::get_active_rules() as $rule) {
$request->{$rule->name} = false;
}
$request->{$this->theme->matched_rule->name} = true;
$this->theme->assign('request', $request);
$action_hook = 'plugin_act_' . $action;
$before_action_hook = 'before_' . $action_hook;
$theme_hook = 'route_' . $action;
$after_action_hook = 'after_' . $action_hook;
Plugins::act($before_action_hook, $this);
Plugins::act($action_hook, $this);
if (Plugins::implemented($theme_hook, 'theme')) {
$theme = Themes::create();
$rule = URL::get_matched_rule();
Plugins::theme($theme_hook, $theme, $rule->named_arg_values, $this);
}
Plugins::act($after_action_hook);
}
开发者ID:wwxgitcat,项目名称:habari,代码行数:34,代码来源:pluginhandler.php
示例4: action_plugin_act_plaintext
/**
* Respond to the URL that was created
* Determine the post that was supposed to be displayed, and show it in raw
* @params array $handlervars An array of values passed in from the URL requested
*/
function action_plugin_act_plaintext($handlervars)
{
$activetheme = Themes::create();
$user_filters = array('fetch_fn' => 'get_row', 'limit' => 1);
$page_key = array_search('page', $activetheme->valid_filters);
unset($activetheme->valid_filters[$page_key]);
$user_filters = Plugins::filter('template_user_filters', $user_filters);
$user_filters = array_intersect_key($user_filters, array_flip($activetheme->valid_filters));
$where_filters = Controller::get_handler()->handler_vars->filter_keys($activetheme->valid_filters);
$where_filters = $where_filters->merge($user_filters);
$where_filters = Plugins::filter('template_where_filters', $where_filters);
$post = Posts::get($where_filters);
$current_url = URL::get();
$created_at = $post->pubdate->get();
header('Content-type: text/plain; charset=utf-8');
echo <<<HERE
# {$post->title}
By {$post->author->displayname}
<{$current_url}>
{$created_at}
\t
{$post->content}
HERE;
exit;
}
开发者ID:habari-extras,项目名称:plaintext,代码行数:31,代码来源:plaintext.plugin.php
示例5: formComponent
/**
* Form Component
*/
public static function formComponent()
{
$_templates = Themes::getTemplates();
foreach ($_templates as $template) {
$templates[basename($template, '.template.php')] = basename($template, '.template.php');
}
echo '<div class="col-xs-3">' . Form::open() . Form::hidden('csrf', Security::token()) . Form::label('sandbox_form_template', __('Sandbox template', 'sandbox')) . Form::select('sandbox_form_template', $templates, Option::get('sandbox_template'), array('class' => 'form-control')) . Html::br() . Form::submit('sandbox_component_save', __('Save', 'sandbox'), array('class' => 'btn btn-default')) . Form::close() . '</div>';
}
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:11,代码来源:sandbox.admin.php
示例6: action_init
public function action_init()
{
// gotta be an easier way of doing this
$theme_dir = Plugins::filter('admin_theme_dir', Site::get_dir('admin_theme', TRUE));
$theme = Themes::create('admin', 'RawPHPEngine', $theme_dir);
if (!$theme->template_exists('admincontrol_select')) {
$this->add_template('admincontrol_select', dirname(__FILE__) . '/admincontrol_select.php');
}
}
开发者ID:habari-extras,项目名称:projectr,代码行数:9,代码来源:projectr.plugin.php
示例7: sysReady
public static function sysReady()
{
if (Themes::getCurrentTheme()->hasInterface()) {
if (Themes::getCurrentTheme()->hasInterfaceName()) {
$name = Themes::getCurrentTheme()->getInterfaceName();
}
Admin::registerPage('theme-settings', $name ? $name : __('admin', 'theme-settings'), 'ThemeInterface::displayInterface', 2);
}
}
开发者ID:alecgorge,项目名称:TopHat,代码行数:9,代码来源:theme.php
示例8: themes
public function themes()
{
$available_themes = Themes::get_themes();
$active_theme = Setting::first()->theme;
if (empty($active_theme)) {
$active_theme = 'default';
}
$data = array('themes' => $available_themes, 'active_theme' => $active_theme);
return View::make('admin.sections.themes', $data);
}
开发者ID:phanhung0906,项目名称:demo1,代码行数:10,代码来源:AdminController.php
示例9: action_form_publish
/**
* Add the help to the publish form
*/
public function action_form_publish($form, $post)
{
$selector = $form->append('wrapper', 'help_container');
$selector->class = 'container';
$theme = Themes::create();
$theme->help = Options::get(strtolower(get_class($this)) . '__help');
$content = $theme->fetch('help');
$selector->append('static', 'help', $content);
$form->move_after($selector, $form->silos);
return $form;
}
开发者ID:habari-extras,项目名称:helpify,代码行数:14,代码来源:helpify.plugin.php
示例10: filter_post_content_out
function filter_post_content_out($content, $post)
{
if ($post->info->phpexec == 'true') {
$content = str_replace('<!--php', '<?php', $content);
$content = str_replace('?-->', '?>', $content);
ob_start();
$theme = Themes::create();
eval('?>' . $content . '<?php ');
$content = ob_get_clean();
}
return $content;
}
开发者ID:ringmaster,项目名称:phpexec,代码行数:12,代码来源:phpexec.plugin.php
示例11: actionSetDefault
public function actionSetDefault()
{
if (demo()) {
throw new CException(tc('Sorry, this action is not allowed on the demo server.'));
}
$id = (int) Yii::app()->request->getPost('id');
$model = Themes::model()->findByPk($id);
$model->setDefault();
// delete assets js cache
ConfigurationModel::clearGenerateJSAssets();
Yii::app()->end();
}
开发者ID:barricade86,项目名称:raui,代码行数:12,代码来源:MainController.php
示例12: ajax_tags
/**
* Handles AJAX from /admin/tags
* Used to delete and rename tags
*/
public function ajax_tags($handler_vars)
{
Utils::check_request_method(array('POST'));
$wsse = Utils::WSSE($handler_vars['nonce'], $handler_vars['timestamp']);
if ($handler_vars['digest'] != $wsse['digest']) {
Session::error(_t('WSSE authentication failed.'));
echo Session::messages_get(true, array('Format', 'json_messages'));
return;
}
$tag_names = array();
$theme_dir = Plugins::filter('admin_theme_dir', Site::get_dir('admin_theme', true));
$this->theme = Themes::create('admin', 'RawPHPEngine', $theme_dir);
$action = $this->handler_vars['action'];
switch ($action) {
case 'delete':
foreach ($_POST as $id => $delete) {
// skip POST elements which are not tag ids
if (preg_match('/^tag_\\d+/', $id) && $delete) {
$id = substr($id, 4);
$tag = Tags::get_by_id($id);
$tag_names[] = $tag->term_display;
Tags::vocabulary()->delete_term($tag);
}
}
$msg_status = _n(_t('Tag %s has been deleted.', array(implode('', $tag_names))), _t('%d tags have been deleted.', array(count($tag_names))), count($tag_names));
Session::notice($msg_status);
break;
case 'rename':
if (!isset($this->handler_vars['master'])) {
Session::error(_t('Error: New name not specified.'));
echo Session::messages_get(true, array('Format', 'json_messages'));
return;
}
$master = $this->handler_vars['master'];
$tag_names = array();
foreach ($_POST as $id => $rename) {
// skip POST elements which are not tag ids
if (preg_match('/^tag_\\d+/', $id) && $rename) {
$id = substr($id, 4);
$tag = Tags::get_by_id($id);
$tag_names[] = $tag->term_display;
}
}
Tags::vocabulary()->merge($master, $tag_names);
$msg_status = sprintf(_n('Tag %1$s has been renamed to %2$s.', 'Tags %1$s have been renamed to %2$s.', count($tag_names)), implode($tag_names, ', '), $master);
Session::notice($msg_status);
break;
}
$this->theme->tags = Tags::vocabulary()->get_tree();
$this->theme->max = Tags::vocabulary()->max_count();
echo json_encode(array('msg' => Session::messages_get(true, 'array'), 'tags' => $this->theme->fetch('tag_collection')));
}
开发者ID:ringmaster,项目名称:system,代码行数:56,代码来源:admintagshandler.php
示例13: index
public function index()
{
if (Input::method() == 'POST') {
if (Metadata::update()) {
return Response::redirect($this->admin_url . '/metadata');
}
}
// provide a list to set for our home page and posts page
$pages = Pages::list_all(array('status' => 'published'));
// list valid themes
$themes = Themes::list_all();
Template::render('metadata/index', array('pages' => $pages, 'themes' => $themes, 'metadata' => (object) Config::get('metadata')));
}
开发者ID:nathggns,项目名称:anchor-cms,代码行数:13,代码来源:metadata.php
示例14: create
public static function create($name, $initContents)
{
$p = self::$plugin;
queue_css($p->pluginPublicDir() . 'elrte/css/smoothness/jquery-ui-1.8.13.custom.css');
queue_css($p->pluginPublicDir() . 'elrte/css/elrte.min.css');
queue_css($p->pluginPublicDir() . 'elfinder/css/elfinder.min.css');
queue_css($p->pluginPublicDir() . 'elfinder/css/theme.css');
queue_js($p->pluginPublicDir() . 'elrte/js/jquery-ui-1.8.13.custom.min.js');
queue_js($p->pluginPublicDir() . 'elrte/js/elrte.full.js');
queue_js($p->pluginPublicDir() . 'elfinder/js/elfinder.full.js');
queue_js($p->pluginPublicDir() . 'elrte/js/i18n/elrte.en.js');
return sprintf(<<<EOT
<script type="text/javascript" charset="utf-8">
\t\$(function() {
\t\tvar opts = {
\t\t\tlang : 'en', // set your language
\t\t\tstyleWithCSS : false,
\t\t\theight : 400,
\t\t\ttoolbar : 'maxi',
\t\t\tcssfiles : ['%s'],
\t\t\tfmOpen : function(callback) {
\t\t\t\t\$('<div />').dialogelfinder({
\t\t\t\t\turl : '%selfinder/php/connector.php',
\t\t\t\t\tlang : 'en',
\t\t\t\t\tcommandsOptions : {
\t\t\t\t\t\tgetfile : {
\t\t\t\t\t\t\tonlyURL : true, // disable to return detail info
\t\t\t\t\t\t\tmultiple : false, // disable to return multiple files info
\t\t\t\t\t\t\tfolders : false, // disable to return folders info
\t\t\t\t\t\t\toncomplete : 'destroy' // action after callback (""/"close"/"destroy")
\t\t\t\t\t\t}
\t\t\t\t\t},
\t\t\t\t\tgetFileCallback : function (obj) {
\t\t\t\t\t\tcallback(obj.baseUrl + obj.path.substr(obj.path.replace('\\\\', '/').indexOf('/')+1));
\t\t\t\t\t}
\t\t\t\t})
\t\t\t}
\t\t};
\t\t// create editor
\t\t\$('#%s').elrte(opts);
\t\t// or this way
\t\t// var editor = new elRTE(document.getElementById('our-element'), opts);
\t});
</script>
<textarea id="%s">%s</textarea>
EOT
, Themes::getCurrentTheme()->getPublicPath() . "editor.css", $p->pluginPublicDir(), $name, $name, $initContents);
}
开发者ID:alecgorge,项目名称:TopHat,代码行数:49,代码来源:plugin.php
示例15: indexAction
public function indexAction()
{
// Get the user properties
$values = $this->_properties->getProperties(array("title", "subtitle", "background_image", "header_image", "theme", "css_enabled", "css_content", "has_colors"));
$colors = $this->_properties->getProperties(array("color_title", "color_subtitle", "color_sidebar_border", "color_background", "color_link", "color_sidebar_text", "color_sidebar_header"));
// Get the form and assign the values
$form = $this->getForm();
$form->populate($values);
$this->view->form = $form;
// Get the color form
$form = $this->getFormColors();
$this->view->formtheme = $form;
// Get the css form
$form = $this->getFormCss();
$form->populate($values);
$this->view->formcss = $form;
// Do we have a background image ?
if (isset($values['background_image'])) {
$this->view->background_image = $values['background_image'];
}
// Do we have a header image ?
if (isset($values['header_image'])) {
$this->view->header_image = $values['header_image'];
}
// Get available themes
$this->view->themes = Themes::getAvailableThemes();
$this->view->theme = $this->_properties->getProperty('theme');
// Custom css & colors
$this->view->css_enabled = $values['css_enabled'];
$this->view->css_content = $values['css_content'];
$this->view->colors = $colors;
$this->view->has_colors = $values['has_colors'];
$this->view->onload = "onDesignLoad();";
// Get errror and status messages
$this->view->status_messages = $this->getStatusMessages();
$this->view->error_messages = $this->getErrorMessages();
// Common view elements
$this->common();
// Specific scripts
$this->view->headScript()->appendFile('js/tab/tab.js');
$this->view->headScript()->appendFile('js/yahoo/yahoo.color.js');
$this->view->headScript()->appendFile('js/colorpicker/colorpicker.js');
$this->view->headScript()->appendFile('js/controllers/design.js');
// Specific CSS
$this->view->headLink()->appendStylesheet('style/colorpicker.css');
}
开发者ID:kreativmind,项目名称:storytlr,代码行数:46,代码来源:DesignController.php
示例16: __construct
/**
* Constructor for theme
*
* If no parameter is supplied, then the constructor
* Loads the active theme from the database.
*
* If no theme option is set, a fatal error is thrown
*
* @param name ( optional ) override the default theme lookup
* @param template_engine ( optional ) specify a template engine
* @param theme_dir ( optional ) specify a theme directory
*/
public function __construct( $themedata )
{
$this->name = $themedata->name;
$this->version = $themedata->version;
$theme_dir = Utils::single_array($themedata->theme_dir);
// Set up the corresponding engine to handle the templating
$this->template_engine = new $themedata->template_engine();
if(isset($themedata->parent)) {
$parent = Themes::create($themedata->parent);
$parent_theme_dir = Utils::single_array($parent->theme_dir);
$theme_dir = array_merge($theme_dir, $parent_theme_dir);
}
$this->theme_dir = $theme_dir;
$this->template_engine->set_template_dir( $theme_dir );
$this->plugin_id = $this->plugin_id();
$this->load();
}
开发者ID:rynodivino,项目名称:system,代码行数:30,代码来源:theme.php
示例17: registerMainAssets
public static function registerMainAssets()
{
$cs = Yii::app()->clientScript;
//$cs->coreScriptPosition = CClientScript::POS_BEGIN;
$baseThemeUrl = Yii::app()->theme->baseUrl;
$cs->registerCoreScript('jquery');
$cs->registerCoreScript('jquery.ui');
$cs->registerCoreScript('rating');
$cs->registerCssFile($baseThemeUrl . '/css/ui/jquery-ui.multiselect.css');
$cs->registerCssFile($baseThemeUrl . '/css/redmond/jquery-ui-1.7.1.custom.css');
$cs->registerCssFile($baseThemeUrl . '/css/ui.slider.extras.css');
$cs->registerScriptFile($baseThemeUrl . '/js/jquery.multiselect.min.js', CClientScript::POS_BEGIN);
$cs->registerCssFile($baseThemeUrl . '/css/ui/jquery-ui.multiselect.css');
$cs->registerScriptFile($baseThemeUrl . '/js/jquery.dropdownPlain.js', CClientScript::POS_BEGIN);
$cs->registerScriptFile($baseThemeUrl . '/js/common.js', CClientScript::POS_BEGIN);
$cs->registerScriptFile($baseThemeUrl . '/js/habra_alert.js', CClientScript::POS_END);
$cs->registerScriptFile($baseThemeUrl . '/js/jquery.cookie.js', CClientScript::POS_END);
$cs->registerScriptFile($baseThemeUrl . '/js/scrollto.js', CClientScript::POS_END);
$cs->registerCssFile($baseThemeUrl . '/css/form.css', 'screen, projection');
// superfish menu
$cs->registerCssFile($baseThemeUrl . '/js/superfish/css/superfish.css', 'screen');
$cs->registerScriptFile($baseThemeUrl . '/js/superfish/js/superfish.js', CClientScript::POS_END);
if (Yii::app()->theme->name == 'atlas') {
$cs->registerCssFile($baseThemeUrl . '/css/rating/rating.css');
$colorTheme = Themes::getParam('color_theme');
if ($colorTheme) {
$cs->registerCssFile($baseThemeUrl . '/css/colors/' . $colorTheme);
}
$cs->registerScriptFile($baseThemeUrl . '/js/jquery.easing.1.3.js', CClientScript::POS_BEGIN);
$cs->registerScript('initizlize-superfish-menu', '
$("#sf-menu-id").superfish( {hoverClass: "sfHover", delay: 100, animationOut: {opacity:"hide"}, animation: {opacity:"show"}, cssArrows: false, dropShadows: false, speed: "fast", speedOut: 1 });
', CClientScript::POS_READY);
}
//deb(Yii::app()->theme->name); exit;
if (Yii::app()->theme->name == 'classic') {
$cs->registerCssFile($cs->getCoreScriptUrl() . '/rating/jquery.rating.css');
$cs->registerCssFile($baseThemeUrl . '/js/superfish/css/superfish-vertical.css', 'screen');
$cs->registerScriptFile($baseThemeUrl . '/js/superfish/js/hoverIntent.js', CClientScript::POS_HEAD);
$cs->registerScript('initizlize-superfish-menu', '
$("#sf-menu-id").superfish( {delay: 100, autoArrows: false, dropShadows: false, pathClass: "overideThisToUse", speed: "fast" });
', CClientScript::POS_READY);
}
}
开发者ID:barricade86,项目名称:raui,代码行数:43,代码来源:HSite.php
示例18: activate
function activate($themeid)
{
$theme = Themes::find($themeid);
if ($theme->active) {
return Redirect::to('themes/manage')->withMessage($this->notifyView(Lang::get('messages.no_change'), 'warning'));
} else {
$themes = Themes::all();
foreach ($themes as $atheme) {
if ($atheme->id != $theme->id) {
$atheme->active = 0;
$atheme->save();
} else {
Event::fire('backend.themes.activate', array($atheme));
$atheme->active = 1;
$atheme->save();
}
}
}
return Redirect::to('themes/manage')->withMessage($this->notifyView(Lang::get('messages.theme_activated')));
}
开发者ID:basdog22,项目名称:laracms,代码行数:20,代码来源:ThemesController.php
示例19: configure
function configure()
{
$ui = new FormUI('jsmincdn');
$scripts = $ui->append('checkboxes', 'scripts', 'jsmincdn__storage', 'Select the scripts that should be served as minimized.');
$theme = Themes::create();
Plugins::act('template_header', $theme);
Plugins::act('template_footer', $theme);
$options = Stack::get_named_stack('template_header_javascript');
$options = array_merge($options, Stack::get_named_stack('template_footer_javascript'));
$options_out = array();
foreach ($options as $option => $value) {
if (preg_match('#[a-f0-9]{32}#', $option)) {
$value = htmlspecialchars(substr($value, 0, 80));
} else {
$value = $option;
}
$options_out[$option] = $value;
}
$scripts->options = $options_out;
$ui->append('submit', 'submit', 'Submit');
return $ui;
}
开发者ID:habari-extras,项目名称:jsmincdn,代码行数:22,代码来源:jsmincdn.plugin.php
示例20: ajax_dashboard
/**
* Handles AJAX requests from the dashboard
*/
public function ajax_dashboard($handler_vars)
{
Utils::check_request_method(array('POST'));
$theme_dir = Plugins::filter('admin_theme_dir', Site::get_dir('admin_theme', true));
$this->theme = Themes::create('admin', 'RawPHPEngine', $theme_dir);
switch ($handler_vars['action']) {
case 'updateModules':
$modules = array();
foreach ($_POST as $key => $module) {
// skip POST elements which are not module names
if (preg_match('/^module\\d+$/', $key)) {
list($module_id, $module_name) = explode(':', $module, 2);
// remove non-sortable modules from the list
if ($module_id != 'nosort') {
$modules[$module_id] = $module_name;
}
}
}
Modules::set_active($modules);
$ar = new AjaxResponse(200, _t('Modules updated.'));
break;
case 'addModule':
$id = Modules::add($handler_vars['module_name']);
$this->fetch_dashboard_modules();
$ar = new AjaxResponse(200, _t('Added module %s.', array($handler_vars['module_name'])));
$ar->html('modules', $this->theme->fetch('dashboard_modules'));
break;
case 'removeModule':
Modules::remove($handler_vars['moduleid']);
$this->fetch_dashboard_modules();
$ar = new AjaxResponse(200, _t('Removed module.'));
$ar->html('modules', $this->theme->fetch('dashboard_modules'));
break;
}
$ar->out();
}
开发者ID:ringmaster,项目名称:system,代码行数:39,代码来源:admindashboardhandler.php
注:本文中的Themes类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论