• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Skin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: makeWlhLink

 /**
  * Make a "what links here" link for a given title
  *
  * @param Title $title Title to make the link for
  * @param Skin $skin Skin to use
  * @param object $result Result row
  * @return string
  */
 private function makeWlhLink($title, $skin, $result)
 {
     global $wgLang;
     $wlh = SpecialPage::getTitleFor('Whatlinkshere');
     $label = wfMsgExt('nlinks', array('parsemag', 'escape'), $wgLang->formatNum($result->value));
     return $skin->link($wlh, $label, array(), array('target' => $title->getPrefixedText()));
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:15,代码来源:SpecialWantedtemplates.php


示例2: onBeforePageDisplay

 public static function onBeforePageDisplay(\OutputPage &$output, \Skin &$skin)
 {
     $title = $output->getTitle();
     // Disallow commenting on pages without article id
     if ($title->getArticleID() == 0) {
         return true;
     }
     if ($title->isSpecialPage()) {
         return true;
     }
     // These could be explicitly allowed in later version
     if (!$title->canTalk()) {
         return true;
     }
     if ($title->isTalkPage()) {
         return true;
     }
     if ($title->isMainPage()) {
         return true;
     }
     // Do not display when printing
     if ($output->isPrintable()) {
         return true;
     }
     // Disable if not viewing
     if ($skin->getRequest()->getVal('action', 'view') != 'view') {
         return true;
     }
     // Blacklist several namespace
     if (in_array($title->getNamespace(), array(NS_MEDIAWIKI, NS_TEMPLATE, NS_CATEGORY, NS_FILE, NS_USER))) {
         return true;
     }
     $output->addModules('ext.pagerating');
     return true;
 }
开发者ID:nbdd0121,项目名称:MW-PageRating,代码行数:35,代码来源:Hooks.php


示例3: deletefontform_submit

function deletefontform_submit(Pieform $form, $values)
{
    global $SESSION;
    $fontname = $values['font'];
    $result = delete_records('skin_fonts', 'name', $fontname);
    if ($result == false) {
        $SESSION->add_error_msg(get_string('cantdeletefont', 'skin'));
    } else {
        // Check to see if the font is being used in a skin. If it is remove it from
        // the skin's viewskin data
        $skins = get_records_array('skin');
        if (is_array($skins)) {
            foreach ($skins as $skin) {
                $options = unserialize($skin->viewskin);
                foreach ($options as $key => $option) {
                    if (preg_match('/font_family/', $key) && $option == $fontname) {
                        require_once get_config('docroot') . 'lib/skin.php';
                        $skinobj = new Skin($skin->id);
                        $viewskin = $skinobj->get('viewskin');
                        $viewskin[$key] = 'Arial';
                        // the default font
                        $skinobj->set('viewskin', $viewskin);
                        $skinobj->commit();
                    }
                }
            }
        }
        // Also delete all the files in the appropriate folder and the folder itself...
        $fontpath = get_config('dataroot') . 'skins/fonts/' . $fontname;
        recurse_remove_dir($fontpath);
        $SESSION->add_ok_msg(get_string('fontdeleted', 'skin'));
    }
    redirect('/admin/site/fonts.php');
}
开发者ID:patkira,项目名称:mahara,代码行数:34,代码来源:delete.php


示例4: onSkinAfterBottomScripts

    public static function onSkinAfterBottomScripts(Skin $skin, &$text)
    {
        global $wgWRGoogleSearchEnableSitelinksSearch, $wgWRGoogleSearchCSEID;
        if (!$wgWRGoogleSearchEnableSitelinksSearch || empty($wgWRGoogleSearchCSEID) || !$skin->getTitle()->isMainPage()) {
            return true;
        }
        $mainPageUrl = Title::newFromText(wfMessage('mainpage')->plain())->getFullURL();
        $searchUrl = SpecialPage::getTitleFor('WRGoogleSearch')->getFullURL();
        $sitelinksSearch = <<<HTML

\t<script type="application/ld+json">
\t\t{
\t\t\t"@context": "http://schema.org",
\t  \t\t"@type": "WebSite",
\t\t\t"url": "{$mainPageUrl}",
\t\t\t"potentialAction": {
\t\t\t\t"@type": "SearchAction",
\t\t\t    "target": "{$searchUrl}?q={search_term_string}",
\t\t\t    "query-input": "required name=search_term_string"
\t  \t\t}
\t\t}
\t</script>

HTML;
        $text .= $sitelinksSearch;
        return true;
    }
开发者ID:kolzchut,项目名称:mediawiki-extensions-WRGoogleSearch,代码行数:27,代码来源:WRGoogleSearch.php


示例5: getFbPixelScript

    private static function getFbPixelScript(Skin $skin)
    {
        global $egFacebookConversionPixelId;
        if (empty($egFacebookConversionPixelId)) {
            throw new MWException("You must set \$egFacebookConversionPixelId to the Pixel ID supplied by Facebook");
        }
        if ($skin->getUser()->isAllowed('noanalytics')) {
            return "\n<!-- Facebook Conversion Pixel tracking is disabled for this user -->\n";
        }
        $script = <<<SCRIPT
‪<script>(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = '//connect.facebook.net/en_US/fbds.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  }
  _fbq.push(['addPixelId', '{$egFacebookConversionPixelId}']);
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', 'PixelInitialized', {}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?id={$egFacebookConversionPixelId}&amp;ev=PixelInitialized" /></noscript>‬
SCRIPT;
        return $script;
    }
开发者ID:kolzchut,项目名称:mediawiki-extensions-FacebookConversionPixel,代码行数:29,代码来源:FacebookConversionPixel.hooks.php


示例6: initializeSkins

 public static function initializeSkins()
 {
     Doctrine::getTable('Location')->getRecordListener()->get('MultiTenant')->setOption('disabled', true);
     Doctrine::getTable('User')->getRecordListener()->get('MultiTenant')->setOption('disabled', true);
     // Install stock Bluebox skin
     $skin = new Skin();
     $skin->name = 'Bluebox';
     $skin->location = 'skins/bluebox';
     $skin->default = TRUE;
     $skin->save();
     // Map all sites with no skin assigned to this default skin
     $sites = Doctrine::getTable('Site')->findAll();
     if ($sites) {
         foreach ($sites as $site) {
             if ($site->skin_id == NULL) {
                 $site->skin_id = $skin->skin_id;
                 $site->save();
                 $site->free(TRUE);
             }
         }
     }
     $skin->free(TRUE);
     Doctrine::getTable('Location')->getRecordListener()->get('MultiTenant')->setOption('disabled', FALSE);
     Doctrine::getTable('User')->getRecordListener()->get('MultiTenant')->setOption('disabled', FALSE);
 }
开发者ID:swk,项目名称:bluebox,代码行数:25,代码来源:configure.php


示例7: onSkinBuildSidebar

 public static function onSkinBuildSidebar(\Skin $skin, &$bar)
 {
     $relevUser = $skin->getRelevantUser();
     if ($relevUser) {
         $bar['sidebar-section-extension'][] = array('text' => wfMsg('sidebar-viewavatar'), 'href' => \SpecialPage::getTitleFor('ViewAvatar')->getLocalURL(array('user' => $relevUser->getName())), 'id' => 'n-viewavatar', 'active' => '');
     }
     return true;
 }
开发者ID:zoglun,项目名称:MW-Avatar,代码行数:8,代码来源:Hooks.php


示例8: onSkinAfterBottomScripts

 /**
  * @brief Adds Wall Notifications script to Monobook pages
  *
  * @return boolean
  *
  * @author Liz Lee
  */
 public static function onSkinAfterBottomScripts(Skin $skin, &$text)
 {
     global $wgUser, $wgJsMimeType, $wgResourceBasePath, $wgExtensionsPath;
     if ($wgUser instanceof User && $wgUser->isLoggedIn() && $skin->getSkinName() == 'monobook') {
         $text .= "<script type=\"{$wgJsMimeType}\" src=\"{$wgResourceBasePath}/resources/wikia/libraries/jquery/timeago/jquery.timeago.js\"></script>\n" . "<script type=\"{$wgJsMimeType}\" src=\"{$wgExtensionsPath}/wikia/WallNotifications/scripts/WallNotifications.js\"></script>\n";
     }
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:15,代码来源:WallNotificationsHooksHelper.class.php


示例9: onSkinAfterBottomScripts

 /**
  * @brief Adds Wall Notifications script to Monobook pages
  *
  * @return boolean
  *
  * @author Liz Lee
  */
 public function onSkinAfterBottomScripts(Skin $skin, &$text)
 {
     $app = F::App();
     $user = $app->wg->User;
     if ($user instanceof User && $user->isLoggedIn() && $skin->getSkinName() == 'monobook') {
         $text .= "<script type=\"{$app->wg->JsMimeType}\" src=\"{$app->wg->ResourceBasePath}/resources/wikia/libraries/jquery/timeago/jquery.timeago.js\"></script>\n" . "<script type=\"{$app->wg->JsMimeType}\" src=\"{$app->wg->ExtensionsPath}/wikia/Wall/js/WallNotifications.js\"></script>\n";
     }
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:16,代码来源:WallNotificationsHooksHelper.class.php


示例10: fnSetOutput

 public static function fnSetOutput(OutputPage &$out, Skin &$skin)
 {
     global $wpdBundle;
     $page_path = explode('/', $skin->getTitle());
     for ($pp = 1; count($page_path) >= $pp; $pp++) {
         $path_part = implode('/', array_slice($page_path, 0, $pp));
         self::$menuhtml .= '<li data-comment="Not removing underscore here"><a href="' . $wpdBundle['root_uri'] . str_replace(' ', '_', $path_part) . '">' . str_replace('_', ' ', $page_path[$pp - 1]) . '</a></li>';
     }
     return true;
 }
开发者ID:renoirb,项目名称:mediawiki-1,代码行数:10,代码来源:BreadcrumbMenu.php


示例11: createMenu

 /**
  * Hook function to draw the wenu
  */
 static function createMenu(Skin $skin, &$bar)
 {
     global $dsmDebug;
     $menu = new DynamicSidebarMenu($skin->getRelevantTitle());
     $options = array("parent" => "/");
     $menu->options($options);
     $text = $menu->render();
     $bar["DynamicSidebarMenu"] = "<div id=\"DSM\">{$text}</div>";
     return true;
 }
开发者ID:valsr,项目名称:DynamicSidebarMetu,代码行数:13,代码来源:DynamicSidebarMenu.php


示例12: onSkinAfterBottomScripts

 public static function onSkinAfterBottomScripts(Skin $skin, &$text)
 {
     $title = $skin->getTitle();
     if (TemplateDraftHelper::allowedForTitle($title)) {
         $scripts = AssetsManager::getInstance()->getURL('template_draft');
         foreach ($scripts as $script) {
             $text .= Html::linkedScript($script);
         }
     }
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:11,代码来源:TemplateDraftHooks.class.php


示例13: get_stylesheets_for_current_page

/**
 * Helper function (called by smarty()) to determine what stylesheets to include
 * on the page (based on constants, global variables, and $extraconfig)
 *
 * @param $stylesheets Stylesheets we already know we're going to need
 * @param $extraconfig Extra configuration passed to smarty()
 * @return array
 */
function get_stylesheets_for_current_page($stylesheets, $extraconfig)
{
    global $USER, $SESSION, $THEME, $HEADDATA, $langselectform;
    // stylesheet set up - if we're in a plugin also get its stylesheet
    $allstylesheets = $THEME->get_url('style/style.css', true);
    // determine if we want to include the parent css
    if (isset($THEME->overrideparentcss) && $THEME->overrideparentcss && $THEME->parent) {
        unset($allstylesheets[$THEME->parent]);
    }
    $stylesheets = array_merge($stylesheets, array_reverse(array_values($allstylesheets)));
    if (defined('SECTION_PLUGINTYPE') && defined('SECTION_PLUGINNAME') && SECTION_PLUGINTYPE != 'core') {
        if ($pluginsheets = $THEME->get_url('style/style.css', true, SECTION_PLUGINTYPE . '/' . SECTION_PLUGINNAME)) {
            $stylesheets = array_merge($stylesheets, array_reverse($pluginsheets));
        }
    }
    if ($adminsection = in_admin_section()) {
        if ($adminsheets = $THEME->get_url('style/admin.css', true)) {
            $stylesheets = array_merge($stylesheets, array_reverse($adminsheets));
        }
    }
    if (get_config('developermode') & DEVMODE_DEBUGCSS) {
        $stylesheets[] = get_config('wwwroot') . 'theme/debug.css';
    }
    // look for extra stylesheets
    if (isset($extraconfig['stylesheets']) && is_array($extraconfig['stylesheets'])) {
        foreach ($extraconfig['stylesheets'] as $extrasheet) {
            if ($sheets = $THEME->get_url($extrasheet, true)) {
                $stylesheets = array_merge($stylesheets, array_reverse(array_values($sheets)));
            }
        }
    }
    if ($sheets = $THEME->additional_stylesheets()) {
        $stylesheets = array_merge($stylesheets, $sheets);
    }
    // Give the skin a chance to affect the page
    if (!empty($extraconfig['skin'])) {
        require_once get_config('docroot') . '/lib/skin.php';
        $skinobj = new Skin($extraconfig['skin']['skinid']);
        $viewid = isset($extraconfig['skin']['viewid']) ? $extraconfig['skin']['viewid'] : null;
        $stylesheets = array_merge($stylesheets, $skinobj->get_stylesheets($viewid));
    }
    $langdirection = get_string('thisdirection', 'langconfig');
    // Include rtl.css for right-to-left langs
    if ($langdirection == 'rtl') {
        $smarty->assign('LANGDIRECTION', 'rtl');
        if ($rtlsheets = $THEME->get_url('style/rtl.css', true)) {
            $stylesheets = array_merge($stylesheets, array_reverse($rtlsheets));
        }
    }
    $stylesheets = append_version_number($stylesheets);
    return $stylesheets;
}
开发者ID:sarahjcotton,项目名称:mahara,代码行数:60,代码来源:web.php


示例14: deleteskin_submit

function deleteskin_submit(Pieform $form, $values)
{
    global $SESSION, $USER, $skinid, $redirect;
    $skin = new Skin($skinid, null);
    if ($skin->get('owner') == $USER->get('id') || $USER->get('admin')) {
        $skin->delete();
        unlink(get_config('dataroot') . 'skins/' . $skinid . '.png');
        $SESSION->add_ok_msg(get_string('skindeleted', 'skin'));
    } else {
        $SESSION->add_error_msg(get_string('cantdeleteskin', 'skin'));
    }
    redirect($redirect);
}
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:13,代码来源:delete.php


示例15: __construct

 /**
  * @param IContextSource|Skin $obj
  * @throws MWException
  */
 public function __construct($obj)
 {
     if ($obj instanceof Skin) {
         // @todo: deprecate constructing with Skin
         $context = $obj->getContext();
     } else {
         if (!$obj instanceof IContextSource) {
             throw new MWException('EnhancedChangesList must be constructed with a ' . 'context source or skin.');
         }
         $context = $obj;
     }
     parent::__construct($context);
     // message is set by the parent ChangesList class
     $this->cacheEntryFactory = new RCCacheEntryFactory($context, $this->message);
 }
开发者ID:D66Ha,项目名称:mediawiki,代码行数:19,代码来源:EnhancedChangesList.php


示例16: layout

 /**
  * list users
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // we return some text
     $text = '';
     // empty list
     if (!($delta = SQL::count($result))) {
         return $text;
     }
     // flag idle users
     $idle = gmstrftime('%Y-%m-%d %H:%M:%S', time() - 600);
     // process all items in the list
     $count = 0;
     $items = array();
     while ($item = SQL::fetch($result)) {
         // url to view the user
         $url = Users::get_permalink($item);
         // initialize variables
         $prefix = $suffix = '';
         // signal restricted and private users
         if (isset($item['active']) && $item['active'] == 'N') {
             $prefix .= PRIVATE_FLAG;
         } elseif (isset($item['active']) && $item['active'] == 'R') {
             $prefix .= RESTRICTED_FLAG;
         }
         // signal locked profiles
         if (isset($item['capability']) && $item['capability'] == '?') {
             $prefix .= EXPIRED_FLAG;
         }
         // item title
         if (isset($item['full_name']) && $item['full_name']) {
             $label = ucfirst(Skin::strip($item['full_name'], 10));
             $hover = $item['nick_name'];
         } else {
             $label = ucfirst(Skin::strip($item['nick_name'], 10));
             $hover = $item['full_name'];
         }
         // flag idle users
         if (!isset($item['click_date']) || $item['click_date'] < $idle) {
             $class = 'idle user';
         } else {
             $class = 'user';
         }
         // list all components for this item
         $items[$url] = array($prefix, $label, $suffix, $class, NULL, $hover);
         // provide only some results
         if (++$count >= 5) {
             break;
         }
     }
     // end of processing
     SQL::free($result);
     // turn this to some text
     $text = Skin::build_list($items, 'comma');
     // some indications on the number of connections
     if ($delta -= $count) {
         $text .= ', ...';
     }
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:68,代码来源:layout_users_as_comma5.php


示例17: layout

 /**
  * list links
  *
  * @param resource the SQL result
  * @return array of resulting items, or NULL
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // we return an array of ($url => $attributes)
     $items = array();
     // empty list
     if (!SQL::count($result)) {
         return $items;
     }
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // get the main anchor
         $anchor = Anchors::get($item['anchor']);
         // url is the link itself -- hack for xhtml compliance
         $url = str_replace('&', '&amp;', $item['link_url']);
         // initialize variables
         $prefix = $suffix = '';
         // flag links that are dead, or created or updated very recently
         if ($item['edit_date'] >= $context['fresh']) {
             $suffix = NEW_FLAG;
         }
         // make a label
         $label = Links::clean($item['title'], $item['link_url']);
         // the main anchor link
         if (is_object($anchor)) {
             $suffix .= ' - <span class="details">' . sprintf(i18n::s('in %s'), Skin::build_link($anchor->get_url(), ucfirst($anchor->get_title()))) . '</span>';
         }
         // list all components for this item
         $items[$url] = array($prefix, $label, $suffix, 'basic', NULL);
     }
     // end of processing
     SQL::free($result);
     return $items;
 }
开发者ID:rair,项目名称:yacs,代码行数:42,代码来源:layout_links_as_simple.php


示例18: __construct

 /**
  * @param ResourceLoader $resourceLoader
  * @param WebRequest $request
  */
 public function __construct(ResourceLoader $resourceLoader, WebRequest $request)
 {
     $this->resourceLoader = $resourceLoader;
     $this->request = $request;
     // Interpret request
     // List of modules
     $modules = $request->getVal('modules');
     $this->modules = $modules ? self::expandModuleNames($modules) : array();
     // Various parameters
     $this->skin = $request->getVal('skin');
     $this->user = $request->getVal('user');
     $this->debug = $request->getFuzzyBool('debug', $resourceLoader->getConfig()->get('ResourceLoaderDebug'));
     $this->only = $request->getVal('only');
     $this->version = $request->getVal('version');
     $this->raw = $request->getFuzzyBool('raw');
     // Image requests
     $this->image = $request->getVal('image');
     $this->variant = $request->getVal('variant');
     $this->format = $request->getVal('format');
     $skinnames = Skin::getSkinNames();
     // If no skin is specified, or we don't recognize the skin, use the default skin
     if (!$this->skin || !isset($skinnames[$this->skin])) {
         $this->skin = $resourceLoader->getConfig()->get('DefaultSkin');
     }
 }
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:29,代码来源:ResourceLoaderContext.php


示例19: getFormatOutput

 /**
  * Prepare data output
  *
  * @since 1.8
  *
  * @param array $data label => value
  */
 protected function getFormatOutput(array $data)
 {
     //Init
     $dataObject = array();
     static $statNr = 0;
     $chartID = 'sparkline-' . $this->params['charttype'] . '-' . ++$statNr;
     $this->isHTML = true;
     // Prepare data array
     foreach ($data as $key => $value) {
         if ($value >= $this->params['min']) {
             $dataObject['label'][] = $key;
             $dataObject['value'][] = $value;
         }
     }
     $dataObject['charttype'] = $this->params['charttype'];
     // Encode data objects
     $requireHeadItem = array($chartID => FormatJson::encode($dataObject));
     SMWOutputs::requireHeadItem($chartID, Skin::makeVariablesScript($requireHeadItem));
     // RL module
     SMWOutputs::requireResource('ext.srf.sparkline');
     // Processing placeholder
     $processing = SRFUtils::htmlProcessingElement(false);
     // Chart/graph placeholder
     $chart = Html::rawElement('div', array('id' => $chartID, 'class' => 'container', 'style' => "display:none;"), null);
     // Beautify class selector
     $class = $this->params['class'] ? ' ' . $this->params['class'] : '';
     // Chart/graph wrappper
     return Html::rawElement('span', array('class' => 'srf-sparkline' . $class), $processing . $chart);
 }
开发者ID:yusufchang,项目名称:app,代码行数:36,代码来源:SRF_Sparkline.php


示例20: display_init

 function display_init()
 {
     global $Messages, $debug;
     // Request some common features that the parent function (Skin::display_init()) knows how to provide:
     parent::display_init(array('jquery', 'font_awesome', 'bootstrap', 'bootstrap_evo_css', 'bootstrap_messages', 'style_css', 'colorbox', 'bootstrap_init_tooltips', 'disp_auto'));
     // Skin specific initializations:
 }
开发者ID:b2evolution,项目名称:firming_skin,代码行数:7,代码来源:_skin.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SkinTemplate类代码示例发布时间:2022-05-23
下一篇:
PHP Skill类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap