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


PHP Gdn_Theme::inSection方法代码示例

本文整理汇总了PHP中Gdn_Theme::inSection方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn_Theme::inSection方法的具体用法?PHP Gdn_Theme::inSection怎么用?PHP Gdn_Theme::inSection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gdn_Theme的用法示例。


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

示例1: inSection

 /**
  * Returns whether or not the page is in one of the given section(s).
  *
  * @param string|array $Section
  * @return bool
  * @since 2.1
  */
 function inSection($Section)
 {
     return Gdn_Theme::inSection($Section);
 }
开发者ID:mcnasby,项目名称:datto-vanilla,代码行数:11,代码来源:functions.render.php

示例2: base_render_before

 /**
  * Placed these components everywhere due to some Web sites loading the
  * editor in some areas where the values were not yet injected into HTML.
  */
 public function base_render_before($Sender)
 {
     // Don't render any assets for editor if it's embedded. This effectively
     // disables the editor from embedded comments. Some HTML is still
     // inserted, because of the BeforeBodyBox handler, which does not contain any data relating to embedded content.
     if ($this->isEmbeddedComment($Sender)) {
         return false;
     }
     $c = Gdn::controller();
     // If user wants to modify styling of Wysiwyg content in editor,
     // they can override the styles with this file.
     $CssInfo = AssetModel::cssPath('wysiwyg.css', 'plugins/editor');
     if ($CssInfo) {
         $CssPath = asset($CssInfo[1]);
     }
     // Load JavaScript used by every editor view.
     $c->addJsFile('editor.js', 'plugins/editor');
     if (Gdn_Theme::inSection('Dashboard')) {
         // Add some JS and CSS to blur out option when Wysiwyg not chosen.
         $c->addJsFile('settings.js', 'plugins/editor');
         $c->addCssFile('settings.css', 'plugins/editor');
     }
     // Fileuploads
     $c->addJsFile('jquery.ui.widget.js', 'plugins/editor');
     $c->addJsFile('jquery.iframe-transport.js', 'plugins/editor');
     $c->addJsFile('jquery.fileupload.js', 'plugins/editor');
     // Set definitions for JavaScript to read
     $c->addDefinition('editorVersion', $this->pluginInfo['Version']);
     $c->addDefinition('editorInputFormat', $this->Format);
     $c->addDefinition('editorPluginAssets', $this->AssetPath);
     $c->addDefinition('fileUpload-remove', t('Remove file'));
     $c->addDefinition('fileUpload-reattach', t('Click to re-attach'));
     $c->addDefinition('fileUpload-inserted', t('Inserted'));
     $c->addDefinition('fileUpload-insertedTooltip', t('This image has been inserted into the body of text.'));
     $c->addDefinition('wysiwygHelpText', t('editor.WysiwygHelpText', 'You are using <a href="https://en.wikipedia.org/wiki/WYSIWYG" target="_new">WYSIWYG</a> in your post.'));
     $c->addDefinition('bbcodeHelpText', t('editor.BBCodeHelpText', 'You can use <a href="http://en.wikipedia.org/wiki/BBCode" target="_new">BBCode</a> in your post.'));
     $c->addDefinition('htmlHelpText', t('editor.HtmlHelpText', 'You can use <a href="http://htmlguide.drgrog.com/cheatsheet.php" target="_new">Simple HTML</a> in your post.'));
     $c->addDefinition('markdownHelpText', t('editor.MarkdownHelpText', 'You can use <a href="http://en.wikipedia.org/wiki/Markdown" target="_new">Markdown</a> in your post.'));
     $c->addDefinition('textHelpText', t('editor.TextHelpText', 'You are using plain text in your post.'));
     $c->addDefinition('editorWysiwygCSS', $CssPath);
     $c->addDefinition('canUpload', $this->canUpload());
     $additionalDefinitions = array();
     $this->EventArguments['definitions'] =& $additionalDefinitions;
     $this->fireEvent('GetJSDefinitions');
     // Make sure we still have an array after all event handlers have had their turn and iterate through the result.
     if (is_array($additionalDefinitions)) {
         foreach ($additionalDefinitions as $defKey => $defVal) {
             $c->addDefinition($defKey, $defVal);
         }
         unset($defKey, $defVal);
     }
     // Set variables for file uploads
     $PostMaxSize = Gdn_Upload::unformatFileSize(ini_get('post_max_size'));
     $FileMaxSize = Gdn_Upload::unformatFileSize(ini_get('upload_max_filesize'));
     $ConfigMaxSize = Gdn_Upload::unformatFileSize(c('Garden.Upload.MaxFileSize', '1MB'));
     $MaxSize = min($PostMaxSize, $FileMaxSize, $ConfigMaxSize);
     $c->addDefinition('maxUploadSize', $MaxSize);
     // Set file input name
     $c->addDefinition('editorFileInputName', $this->editorFileInputName);
     $Sender->setData('_editorFileInputName', $this->editorFileInputName);
     // Save allowed file types
     $c->addDefinition('allowedFileExtensions', json_encode(c('Garden.Upload.AllowedFileExtensions')));
     // Get max file uploads, to be used for max drops at once.
     $c->addDefinition('maxFileUploads', ini_get('max_file_uploads'));
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:69,代码来源:class.editor.plugin.php


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