本文整理汇总了PHP中Theme类的典型用法代码示例。如果您正苦于以下问题:PHP Theme类的具体用法?PHP Theme怎么用?PHP Theme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Theme类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: create
/**
* {@inheritdoc}
*
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
public function create($themeName, array $themeDefinition)
{
$theme = new Theme($themeName, isset($themeDefinition['parent']) ? $themeDefinition['parent'] : null);
if (isset($themeDefinition['label'])) {
$theme->setLabel($themeDefinition['label']);
}
if (isset($themeDefinition['screenshot'])) {
$theme->setScreenshot($themeDefinition['screenshot']);
}
if (isset($themeDefinition['icon'])) {
$theme->setIcon($themeDefinition['icon']);
}
if (isset($themeDefinition['logo'])) {
$theme->setLogo($themeDefinition['logo']);
}
if (isset($themeDefinition['directory'])) {
$theme->setDirectory($themeDefinition['directory']);
}
if (isset($themeDefinition['groups'])) {
$theme->setGroups((array) $themeDefinition['groups']);
}
if (isset($themeDefinition['description'])) {
$theme->setDescription($themeDefinition['description']);
}
if (isset($themeDefinition['data'])) {
$theme->setData($themeDefinition['data']);
}
return $theme;
}
开发者ID:ramunasd,项目名称:platform,代码行数:34,代码来源:ThemeFactory.php
示例2: send_form_test
function send_form_test()
{
$theme = new Theme();
$response = $theme->form_test();
echo json_encode($response);
exit;
}
开发者ID:milanezlucas,项目名称:move-it,代码行数:7,代码来源:ajax.php
示例3: form
public function form()
{
$text = new FormElement("textarea", "q_post");
$t = new Theme();
$text->addClasses("actualite_area_text");
return $t->process_form_elements($text);
}
开发者ID:decima,项目名称:M2-platine,代码行数:7,代码来源:QRender.php
示例4: price
public static function price($euro)
{
$theme = new Theme();
$theme->set_title("Convertion euro > franc");
$theme->add_to_body($euro * 6.55957);
$theme->process_theme(Theme::STRUCT_DEFAULT);
}
开发者ID:decima,项目名称:M2-platine,代码行数:7,代码来源:module.php
示例5: _load_themes
function _load_themes()
{
$this->themes = [];
$themes = glob("{$this->theme_dir}*.{{$this->theme_ext}}", GLOB_BRACE);
$p_exts = $this->theme_ext;
$p_exts = preg_split('/,/i', $p_exts);
foreach ($p_exts as &$ext) {
$ext = preg_quote('.' . trim($ext));
}
$p_exts = join('|', $p_exts);
foreach ($themes as $theme_dir) {
$theme = new Theme($theme_dir, $this->theme_file, ['class' => preg_replace('/([^\\/]+\\/(?=[^$])|(' . $p_exts . ')|\\/\\s?$)/i', '', $theme_dir) . "\\" . $this->theme_class]);
$this->themes[] = $theme;
}
foreach ($this->themes as $index => $theme) {
$result = $theme->init();
if (!$result) {
$this->themes[$index] = false;
}
}
$loaded = $this->themes;
$this->themes = [];
foreach ($loaded as $theme) {
if ($theme) {
$this->themes[] = $theme;
}
}
}
开发者ID:aravindanve,项目名称:batch-certificate-maker,代码行数:28,代码来源:themeloader.php
示例6: _
/**
* @param string $theme
* @param array $vars
*/
public static function _($theme, $vars = array())
{
$instance = new Theme();
foreach ($vars as $key => $value) {
$instance->set($key, $value);
}
$instance->dispatch($theme);
}
开发者ID:joksnet,项目名称:php-old,代码行数:12,代码来源:Theme.php
示例7: widget_menu_system
public function widget_menu_system()
{
$theme = new Theme();
$list = array();
$list[] = Theme::linking(Page::url("/admin/modules/"), t("<i class=\"fa fa-puzzle-piece fa-fw\"></i> Modules"));
$list[] = Theme::linking(Page::url("/admin/database/"), t("<i class=\"fa fa-database fa-fw\"></i> Base de données"));
return t("<div class=\"widget_titre\"><i class=\"fa fa-wrench fa-fw\"></i> Système</div>") . $theme->listing($list);
}
开发者ID:decima,项目名称:M2-platine,代码行数:8,代码来源:module.php
示例8: index
function index()
{
list($params, $id) = $this->parse_params(func_get_args());
$t = new Theme();
$final = $t->read();
$final = Shutter::filter('api.themes', array($final));
$this->set_response_data($final);
}
开发者ID:Atomox,项目名称:benhelmerphotography,代码行数:8,代码来源:themes.php
示例9: setCurrentTheme
public static function setCurrentTheme($x)
{
self::$set_theme = $x;
$theme = new Theme(self::$set_theme);
if ($theme->validate()) {
self::$curr_theme = $theme;
}
}
开发者ID:alecgorge,项目名称:TopHat,代码行数:8,代码来源:cc-themes.php
示例10: theme_linkoid
/**
* Respond to call to $theme->linkoid() in template
*
* @param string $return The return value to the template function (passed through other potential plugin calls)
* @param Theme $theme The theme object
* @param string $tag An optional tag to use instead of the one defined in the plugin options.
* @return string The return value to the template function
*/
public function theme_linkoid($theme, $tag = null)
{
if (!isset($tag)) {
$tag = Options::get('linkoid__show');
}
$linkoids = Posts::get(array('tag_slug' => $tag, 'limit' => Options::get('linkoid__count')));
$theme->linkoids = $linkoids;
return $theme->fetch('linkoid');
}
开发者ID:habari-extras,项目名称:linkoid,代码行数:17,代码来源:linkoid.plugin.php
示例11: exampleImageUrls
public function exampleImageUrls()
{
$layout = new ThemeLayout(1);
$template = new ThemeTemplate(1);
$theme = new Theme(1);
print_d($layout->getThemeConfig());
var_dump($theme->getPath());
var_dump($template->getImageUrl());
echo '<br>';
var_dump($layout->getImageUrl());
echo '<br>';
var_dump($theme->getImageUrl());
}
开发者ID:andrewkrug,项目名称:repucaution,代码行数:13,代码来源:test.php
示例12: page_permissions
public function page_permissions()
{
if (isset($_POST['save-permissions'])) {
PermissionObject::removeAllPermissions();
if (isset($_POST['permission'])) {
foreach ($_POST['permission'] as $perm => $groups) {
foreach ($groups as $grp => $d) {
PermissionObject::addPermission($grp, $perm);
}
}
}
Notification::statusNotify(t("configuration enregistrée"), Notification::STATUS_SUCCESS);
}
$defined_permissions = PermissionObject::loadAllPermissions();
$df = array();
foreach ($defined_permissions as $p) {
if (!isset($df[$p->pid])) {
$df[$p->pid] = array();
}
$df[$p->pid][$p->gid] = 1;
}
$p = new PermissionsManager();
$permissions = $p->scanForPermission();
$groups = GroupObject::loadAll();
$table = array();
$hcol = array("");
$hrow = array();
foreach ($permissions as $u => $t) {
$hrow[] = $t;
$row = array();
foreach ($groups as $gd => $g) {
if ($u == 0) {
$hcol[] = $g->label;
}
$pm = new PermissionObject();
$pm->loadByName($t);
$tlabel = "permission[" . $g->gid . "][" . $pm->pid . "]";
if (isset($df[$pm->pid][$g->gid])) {
$row[] = "<input type='checkbox' name='{$tlabel}' id='{$tlabel}' checked='checked'/>";
} else {
$row[] = "<input type='checkbox' name='{$tlabel}' id='{$tlabel}' />";
}
}
$table[] = $row;
}
$theme = new Theme();
$theme->set_title(t("Permissions déclarées"));
$table = Themed::tabling($table, $hcol, $hrow);
$theme->add_to_body("<form method='POST' action=''>{$table} <input type='submit' name='save-permissions' value='" . t("Enregistrer") . "'/></form>");
$theme->process_theme(Theme::STRUCT_ADMIN);
}
开发者ID:decima,项目名称:M2-platine,代码行数:51,代码来源:module.php
示例13: test_db_methods
function test_db_methods()
{
$theme = new Theme("Master", "And Servant");
$sp1 = new BackgroundColorSP("#FFFCF0");
$id1 = $theme->registerSP($sp1);
$sp2 = new ColorSP("#2E2B33");
$id2 = $theme->registerSP($sp2);
$sp3 = new FontSP("Verdana", "10pt");
$id3 = $theme->registerSP($sp3);
$this->manager->setTheme($theme);
$this->manager->saveTheme();
$id = $theme->getId();
$this->assertIsA($id, "HarmoniId");
$theme1 = new Theme("Master", "And Servant");
$sp1 = new BackgroundColorSP("#241");
$id1 = $theme1->registerSP($sp1);
$sp2 = new ColorSP("#325");
$id2 = $theme1->registerSP($sp2);
$sp3 = new FontSP("Arial", "9pt");
$id3 = $theme1->registerSP($sp3);
$this->manager->loadTheme($id);
$themea = $this->manager->getTheme();
$this->assertIdentical($theme, $themea);
/*** testing method replaceThemeState ***/
$theme2 = new Theme("Master", "And Servant");
$sp1 = new BackgroundColorSP("#241");
$id1 = $theme2->registerSP($sp1);
$sp2 = new ColorSP("#325");
$id2 = $theme2->registerSP($sp2);
$sp3 = new FontSP("Arial", "9pt");
$id3 = $theme2->registerSP($sp3);
$this->manager->saveTheme($id, $theme2);
$this->manager->loadTheme($id, $theme1);
$this->assertIdentical($theme2, $theme1);
/*** testing method deleteThemeState ***/
$dbHandler =& Services::getService("DatabaseManager");
$dbIndex = $dbHandler->addDatabase(new MySQLDatabase("devo", "doboHarmoniTest", "test", "test"));
$dbHandler->connect($dbIndex);
$this->manager->deleteTheme($id);
$idValue = $id->getIdString();
$query = new SelectQuery();
$query->addColumn("gui_theme");
$query->addColumn("gui_state");
$query->addTable("gui");
$query->addWhere("gui_id = " . $idValue);
$queryResult = $dbHandler->query($query, $dbIndex);
$affectedRows = $queryResult->getNumberOfRows();
$this->assertIdentical($affectedRows, 0);
$queryResult->free();
}
开发者ID:adamfranco,项目名称:harmoni,代码行数:50,代码来源:GUIManagerTestCase.class.php
示例14: getStyleConfig
public function getStyleConfig()
{
$conf = array();
foreach ($this->getAllParentThemes() as $theme) {
$inst = new Theme($theme, $this->application);
$conf = $this->array_merge_recursive_distinct($conf, $inst->getStyleConfig());
}
$path = $this->application->getRenderer()->getTemplatePath('theme/' . $this->name . '/.theme/style.ini');
if ($path) {
//$conf = $this->array_merge_recursive_distinct($conf, parse_ini_file($path, true));
$conf = parse_ini_file($path, true);
}
return $conf;
}
开发者ID:saiber,项目名称:livecart,代码行数:14,代码来源:Theme.php
示例15: on_get
private function on_get()
{
$response = [];
foreach (['langs', 'options', 'types'] as $name) {
if ($this->request->query_boolean($name, false)) {
$methodname = 'get_' . $name;
$response[$name] = $this->context->{$methodname}();
}
}
if ($this->request->query_boolean('setup', false)) {
$response['setup'] = $this->setup->to_jsono($this->context->is_admin());
}
if ($this->request->query_boolean('theme', false)) {
$theme = new Theme($this->context);
$response['theme'] = $theme->get_icons();
}
if ($this->request->query('items', false)) {
$href = $this->request->query('items.href');
$what = $this->request->query_numeric('items.what');
$response['items'] = $this->context->get_items($href, $what);
}
if ($this->request->query('custom', false)) {
Util::json_fail(Util::ERR_DISABLED, 'custom disabled', !$this->context->query_option('custom.enabled', false));
$href = $this->request->query('custom');
$custom = new Custom($this->context);
$response['custom'] = $custom->get_customizations($href);
}
if ($this->request->query('l10n', false)) {
Util::json_fail(Util::ERR_DISABLED, 'l10n disabled', !$this->context->query_option('l10n.enabled', false));
$iso_codes = $this->request->query_array('l10n');
$iso_codes = array_filter($iso_codes);
$response['l10n'] = $this->context->get_l10n($iso_codes);
}
if ($this->request->query('search', false)) {
Util::json_fail(Util::ERR_DISABLED, 'search disabled', !$this->context->query_option('search.enabled', false));
$href = $this->request->query('search.href');
$pattern = $this->request->query('search.pattern');
$search = new Search($this->context);
$response['search'] = $search->get_items($href, $pattern);
}
if ($this->request->query('thumbs', false)) {
Util::json_fail(Util::ERR_DISABLED, 'thumbnails disabled', !$this->context->query_option('thumbnails.enabled', false));
Util::json_fail(Util::ERR_UNSUPPORTED, 'thumbnails not supported', !$this->setup->get('HAS_PHP_JPEG'));
$thumbs = $this->request->query_array('thumbs');
$response['thumbs'] = $this->context->get_thumbs($thumbs);
}
Util::json_exit($response);
}
开发者ID:Txuritan,项目名称:h5ai,代码行数:48,代码来源:class-api.php
示例16: __call
/**
* Displays all controllers from the layout map, categories
* by which sector they are in.
*
* @param string $name
* @param array $args
* @return mixed
*/
public function __call($name, $args)
{
$this->setOutputType(self::_OT_CONFIG);
if (!$this->_acl->check('content_layout_config_module')) {
throw new Module_NoPermission();
}
$layoutName = substr($name, 0, -7);
$siteType = substr($layoutName, 0, strpos($layoutName, '-'));
if (empty($layoutName) || !$this->_router->siteTypeExists($siteType)) {
$this->_event->error(t('Unable to manage content layout, invalid name given'));
return zula_redirect($this->_router->makeUrl('content_layout'));
}
$this->setTitle(sprintf(t('"%s" content layout'), $layoutName));
$this->setOutputType(self::_OT_CONFIG);
// Create the new content layout object
$layout = new Layout($layoutName);
if (!$layout->exists()) {
$this->_event->error(t('Provided layout does not exist'));
return zula_redirect($this->_router->makeUrl('content_layout'));
}
// Build view form with validation for the regex (for layout)
$form = new View_form('manage/main.html', 'content_layout');
$form->caseSensitive();
$form->action($this->_router->makeUrl('content_layout', 'manage', $layoutName));
$form->addElement('content_layout/regex', $layout->getRegex(), t('URL/Regex'), new Validator_Length(2, 255));
if ($form->hasInput() && $form->isValid()) {
$layout->setRegex($form->getValues('content_layout/regex'));
if ($layout->save()) {
$this->_event->success(t('Updated content layout'));
return zula_redirect($this->_router->makeUrl('content_layout', 'manage', $layoutName));
}
$this->_event->error(t('Unable to save content layout'));
}
/**
* Gather all controllers in the layout for the theme of the site type
* this layout is for.
*/
$theme = new Theme($this->_config->get('theme/' . $siteType . '_default'));
$themeSectors = array();
foreach ($theme->getSectors() as $sector) {
$themeSectors[$sector['id']] = array('sector' => $sector, 'cntrlrs' => $layout->getControllers($sector['id']));
}
// Assign additional data
$form->assign(array('layoutName' => $layout->getName(), 'themeSectors' => $themeSectors));
$this->_theme->addJsFile('jQuery/plugins/dnd.js');
$this->addAsset('js/dnd_order.js');
return $form->getOutput();
}
开发者ID:jinshana,项目名称:tangocms,代码行数:56,代码来源:manage.php
示例17: make
/**
* Display the tab
*
* @param array $data The data to inject in the view
*
* @return string The generated HTML
*/
public static function make($data)
{
if (is_array($data['page']) && isset($data['page']['content'])) {
$data['page'] = $data['page']['content'];
}
return parent::make(Theme::getSelected()->getView('tabs-layout/tabs-no-sidebar.tpl'), $data);
}
开发者ID:elvyrra,项目名称:hawk,代码行数:14,代码来源:NoSidebarTab.php
示例18: getIndex
public function getIndex()
{
$theme = Theme::uses('notebook')->layout('blue');
$theme->setMenu('reference.index');
$params = array();
return $theme->scope('reference.index', $params)->render();
}
开发者ID:marwanxx,项目名称:solatjakim-api-site,代码行数:7,代码来源:ReferenceController.php
示例19: displayPage
function displayPage()
{
Theme::Set('version', VERSION);
Theme::Set('text', Theme::RenderReturn('about_text'));
// Render the Theme and output
Theme::Render('about_page');
}
开发者ID:fignew,项目名称:xibo-cms,代码行数:7,代码来源:license.class.php
示例20: array
/**
* Shiv IE, add the stylesheet
* @param Theme $theme
*/
function action_template_header($theme)
{
// Add the HTML5 shiv for IE < 9
Stack::add('template_header_javascript', array('http://cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.js', null, '<!--[if lt IE 9]>%s<![endif]-->'), 'html5_shiv');
// Add this line to your config.php to show an error and a notice, and
// to process the raw LESS code via javascript instead of the rendered CSS: define('DEBUG_THEME', 1);
if (defined('DEBUG_THEME')) {
// Session::error('This is a <b>sample error</b>');
// Session::notice('This is a <b>sample notice</b> for ' . $_SERVER['REQUEST_URI']);
Stack::add('template_header_javascript', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', 'jquery');
Stack::add('template_header_javascript', $theme->get_url('/less/less-1.3.0.min.js'), 'less');
Stack::add('template_stylesheet', array($theme->get_url('/less/style.less'), null, array('type' => null, 'rel' => 'stylesheet/less')), 'style');
} else {
Stack::add('template_stylesheet', $theme->get_url('/css/style.css'), 'style');
}
}
开发者ID:ringmaster,项目名称:heavy,代码行数:20,代码来源:theme.php
注:本文中的Theme类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论