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


PHP Gdn::PluginManager方法代码示例

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


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

示例1: Gdn_Dispatcher_BeforeDispatch_Handler

 /**
  * Override the default dashboard page with the new stats one.
  */
 public function Gdn_Dispatcher_BeforeDispatch_Handler($Sender)
 {
     $Enabled = C('Garden.Analytics.Enabled', TRUE);
     if ($Enabled && !Gdn::PluginManager()->HasNewMethod('SettingsController', 'Index')) {
         Gdn::PluginManager()->RegisterNewMethod('VanillaStatsPlugin', 'StatsDashboard', 'SettingsController', 'Index');
     }
 }
开发者ID:rnovino,项目名称:Garden,代码行数:10,代码来源:class.vanillastats.plugin.php

示例2: GetPluginFolder

 public function GetPluginFolder($Absolute = TRUE)
 {
     $Folder = GetValue('Folder', Gdn::PluginManager()->GetPluginInfo(get_class($this), Gdn_PluginManager::ACCESS_CLASSNAME));
     $PathParts = array($Folder);
     array_unshift($PathParts, $Absolute ? PATH_PLUGINS : 'plugins');
     return implode(DS, $PathParts);
 }
开发者ID:TiGR,项目名称:Garden,代码行数:7,代码来源:class.plugin.php

示例3: Gdn_Dispatcher_AfterAnalyzeRequest_Handler

 /**
  * Remove plugins that are not mobile friendly!
  */
 public function Gdn_Dispatcher_AfterAnalyzeRequest_Handler($Sender)
 {
     // Remove plugins so they don't mess up layout or functionality.
     if (in_array($Sender->Application(), array('vanilla', 'dashboard', 'conversations'))) {
         Gdn::PluginManager()->RemoveMobileUnfriendlyPlugins();
     }
 }
开发者ID:tautomers,项目名称:knoopvszombies,代码行数:10,代码来源:class.mobilethemehooks.php

示例4: IsRemovable

 /**
  * Is the application/plugin/theme removable?
  *
  * @param string $Type self::TYPE_APPLICATION or self::TYPE_PLUGIN or self::TYPE_THEME
  * @param string $Name 
  * @return boolean
  */
 public static function IsRemovable($Type, $Name)
 {
     switch ($Type) {
         case self::TYPE_APPLICATION:
             $ApplicationManager = Gdn::Factory('ApplicationManager');
             if ($IsRemovable = !array_key_exists($Name, $ApplicationManager->EnabledApplications())) {
                 $ApplicationInfo = ArrayValue($Name, $ApplicationManager->AvailableApplications(), array());
                 $ApplicationFolder = ArrayValue('Folder', $ApplicationInfo, '');
                 $IsRemovable = IsWritable(PATH_APPLICATIONS . DS . $ApplicationFolder);
             }
             break;
         case self::TYPE_PLUGIN:
             if ($IsRemovable = !array_key_exists($Name, Gdn::PluginManager()->EnabledPlugins)) {
                 $PluginInfo = ArrayValue($Name, Gdn::PluginManager()->AvailablePlugins(), FALSE);
                 $PluginFolder = ArrayValue('Folder', $PluginInfo, FALSE);
                 $IsRemovable = IsWritable(PATH_PLUGINS . DS . $PluginFolder);
             }
             break;
         case self::TYPE_THEME:
             // TODO
             $IsRemovable = FALSE;
             break;
     }
     return $IsRemovable;
 }
开发者ID:tautomers,项目名称:knoopvszombies,代码行数:32,代码来源:class.settingsmodule.php

示例5: Gdn_Dispatcher_AfterAnalyzeRequest_Handler

 /**
  * Set user's preferred locale. 
  *
  * Moved event from AppStart to AfterAnalyzeRequest to allow Embed to set P3P header first.
  */
 public function Gdn_Dispatcher_AfterAnalyzeRequest_Handler($Sender)
 {
     // Set user preference
     if ($TempLocale = $this->GetAlternateLocale()) {
         Gdn::Locale()->Set($TempLocale, Gdn::ApplicationManager()->EnabledApplicationFolders(), Gdn::PluginManager()->EnabledPluginFolders());
     }
 }
开发者ID:klokantech,项目名称:cynefin-forum,代码行数:12,代码来源:class.multilingual.plugin.php

示例6: Gdn_Dispatcher_AfterAnalyzeRequest_Handler

 /** Remove plugins that are not mobile friendly! */
 public function Gdn_Dispatcher_AfterAnalyzeRequest_Handler($Sender)
 {
     // Remove plugins so they don't mess up layout or functionality.
     if (in_array($Sender->Application(), array('vanilla', 'conversations')) || $Sender->Application() == 'dashboard' && in_array($Sender->Controller(), array('Activity', 'Profile', 'Search'))) {
         Gdn::PluginManager()->RemoveMobileUnfriendlyPlugins();
     }
     SaveToConfig('Garden.Format.EmbedSize', '240x135', FALSE);
 }
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:9,代码来源:class.mobilethemehooks.php

示例7: Refresh

 /**
  * Reload the locale system
  */
 public function Refresh()
 {
     $LocalName = $this->Current();
     $ApplicationWhiteList = Gdn::ApplicationManager()->EnabledApplicationFolders();
     $PluginWhiteList = Gdn::PluginManager()->EnabledPluginFolders();
     $ForceRemapping = TRUE;
     $this->Set($LocalName, $ApplicationWhiteList, $PluginWhiteList, $ForceRemapping);
 }
开发者ID:3marproof,项目名称:vanilla,代码行数:11,代码来源:class.locale.php

示例8: RenderNsfw

 protected function RenderNsfw(&$Sender)
 {
     if (!$this->RenderNsfw || Gdn::PluginManager()->CheckPlugin('NBBC')) {
         return;
     }
     $FormatBody =& $Sender->EventArguments['Object']->FormatBody;
     $FormatBody = preg_replace('`<div>\\s*(\\[/?nsfw\\])\\s*</div>`', '$1', $FormatBody);
     $FormatBody = preg_replace_callback("/(\\[nsfw(?:=(?:&quot;)?([\\d\\w_',.? ]+)(?:&quot;)?)?\\])/siu", array($this, 'NsfwCallback'), $FormatBody);
     $FormatBody = str_ireplace('[/nsfw]', '</div></div>', $FormatBody);
 }
开发者ID:Nordic-T,项目名称:vanilla-plugins,代码行数:10,代码来源:class.nsfw.plugin.php

示例9: __construct

 public function __construct()
 {
     parent::__construct();
     if (Gdn::PluginManager()->CheckPlugin('Reactions') && C('Plugins.QnA.Reactions', TRUE)) {
         $this->Reactions = TRUE;
     }
     if (Gdn::ApplicationManager()->CheckApplication('Reputation') && C('Plugins.QnA.Badges', TRUE)) {
         $this->Badges = TRUE;
     }
 }
开发者ID:mcnasby,项目名称:datto-vanilla,代码行数:10,代码来源:class.qna.plugin.php

示例10: RenderSpoilers

 protected function RenderSpoilers(&$Sender)
 {
     if (!$this->RenderSpoilers || Gdn::PluginManager()->CheckPlugin('NBBC')) {
         return;
     }
     $FormatBody =& $Sender->EventArguments['Object']->FormatBody;
     // Fix a wysiwyg but where spoilers
     $FormatBody = preg_replace('`<div>\\s*(\\[/?spoiler\\])\\s*</div>`', '$1', $FormatBody);
     $FormatBody = preg_replace_callback("/(\\[spoiler(?:=(?:&quot;)?([\\d\\w_',.? ]+)(?:&quot;)?)?\\])/siu", array($this, 'SpoilerCallback'), $FormatBody);
     $FormatBody = str_ireplace('[/spoiler]', '</div></div>', $FormatBody);
 }
开发者ID:SatiricMan,项目名称:addons,代码行数:11,代码来源:class.spoilers.plugin.php

示例11: Gdn_Autoload

function Gdn_Autoload($ClassName)
{
    if (!class_exists('Gdn_FileSystem', FALSE)) {
        return false;
    }
    if (!class_exists('Gdn_LibraryMap', FALSE)) {
        return false;
    }
    if (!class_exists('Gdn', FALSE)) {
        return false;
    }
    if (substr($ClassName, 0, 4) === 'Gdn_') {
        $LibraryFileName = 'class.' . strtolower(substr($ClassName, 4)) . '.php';
    } else {
        $LibraryFileName = 'class.' . strtolower($ClassName) . '.php';
    }
    if (!is_null($ApplicationManager = Gdn::Factory('ApplicationManager'))) {
        $ApplicationWhiteList = Gdn::Factory('ApplicationManager')->EnabledApplicationFolders();
    } else {
        $ApplicationWhiteList = NULL;
    }
    $LibraryPath = FALSE;
    // If this is a model, look in the models folder(s)
    if (strtolower(substr($ClassName, -5)) == 'model') {
        $LibraryPath = Gdn_FileSystem::FindByMapping('library', PATH_APPLICATIONS, $ApplicationWhiteList, 'models' . DS . $LibraryFileName);
    }
    if (Gdn::PluginManager() instanceof Gdn_PluginManager) {
        // Look for plugin files.
        if ($LibraryPath === FALSE) {
            $PluginFolders = Gdn::PluginManager()->EnabledPluginFolders();
            $LibraryPath = Gdn_FileSystem::FindByMapping('library', PATH_PLUGINS, $PluginFolders, $LibraryFileName);
        }
        // Look harder for plugin files.
        if ($LibraryPath === FALSE) {
            $LibraryPath = Gdn_FileSystem::FindByMapping('plugin', FALSE, FALSE, $ClassName);
        }
    }
    // Look for the class in the applications' library folders.
    if ($LibraryPath === FALSE) {
        $LibraryPath = Gdn_FileSystem::FindByMapping('library', PATH_APPLICATIONS, $ApplicationWhiteList, "library/{$LibraryFileName}");
    }
    // Look for the class in the core.
    if ($LibraryPath === FALSE) {
        $LibraryPath = Gdn_FileSystem::FindByMapping('library', PATH_LIBRARY, array('core', 'database', 'vendors' . DS . 'phpmailer'), $LibraryFileName);
    }
    // If it still hasn't been found, check for modules
    if ($LibraryPath === FALSE) {
        $LibraryPath = Gdn_FileSystem::FindByMapping('library', PATH_APPLICATIONS, $ApplicationWhiteList, 'modules' . DS . $LibraryFileName);
    }
    if ($LibraryPath !== FALSE) {
        include_once $LibraryPath;
    }
}
开发者ID:tautomers,项目名称:knoopvszombies,代码行数:53,代码来源:functions.general.php

示例12: EnabledLocalePacks

 public function EnabledLocalePacks($GetInfo = FALSE)
 {
     $Result = (array) C('EnabledLocales', array());
     if ($GetInfo) {
         foreach ($Result as $Key => $Locale) {
             $InfoPath = PATH_ROOT . "/locales/{$Key}/definitions.php";
             if (file_exists($InfoPath)) {
                 $LocaleInfo = Gdn::PluginManager()->ScanPluginFile($InfoPath, 'LocaleInfo');
                 $Result[$Key] = current($LocaleInfo);
             } else {
                 unset($Result[$Key]);
             }
         }
     }
     return $Result;
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:16,代码来源:class.localemodel.php

示例13: CategoryWatch

 /**
  * 
  * 
  * @since 2.0.18
  * @access public
  * @return array Category IDs.
  */
 public static function CategoryWatch()
 {
     $Categories = self::Categories();
     $AllCount = count($Categories);
     $Watch = array();
     foreach ($Categories as $CategoryID => $Category) {
         if ($Category['PermsDiscussionsView'] && $Category['Following'] && !GetValue('HideAllDiscussions', $Category)) {
             $Watch[] = $CategoryID;
         }
     }
     Gdn::PluginManager()->EventArguments['CategoryIDs'] =& $Watch;
     Gdn::PluginManager()->FireEvent('CategoryWatch');
     if ($AllCount == count($Watch)) {
         return TRUE;
     }
     return $Watch;
 }
开发者ID:robhazkes,项目名称:Garden,代码行数:24,代码来源:class.categorymodel.php

示例14: GetImageSize

 /**
  * If passed path leads to an image, return size
  *
  * @param string $Path Path to file.
  * @return array [0] => Height, [1] => Width.
  */
 public static function GetImageSize($Path)
 {
     // Static FireEvent for intercepting non-local files.
     $Sender = new stdClass();
     $Sender->Returns = array();
     $Sender->EventArguments = array();
     $Sender->EventArguments['Path'] =& $Path;
     $Sender->EventArguments['Parsed'] = Gdn_Upload::Parse($Path);
     Gdn::PluginManager()->CallEventHandlers($Sender, 'Gdn_Upload', 'CopyLocal');
     if (!in_array(strtolower(pathinfo($Path, PATHINFO_EXTENSION)), array('gif', 'jpg', 'jpeg', 'png'))) {
         return array(0, 0);
     }
     $ImageSize = @getimagesize($Path);
     if (is_array($ImageSize)) {
         if (!in_array($ImageSize[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG))) {
             return array(0, 0);
         }
         return array($ImageSize[0], $ImageSize[1]);
     }
     return array(0, 0);
 }
开发者ID:SatiricMan,项目名称:addons,代码行数:27,代码来源:class.mediamodel.php

示例15: Urls

 /**
  * Returns the url prefix for a given type.
  * If there is a plugin that wants to store uploads at a different location or in a different way then they register themselves by subscribing to the Gdn_Upload_GetUrls_Handler event.
  * After that they will be available here.
  *
  * @param string $Type The type of upload to get the prefix for.
  * @return string The url prefix.
  */
 public static function Urls($Type = NULL)
 {
     static $Urls = NULL;
     if ($Urls === NULL) {
         $Urls = array('' => Asset('/uploads', TRUE));
         $Sender = new stdClass();
         $Sender->Returns = array();
         $Sender->EventArguments = array();
         $Sender->EventArguments['Urls'] =& $Urls;
         Gdn::PluginManager()->CallEventHandlers($Sender, 'Gdn_Upload', 'GetUrls');
     }
     if ($Type === NULL) {
         return $Urls;
     }
     if (isset($Urls[$Type])) {
         return $Urls[$Type];
     }
     return FALSE;
 }
开发者ID:rnovino,项目名称:Garden,代码行数:27,代码来源:class.upload.php


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