本文整理汇总了PHP中RokCommon_Composite::addPackagePath方法的典型用法代码示例。如果您正苦于以下问题:PHP RokCommon_Composite::addPackagePath方法的具体用法?PHP RokCommon_Composite::addPackagePath怎么用?PHP RokCommon_Composite::addPackagePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RokCommon_Composite
的用法示例。
在下文中一共展示了RokCommon_Composite::addPackagePath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addStylePath
public function addStylePath($path, $priority = self::DEFAULT_PRIORITY)
{
/** @var $platforminfo RokCommon_IPlatformInfo */
$platforminfo = $this->container->getService('platforminfo');
foreach ($platforminfo->getPathChecks() as $append) {
RokCommon_Composite::addPackagePath(self::STYLE_CONTEXT, $path . $append, $priority);
}
}
示例2: __construct
public function __construct(RokCommon_Registry $params)
{
parent::__construct($params);
$this->context_base = self::BASE_PACKAGE_NAME;
RokCommon_Composite::addPackagePath($this->context_base, JPATH_SITE . '/components/com_roksprocket', 10);
RokCommon_Composite::addPackagePath($this->context_base, JPATH_SITE . '/modules/mod_roksprocket', 15);
RokCommon_Composite::addPackagePath($this->context_base, $this->container['roksprocket.template.override.path'], 20);
}
示例3: __construct
public function __construct(RokCommon_Dispatcher $dispatcher)
{
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_advancedmodules/tables');
if (JPluginHelper::isEnabled('system', 'advancedmodules') && $this->isComponentEnabled()) {
RokCommon_Composite::addPackagePath('roksprocket', dirname(__FILE__) . '/AdvancedModuleManager', 25);
$dispatcher->connect('roksprocket.module.get', array($this, 'getModule'));
$dispatcher->connect('roksprocket.module.save', array($this, 'saveModule'));
$dispatcher->connect('roksprocket.module.duplicate', array($this, 'duplicateModule'));
}
}
示例4: init
function init()
{
if (!defined('ROKCOMMON_LIB_PATH')) {
define('ROKCOMMON_LIB_PATH', JPATH_SITE . '/libraries/rokcommon');
}
if (is_file(ROKCOMMON_LIB_PATH . '/include.php')) {
include ROKCOMMON_LIB_PATH . '/include.php';
}
if (defined('ROKCOMMON') && class_exists('RokCommon_Composite')) {
RokCommon_Composite::addPackagePath('mod_rokgallery', JPATH_SITE . '/templates/rt_momentum/overrides/mod_rokgallery/templates', 20);
}
}
示例5: initialize
/**
* @param RokSprocket_ItemCollection $items
* @param RokCommon_Registry $parameters
*/
public function initialize(RokSprocket_ItemCollection $items, RokCommon_Registry $parameters)
{
$this->setItems($items);
$this->setParameters($parameters);
$this->layoutPackage = sprintf('roksprocket_layout_%s', $this->name);
// setup the theme packages and content and info
$this->theme = $this->parameters->get($this->name . '_themes', 'default');
$this->themePackage = sprintf('%s_%s', $this->layoutPackage, $this->theme);
$paths = $this->container[sprintf('roksprocket.layouts.%s.paths', $this->name)];
foreach ($paths as $order => $path) {
RokCommon_Composite::addPackagePath($this->layoutPackage, $path, $order);
RokCommon_Composite::addPackagePath($this->themePackage, $path . '/themes/' . $this->theme, $order);
}
$this->theme_context = RokCommon_Composite::get($this->themePackage);
$this->cleanItemParams();
}
示例6: getOptions
/**
* Method to get the field options for the list of installed editors.
*
* @return array The field option objects.
* @since 11.1
*/
protected function getOptions()
{
$container = RokCommon_Service::getContainer();
$fieldname = $this->element['name'];
$configkey = (string) $this->element['configkey'];
$options = array();
$params = $container[$configkey];
$params = get_object_vars($params);
ksort($params);
foreach ($params as $id => $info) {
if (!in_array($id, self::$loaded_icons)) {
$layout_composite_path = 'roksprocket_layout_' . $id;
$priority = 0;
foreach ($info->paths as $path) {
RokCommon_Composite::addPackagePath($layout_composite_path, $path, $priority);
$priority++;
}
$iconurl = RokCommon_Composite::get($layout_composite_path)->getUrl($info->icon);
if (empty($iconurl)) {
$iconurl = "components/com_roksprocket/assets/images/default_layout_icon.png";
}
$css = sprintf('#module-form i.layout.%s {background-image: url(%s);background-position: 0 0;}', $id, $iconurl);
RokCommon_Header::addInlineStyle($css);
self::$loaded_icons[] = $id;
}
if ($this->value == $id) {
$selected = ' selected="selected"';
} else {
$selected = "";
}
$tmp = JHtml::_('select.option', $id, $info->displayname);
// Set some option attributes.
$tmp->attr = array('class' => $id, 'rel' => $fieldname . '_' . $id);
$tmp->icon = $fieldname . ' ' . $id;
$options[] = $tmp;
}
reset($options);
return $options;
}
示例7: addPath
/**
* @param string $path
* @param int $priority
*/
public function addPath($path, $priority = RokCommon_Composite::DEFAULT_PRIORITY)
{
//self::addConfigPath($this->identifier, $path, $priority);
RokCommon_Composite::addPackagePath($this->identifier, $path, $priority);
}
示例8: loadLayouts
/**
* @param RokCommon_Service_Container $container
*/
protected function loadLayouts(RokCommon_Service_Container &$container)
{
/** @var $platforminfo RokCommon_PlatformInfo */
$platforminfo = $container->platforminfo;
RokCommon_Composite::addPackagePath('roksprocket_layouts', JPATH_SITE . '/components/com_roksprocket/layouts', 10);
RokCommon_Composite::addPackagePath('roksprocket_layouts', $container['roksprocket.template.override.path'] . '/layouts', 20);
JForm::addFieldPath($container['template.path'] . '/admin/forms/fields');
$context = RokCommon_Composite::get('roksprocket_layouts');
$priority_files = $context->getAllSubFiles('meta.xml');
ksort($priority_files, true);
foreach ($priority_files as $priority => $files) {
foreach ($files as $file) {
RokCommon_Service::addConfigFile($file);
}
}
}
示例9: define
if (!defined('ROKCOMMON_LIB_PATH')) {
define('ROKCOMMON_LIB_PATH', rokcommon_cleanPath(dirname(__FILE__)));
}
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
// Check to see if there is a requiments file and run it.
// Catch any exceptions and log them as errors.
$requirements_file = rokcommon_cleanPath(ROKCOMMON_LIB_PATH . '/requirements.php');
if (file_exists($requirements_file)) {
try {
require_once $requirements_file;
} catch (Exception $e) {
return;
}
}
define('ROKCOMMON', '3.1.11');
define('ROKCOMMON_CORE_DEBUG', true);
// Bootstrap the base classloader and overrides
require_once rokcommon_cleanPath(ROKCOMMON_LIB_PATH . '/RokCommon/ClassLoader.php');
RokCommon_ClassLoader::getInstance();
$container = RokCommon_Service::getContainer();
$container->classloader;
// load up the supporting functions
$functions_path = rokcommon_cleanPath(ROKCOMMON_LIB_PATH . '/functions.php');
if (file_exists($functions_path)) {
require_once $functions_path;
}
RokCommon_Composite::addPackagePath('rc_context_path', ROKCOMMON_LIB_PATH);
}
return "ROKCOMMON_LIB_INCLUDED";
示例10: defined
<?php
/**
* @version $Id: roksprocket.php 10885 2013-05-30 06:31:41Z btowles $
* @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2016 RocketTheme, LLC
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
*/
include_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/legacy_class.php';
// no direct access
defined('_JEXEC') or die;
// Include dependancies
jimport('joomla.application.component.controller');
JTable::addIncludePath(JPATH_SITE . '/components/com_roksprocket/tables');
RokCommon_Composite::addPackagePath(RokSprocket::BASE_PACKAGE_NAME, dirname(__FILE__));
$controller = RokSprocketLegacyJController::getInstance('RokSprocket');
$app = JFactory::getApplication();
$input = $app->input;
$task = $input->get('task', null, 'CMD');
$controller->execute($task);
$controller->redirect();
示例11: addPath
/**
* @param string $path
* @param int $priority
*/
public function addPath($path, $priority = RokCommon_Composite::DEFAULT_PRIORITY)
{
RokCommon_Composite::addPackagePath(self::CONTEXT_PREFIX . $this->identifier, $path, $priority);
}
示例12: addFormPath
/**
* Proxy for RokCommon_Form_Helper::addFormPath().
*
* @param string|string[] $path A path or array of paths to add.
* @param int $priority the priority for the path
*/
public static function addFormPath($path, $priority = 10)
{
if (is_array($path)) {
foreach ($path as $p) {
self::addFormPath($p, $priority);
}
return;
}
RokCommon_Composite::addPackagePath(self::FORM_PATH_PACKAGE, $path, $priority);
}
示例13: define
<?php
/**
* @version $Id: include.php 39370 2011-07-02 22:16:28Z btowles $
* @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2011 RocketTheme, LLC
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
*/
if (!defined('JOOMLA_ROKGALLERYMODULE_LIB')) {
define('JOOMLA_ROKGALLERYMODULE_LIB', 'JOOMLA_ROKGALLERYMODULE_LIB');
$include_file = @realpath(realpath(ROKGALLERYMODULE_ROOT . '/lib/include.php'));
$included_files = get_included_files();
if (!in_array($include_file, $included_files) && ($loaderrors = (require_once $include_file)) !== 'ROKGALLERYMODULE_LIB_INCLUDED') {
return $loaderrors;
}
RokGallery_Doctrine::addModelPath(JPATH_SITE . '/components/com_rokgallery/lib');
RokCommon_Composite::addPackagePath('mod_rokgallery', JPATH_SITE . '/modules/mod_rokgallery/templates');
}
return 'JOOMLA_ROKGALLERYMODULE_LIB_LOADED';
示例14: defined
<?php
/**
* @package Joomla.Administrator
* @subpackage com_modules
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access.
defined('_JEXEC') or die;
$fieldSet = $that->form->getFieldset('roksprocket');
$hidden_fields = '';
$container = $that->container['roksprocket.layouts.' . $that->layout];
$composite = 'roksprocket_layout_' . $that->layout;
foreach ($container->paths as $path) {
RokCommon_Composite::addPackagePath($composite, $path, 0);
}
$iconURL = RokCommon_Composite::get($composite)->getUrl($container->icon);
if (empty($iconURL)) {
$iconURL = "components/com_roksprocket/assets/images/default_layout_icon.png";
}
$css[] = sprintf('#module-form i.layout.%s {background-image: url(%s);background-position: 0 0;}', $that->layout, $iconURL);
?>
<style><?php
echo implode("\n", $css);
?>
</style>
<div class="panel-left">
<div class="panel-left-wrapper">
示例15: display
/**
* Display the view
*/
public function display($tpl = null)
{
JHtml::_('behavior.framework', true);
JHtml::_('behavior.keepalive');
$this->container = RokCommon_Service::getContainer();
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->articles = $this->getModel()->getArticles($this->item->id, $this->item->params);
$this->layout = isset($this->item->params['layout']) ? $this->item->params['layout'] : $this->form->getFieldAttribute('layout', 'default', 'text', 'params');
$this->provider = isset($this->item->params['provider']) ? $this->item->params['provider'] : $this->form->getFieldAttribute('provider', 'default', 'text', 'params');
if (!isset($this->container[sprintf('roksprocket.layouts.%s', $this->layout)])) {
JError::raiseWarning(500, rc__(ROKSPROCKET_UNABLE_TO_FIND_LAYOUT_ERROR, $this->layout));
$app = JFactory::getApplication();
$app->redirect(JRoute::_(sprintf('index.php?option=%s&view=modules', RokSprocket_Helper::getRedirectionOption()), false));
return false;
}
$this->perItemForm = $this->getModel()->getPerItemsForm($this->layout);
/** @var $i18n RokCommon_I18N */
/** @var $i18n RokCommon_I18N */
$i18n = $this->container->i18n;
foreach ($this->container['roksprocket.layouts'] as $layout_type => $layoutinfo) {
$layout_lang_paths = $this->container[sprintf('roksprocket.layouts.%s.paths', $layout_type)];
foreach ($layout_lang_paths as $lang_path) {
@$i18n->loadLanguageFiles('roksprocket_layout_' . $layout_type, $lang_path);
}
}
$load_more_total = count($this->articles);
$module_params = new RokCommon_Registry($this->item->params);
$limit = 10;
if ($load_more_total > $limit) {
$this->articles = $this->articles->trim($limit);
$load_more = 'true';
} else {
$load_more = 'false';
}
$load_more_script = sprintf('RokSprocket.Paging = {more: %s, page: 1, next_page: 2, amount: %d};', $load_more, $load_more_total);
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
// Read cookie for showing/hide per-article items
if (!isset($_COOKIE['roksprocket-showitems'])) {
$showitems_cookie = 1;
setcookie("roksprocket-showitems", $showitems_cookie, time() + 60 * 60 * 24 * 365, '/');
} else {
$showitems_cookie = $_COOKIE['roksprocket-showitems'];
}
$this->showitems = (bool) $showitems_cookie;
$siteURL = JURI::root(true);
$adminURL = JURI::base(true);
$this->addToolbar();
$this->compileLess();
$this->compileJS();
RokCommon_Header::addInlineScript("RokSprocket.params = 'jform_params';RokSprocket.SiteURL = '" . $siteURL . "'; RokSprocket.AdminURL = '" . $adminURL . "'; RokSprocket.URL = RokSprocket.AdminURL + '/index.php?option=" . JFactory::getApplication()->input->getString('option') . "&task=ajax&format=raw';" . $load_more_script);
RokCommon_Header::addStyle($siteURL . '/components/com_roksprocket/fields/filters/css/datepicker.css');
$template_path_param = sprintf('roksprocket.providers.registered.%s.templatepath', strtolower($this->provider));
if ($this->container->hasParameter($template_path_param)) {
RokCommon_Composite::addPackagePath('roksprocket', $this->container->getParameter($template_path_param), 30);
}
parent::display($tpl);
}