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


PHP Plugin::isEnabled方法代码示例

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


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

示例1: execute

 /**
  * Execute function
  *
  * @return  void
  */
 public function execute()
 {
     // Is component on?
     if (!$this->config->get('component_on', 0)) {
         App::redirect('/');
         return;
     }
     // Publishing enabled?
     $this->_publishing = Plugin::isEnabled('projects', 'publications') ? 1 : 0;
     // Setup complete?
     $this->_setupComplete = $this->config->get('confirm_step', 0) ? 3 : 2;
     // Include scripts
     $this->_includeScripts();
     // Incoming project identifier
     $id = Request::getInt('id', 0);
     $alias = Request::getVar('alias', '');
     $this->_identifier = $id ? $id : $alias;
     // Incoming
     $this->_task = strtolower(Request::getWord('task', ''));
     $this->_gid = Request::getVar('gid', 0);
     // Model
     $this->model = new Models\Project($this->_identifier);
     // Execute the task
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:30,代码来源:base.php

示例2: browse

 public function browse()
 {
     $this->_checkPermission();
     $params = func_get_args();
     $this->path = join('/', $params);
     // make sure there's a / at the end
     if (substr($this->path, -1, 1) != '/') {
         $this->path .= '/';
     }
     //security
     // we dont allow back link
     if (strpos($this->path, '..') !== false) {
         if (Plugin::isEnabled('statistics_api')) {
             $user = null;
             if (AuthUser::isLoggedIn()) {
                 $user = AuthUser::getUserName();
             }
             $ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
             $event = array('event_type' => 'hack_attempt', 'description' => __('A possible hack attempt was detected.'), 'ipaddress' => $ip, 'username' => $user);
             Observer::notify('stats_file_manager_hack_attempt', $event);
         }
     }
     $this->fullpath = FILES_DIR . '/sidebarlink/images/';
     // clean up nicely
     $this->fullpath = preg_replace('/\\/\\//', '/', $this->fullpath);
     $this->display('sidebarlink/index', array('dir' => $this->path, 'files' => $this->_getListFiles(), 'sidebarlinks' => Record::findAllFrom('SidebarLink', '1=1 ORDER BY id desc'), 'pages' => Record::findAllFrom('Page', 'parent_id=1 OR parent_id=0 order by parent_id,position')));
 }
开发者ID:sindotnet,项目名称:cona,代码行数:27,代码来源:SidebarlinkController.php

示例3: execute

 /**
  * Executes a task
  *
  * @return     void
  */
 public function execute()
 {
     // Publishing enabled?
     $this->_publishing = Plugin::isEnabled('projects', 'publications') ? 1 : 0;
     // Include scripts
     $this->_includeScripts();
     parent::execute();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:13,代码来源:projects.php

示例4: isEnabled

 /**
  * Checks if a plugin is enabled.
  *
  * @param   string  $type    The plugin type, relates to the sub-directory in the plugins directory.
  * @param   string  $plugin  The plugin name.
  *
  * @return  boolean
  *
  * @since   11.1
  */
 public static function isEnabled($type, $plugin = null)
 {
     // [!] Hubzero
     if (class_exists('\\Plugin')) {
         return \Plugin::isEnabled($type, $plugin);
     }
     $result = self::getPlugin($type, $plugin);
     return !empty($result);
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:19,代码来源:helper.php

示例5: computeStats

 /**
  * Compute and log overall projects usage stats
  *
  * @param   object   $job  \Components\Cron\Models\Job
  * @return  boolean
  */
 public function computeStats(\Components\Cron\Models\Job $job)
 {
     $database = App::get('db');
     $publishing = Plugin::isEnabled('projects', 'publications') ? 1 : 0;
     require_once PATH_CORE . DS . 'components' . DS . 'com_projects' . DS . 'models' . DS . 'project.php';
     require_once PATH_CORE . DS . 'components' . DS . 'com_projects' . DS . 'tables' . DS . 'stats.php';
     if ($publishing) {
         require_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'publication.php';
         require_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'version.php';
     }
     $tblStats = new \Components\Projects\Tables\Stats($database);
     $model = new \Components\Projects\Models\Project();
     // Compute and store stats
     $stats = $tblStats->getStats($model, true, $publishing);
     return true;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:22,代码来源:projects.php

示例6: browse

 public function browse()
 {
     $this->_checkPermission();
     $params = func_get_args();
     $this->path = join('/', $params);
     // make sure there's a / at the end
     if (substr($this->path, -1, 1) != '/') {
         $this->path .= '/';
     }
     //security
     // we dont allow back link
     if (strpos($this->path, '..') !== false) {
         if (Plugin::isEnabled('statistics_api')) {
             $user = null;
             if (AuthUser::isLoggedIn()) {
                 $user = AuthUser::getUserName();
             }
             $ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
             $event = array('event_type' => 'hack_attempt', 'description' => __('A possible hack attempt was detected.'), 'ipaddress' => $ip, 'username' => $user);
             Observer::notify('stats_file_manager_hack_attempt', $event);
         }
     }
     $this->display('testimonial/index', array('testimonials' => Record::query('select * from ' . TABLE_PREFIX . 'testimonial ORDER BY ' . TABLE_PREFIX . 'testimonial.sequence, ' . TABLE_PREFIX . 'testimonial.id desc'), 'pages' => Record::findAllFrom('Page', 'parent_id=1 order by parent_id,position')));
 }
开发者ID:sindotnet,项目名称:cona,代码行数:24,代码来源:TestimonialController.php

示例7: browse

 public function browse()
 {
     $this->_checkPermission();
     $params = func_get_args();
     $this->path = join('/', $params);
     // make sure there's a / at the end
     if (substr($this->path, -1, 1) != '/') {
         $this->path .= '/';
     }
     //security
     // we dont allow back link
     if (strpos($this->path, '..') !== false) {
         if (Plugin::isEnabled('statistics_api')) {
             $user = null;
             if (AuthUser::isLoggedIn()) {
                 $user = AuthUser::getUserName();
             }
             $ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
             $event = array('event_type' => 'hack_attempt', 'description' => __('A possible hack attempt was detected.'), 'ipaddress' => $ip, 'username' => $user);
             Observer::notify('stats_file_manager_hack_attempt', $event);
         }
     }
     $this->fullpath = FILES_DIR . '/themes/promo/images/';
     // clean up nicely
     $this->fullpath = preg_replace('/\\/\\//', '/', $this->fullpath);
     $newss = Record::query('select * from ' . TABLE_PREFIX . 'news ORDER BY type, sequence asc, id desc');
     $this->display('news/index', array('dir' => $this->path, 'files' => $this->_getListFiles(), 'newss' => $newss));
 }
开发者ID:sindotnet,项目名称:dashhotel,代码行数:28,代码来源:NewsController.php

示例8: define

 * @package Plugins
 * @subpackage shopping-cart
 *
 * @author Stefan Miller <linuxsmiller@gmail.com>
 * Copyright (C) 2014 Stefan Miller <linuxsmiller@gmail.com>
 * @license http://www.gnu.org/licenses/gpl.html GPLv3 license
 *
 */
/* Security measure */
if (!defined('IN_CMS')) {
    exit;
}
/**
 * Root location where Files plugin lives.
 */
define('SC_FILES_ROOT', PATH_PUBLIC . 'wolf/plugins/shopping_cart');
/**
 * Root location where files get uploaded to as an absolute path.
 */
define('SC_FILES_DIR', CMS_ROOT . DS . 'public');
/**
 * Root location where files get uploaded to as a URL.
 */
define('BASE_SC_FILES_DIR', URL_PUBLIC . 'public');
// DO NOT EDIT AFTER THIS LINE -----------------------------------------------
Plugin::setInfos(array('id' => 'shopping_cart', 'title' => 'Shopping Cart', 'description' => 'A shopping cart inventory administration module', 'version' => '0.0.1', 'author' => 'Stefan Miller', 'website' => 'http://www.artisticdigital.com', 'require_wolf_version' => '0.7.0'));
Plugin::addController('shopping_cart', __('Shopping Cart'), 'admin_view', true);
// Make sure possible hack attempts get registered if the statistics API is available.
if (Plugin::isEnabled('statistics_api')) {
    Observer::observe('stats_shopping_cart_hack_attempt', 'StatisticsEvent::registerEvent');
}
开发者ID:ariksavage,项目名称:template2.adsourorg,代码行数:31,代码来源:index.php

示例9: sprintf

            ?>
<button value="<?php 
            echo $snippet[$sel_inc]->id;
            ?>
"><?php 
            echo sprintf('%s', $snippet[$sel_inc]->name);
            ?>
</button>
<?php 
        }
    }
} else {
    ?>
<p><?php 
    echo __('There are no snippets found');
    ?>
</p>
<?php 
}
?>
</div>
</div>
<script type="text/javascript" charset="utf-8">
$(Easysnippet('buttons', <?php 
echo Plugin::isEnabled('shortcut') ? '["[!", "!]"]' : 'null';
?>
));
</script>


开发者ID:svanlaere,项目名称:easysnippet,代码行数:28,代码来源:buttons.php

示例10: listModules


//.........这里部分代码省略.........
             $path = realpath(dirname(__FILE__) . '/Scanning/SpecialDepts');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'TenderModule':
             $path = realpath(dirname(__FILE__) . '/Tenders');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'TenderReport':
             $path = realpath(dirname(__FILE__) . '/ReceiptBuilding/TenderReports');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'DefaultReceiptDataFetch':
             $path = realpath(dirname(__FILE__) . '/ReceiptBuilding/ReceiptDataFetch');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'DefaultReceiptFilter':
             $path = realpath(dirname(__FILE__) . '/ReceiptBuilding/ReceiptFilter');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'DefaultReceiptSort':
             $path = realpath(dirname(__FILE__) . '/ReceiptBuilding/ReceiptSort');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'DefaultReceiptTag':
             $path = realpath(dirname(__FILE__) . '/ReceiptBuilding/ReceiptTag');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'DefaultReceiptSavings':
             $path = realpath(dirname(__FILE__) . '/ReceiptBuilding/ReceiptSavings');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'ReceiptMessage':
             $path = realpath(dirname(__FILE__) . '/ReceiptBuilding/Messages');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'CustomerReceiptMessage':
             $path = realpath(dirname(__FILE__) . '/ReceiptBuilding/custMessages');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'ProductSearch':
             $path = realpath(dirname(__FILE__) . '/Search/Products');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'DiscountModule':
             $map['DiscountModule'] = realpath(dirname(__FILE__) . '/DiscountModule.php');
             break;
         case 'MemberLookup':
             $map['MemberLookup'] = realpath(dirname(__FILE__) . '/MemberLookup.php');
             break;
         case 'PrintHandler':
             $path = realpath(dirname(__FILE__) . '/PrintHandlers');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'BasicModel':
             $path = realpath(dirname(__FILE__) . '/models');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'TotalAction':
             $path = realpath(dirname(__FILE__) . '/TotalActions');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'VariableWeightReWrite':
             $path = realpath(dirname(__FILE__) . '/Scanning/VariableWeightReWrites');
             $map = Plugin::pluginMap($path, $map);
             break;
         case 'ItemNotFound':
             $map['ItemNotFound'] = realpath(dirname(__FILE__) . '/ItemNotFound.php');
             break;
     }
     foreach ($map as $name => $file) {
         // matched base class
         if ($name === $base_class) {
             if ($include_base) {
                 $ret[] = $name;
             }
             continue;
         }
         ob_start();
         if (!class_exists($name)) {
             ob_end_clean();
             continue;
         }
         if (strstr($file, 'plugins')) {
             $parent = Plugin::memberOf($file);
             if ($parent && Plugin::isEnabled($parent) && is_subclass_of($name, $base_class)) {
                 $ret[] = $name;
             } else {
                 if ($base_class == "Plugin" && is_subclass_of($name, $base_class)) {
                     $ret[] = $name;
                 }
             }
         } else {
             if (is_subclass_of($name, $base_class)) {
                 $ret[] = $name;
             }
         }
         ob_end_clean();
     }
     return $ret;
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:101,代码来源:AutoLoader.php

示例11:

					<span style="color:#c00;"><?php 
    echo Lang::txt('COM_MEMBERS_FIELD_EMAIL_NONE_ON_FILE');
    ?>
</span><br />
					<input type="checkbox" name="activation" id="activation" value="1" />
					<label for="activation"><?php 
    echo Lang::txt('COM_MEMBERS_FIELD_EMAIL_CONFIRM');
    ?>
</label>
				<?php 
}
?>
			</div>

			<?php 
if ($this->profile->get('id') && Plugin::isEnabled('system', 'spamjail')) {
    ?>
				<div class="input-wrap" data-hint="<?php 
    echo Lang::txt('COM_MEMBERS_SPAM_COUNT_HINT');
    ?>
">
					<label id="field_approved-lbl" for="field-reputation"><?php 
    echo Lang::txt('COM_MEMBERS_SPAM_COUNT');
    ?>
</label>
					<div class="input-modal">
						<span class="input-cell">
							<input type="text" name="spam_count" id="field-reputation" value="<?php 
    echo $this->escape($this->profile->reputation->get('spam_count', 0));
    ?>
" />
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:31,代码来源:edit_user.php

示例12: view

 public function view()
 {
     $params = func_get_args();
     $content = '';
     $filename = urldecode(join('/', $params));
     // Sanitize filename for securtiy
     // We don't allow backlinks
     if (strpos($filename, '..') !== false) {
         if (Plugin::isEnabled('statistics_api')) {
             $user = null;
             if (AuthUser::isLoggedIn()) {
                 $user = AuthUser::getUserName();
             }
             $ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
             $event = array('event_type' => 'hack_attempt', 'description' => __('A possible hack attempt was detected.'), 'ipaddress' => $ip, 'username' => $user);
             Observer::notify('stats_file_manager_hack_attempt', $event);
         }
     }
     $filename = str_replace('..', '', $filename);
     // Clean up nicely
     $filename = str_replace('//', '', $filename);
     // We don't allow leading slashes
     $filename = preg_replace('/^\\//', '', $filename);
     $file = FILES_DIR . '/' . $filename;
     if (!$this->_isImage($file) && file_exists($file)) {
         $content = file_get_contents($file);
     }
     $this->display('file_manager/views/view', array('is_image' => $this->_isImage($file), 'filename' => $filename, 'content' => $content));
 }
开发者ID:julpi,项目名称:FreshCMS,代码行数:29,代码来源:FileManagerController.php

示例13: isEnabled

 /**
  * Determines if the plugin for Redirect to work is enabled.
  *
  * @return  boolean
  */
 public static function isEnabled()
 {
     return \Plugin::isEnabled('system', 'redirect');
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:9,代码来源:redirect.php

示例14: __

/*
|	pawFramework
|	@file		./index.php
|	@author		svanlaere
|	@version	1.0.0 [1.0.0] - Stable
|
|	@license	X11 / MIT License
|	@copyright	Copyright © 2015 pytesNET
*/
if (!defined("IN_CMS")) {
    exit;
}
// SET PLUGIN INFOS
Plugin::setInfos(array("id" => "themer", "title" => "Themer", "description" => __("A WordPress AdminTheme configuration plugin."), "version" => "1.0.0", "license" => "GPL", "author" => "svanlaere", "website" => "http://www.wolfcms.org/forum/", "require_wolf_version" => "0.7.5", "type" => "backend"));
Plugin::addController("themer", __("Wordpress admin theme"), "admin_view", false);
if (Plugin::isEnabled("themer")) {
    if (!defined("THEMER")) {
        define("THEMER", PLUGINS_ROOT . "/themer");
    }
    if (!defined("THEMER_VIEW")) {
        define("THEMER_VIEW", "themer/views/");
    }
    function themer_customize_admin_theme($path)
    {
        $admin_theme = Setting::get("theme");
        $settings = Plugin::getAllSettings("themer");
        if ($admin_theme == "wordpress-3.8") {
            echo new View(THEMER . DS . "views" . DS . "head", array("color" => $settings["color"], "sidebar_width" => $settings["sidebar_width"]));
        }
        return $path;
    }
开发者ID:svanlaere,项目名称:wolfcms-wordpress-admintheme,代码行数:31,代码来源:index.php

示例15:

Plugin::setInfos(array(
    'id'			=> 'redirector',
    'title'			=> 'Redirector', 
    'description'	=> 'Provides an interface to manage redirects.', 
    'version'		=> '0.2.5', 
    'website'		=> 'http://www.github.com/realslacker/Redirector-Plugin',
    'update_url'	=> 'http://www.brooksworks.com/plugin-versions.xml'
));

//	setup observers
Behavior::add('page_not_found', '');
Observer::observe('page_requested', 'redirector_catch_redirect');

//	allow Redirector to observe the "page_not_found" event before the "page_not_found" plugin
if (Plugin::isEnabled('page_not_found')) {
    Observer::stopObserving('page_not_found', 'behavior_page_not_found');
    Observer::observe('page_not_found', 'redirector_log_404');
    Observer::observe('page_not_found', 'behavior_page_not_found');
}
else {
    Observer::observe('page_not_found', 'redirector_log_404');
}

//	load plugin classes into the system
AutoLoader::addFolder(dirname(__FILE__) . '/models');

// add the plugin's tab and controller
Plugin::addController('redirector', __('Redirector'),'redirector_view,redirector_new,redirector_edit,redirector_delete,redirector_settings');

// redirect urls already configured
开发者ID:realslacker,项目名称:Redirector-Plugin,代码行数:30,代码来源:index.php


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