本文整理汇总了PHP中RokCommon_Composite类的典型用法代码示例。如果您正苦于以下问题:PHP RokCommon_Composite类的具体用法?PHP RokCommon_Composite怎么用?PHP RokCommon_Composite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RokCommon_Composite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __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);
}
示例2: 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);
}
}
示例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: _loadAssets
public function _loadAssets()
{
if (!self::$css_loaded) {
$type = strtolower($this->type);
/** @var $header RokCommon_IHeader */
$header = $this->container->getService('header');
$header->addStyle(RokCommon_Composite::get($this->assets_content . '.' . $type . '.css')->getUrl($type . '.css'));
self::$css_loaded = true;
}
}
示例5: 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);
}
}
示例6: renderLayoutHeaders
/**
* Called to render headers that should be included only once per Layout type used
*/
public function renderLayoutHeaders()
{
if (!self::$instanceHeadersRendered) {
$root_assets = RokCommon_Composite::get($this->basePackage . '.assets.js');
RokCommon_Header::addScript($root_assets->getUrl('moofx.js'));
$instance = array();
$instance[] = "window.addEvent('domready', function(){";
$instance[] = "\t\tRokSprocket.instances.sliders = new RokSprocket.Sliders();";
$instance[] = "});";
RokCommon_Header::addInlineScript(implode("\n", $instance) . "\n");
self::$instanceHeadersRendered = true;
}
}
示例7: 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();
}
示例8: get
/**
* Get the full list of jobs
* <code>
* {
* 'orberby': 'xxxx-x-x-x-x-x-x'
* }
* </code>
* @param $params
* @return RokCommon_Ajax_Result
*/
public function get($params)
{
$result = new RokCommon_Ajax_Result();
try {
$q = Doctrine_Query::create()->select('j.*')->from('RokGallery_Model_Job j')->orderBy('j.created_at DESC');
$jobs = $q->execute(array(), Doctrine_Core::HYDRATE_RECORD);
$outjobs = array();
foreach ($jobs as $job) {
unset($job->properties);
unset($job->sm);
$outjobs[] = $job->toJsonableArray();
}
$html = RokCommon_Composite::get('com_rokgallery.jobs')->load('default.php', array('jobs' => $jobs));
$result->setPayload(array('jobs' => $outjobs, 'html' => $html));
} catch (Exception $e) {
throw $e;
}
return $result;
}
示例9: get
/**
* Get the basic file info and supporting slices/tags
* $params object should be a json like
* <code>
* {
* }
* </code>
*
* @param $params
* @return RokCommon_Ajax_Result
*/
public function get($params)
{
$result = new RokCommon_Ajax_Result();
try {
$q = Doctrine_Query::create()->select('j.*')->from('RokGallery_Model_Gallery j')->orderBy('j.name DESC');
/** @var Doctrine_Collection $galleries */
$galleries = $q->execute(array(), Doctrine_Core::HYDRATE_RECORD);
$outgalleries = array();
foreach ($galleries as $gallery) {
/** @var RokGallery_Model_Gallery $gallery */
$outgalleries[] = $gallery->toJsonableArray();
}
$html = RokCommon_Composite::get('com_rokgallery.galleries')->load('default.php', array('galleries' => $galleries));
$result->setPayload(array('galleries' => $outgalleries, 'html' => $html, 'delete_slices' => RokGallery_Config::getOption(RokGallery_Config::OPTION_GALLERY_REMOVE_SLICES, 0)));
} catch (Exception $e) {
throw $e;
}
return $result;
}
示例10: get
/**
* Get the basic gallery info and supporting slices/tags
* $params object should be a json like
* <code>
* {
* 'id': 1
* }
* </code>
*
* @param $params
* @return RokCommon_Ajax_Result
*/
public function get($params)
{
$result = new RokCommon_Ajax_Result();
try {
$gallery = RokGallery_Model_GalleryTable::getSingle($params->id);
foreach ($gallery->Slices as &$slice) {
$slice->populateFilterInfo();
$slice->manipulations = RokGallery_Manipulation_Helper::prepSerializedForJson($slice->manipulations);
$slice->clearRelated('File');
$slice->Tags;
$slice->FileTags;
}
$sortable_slices = $gallery->Slices->getData();
usort($sortable_slices, array('RokGalleryAdminAjaxModelGallery', 'slice_ordering_sort'));
$html = RokCommon_Composite::get('com_rokgallery.galleryorder')->load('default.php', array('slices' => $sortable_slices));
$result->setPayload(array('gallery' => $gallery->toJsonableArray(), 'html' => $html));
} catch (Exception $e) {
throw $e;
}
return $result;
}
示例11: getXml
/**
* @return RokCommon_XMLElement
* @throws RokCommon_Config_Exception
*/
public function getXml()
{
$context = RokCommon_Composite::get(self::CONTEXT_PREFIX . $this->identifier);
if ($context) {
if ($this->searchMode == self::SEARCH_MODE_BASEDIRS) {
$ret = $context->getAll($this->filename);
} elseif ($this->searchMode == self::SEARCH_MODE_CHILDIRS) {
$ret = $context->getAllSubFiles($this->filename);
} else {
throw new RokCommon_Config_Exception(rc__('Unknown mode of %s on config', $this->searchMode));
}
ksort($ret, SORT_NUMERIC);
foreach ($ret as $priority => $files) {
foreach ($files as $file) {
$file_xml = RokCommon_Utils_XMLHelper::getXML($file, true);
RokCommon_Options::mergeNodes($this->xml, $file_xml);
}
}
}
return $this->xml;
}
示例12: 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;
}
示例13: renderGlobalHeaders
public function renderGlobalHeaders()
{
if (!self::$globalHeadersRendered) {
RokCommon_Header::addScript(RokCommon_Composite::get($this->context_base . '.assets.js')->getUrl('mootools-mobile.js'));
RokCommon_Header::addScript(RokCommon_Composite::get($this->context_base . '.assets.js')->getUrl('rokmediaqueries.js'));
RokCommon_Header::addScript(RokCommon_Composite::get($this->context_base . '.assets.js')->getUrl('roksprocket.js'));
$app = JFactory::getApplication();
$menus = $app->getMenu('site');
$active = $menus->getActive();
if ($active === null) {
$active = $menus->getDefault();
}
$ns = array();
$ns[] = "if (typeof RokSprocket == 'undefined') RokSprocket = {};";
$ns[] = "Object.merge(RokSprocket, {";
$ns[] = "\tSiteURL: '" . str_replace('&', '&', JRoute::_(JURI::root(true), true)) . "',";
$ns[] = "\tCurrentURL: '" . str_replace('&', '&', JRoute::_(JURI::current(true), true)) . "',";
$ns[] = "\tAjaxURL: '" . str_replace('&', '&', JRoute::_(JURI::root(true) . '/index.php?option=com_roksprocket&task=ajax&format=raw&ItemId=' . $active->id)) . "'";
$ns[] = "});";
RokCommon_Header::addInlineScript(implode("\n", $ns) . "\n");
self::$globalHeadersRendered = true;
}
}
示例14: renderLayoutHeaders
/**
* Called to render headers that should be included only once per Layout type used
*/
public function renderLayoutHeaders()
{
$rendered = self::$instanceHeadersRenderedTheme;
if (!isset($rendered[$this->theme]) || !$rendered[$this->theme]) {
$instance = array();
$instance[] = "window.addEvent('domready', function(){";
$instance[] = "\t\tRokSprocket.instances." . $this->theme . " = new RokSprocket." . ucfirst($this->theme) . "();";
$instance[] = "});";
RokCommon_Header::addInlineScript(implode("\n", $instance) . "\n");
self::$instanceHeadersRenderedTheme[$this->theme] = true;
}
if (!self::$instanceHeadersRendered) {
$root_assets = RokCommon_Composite::get($this->basePackage . '.assets.js');
$layout_assets = RokCommon_Composite::get($this->layoutPackage . '.assets.js');
RokCommon_Header::addScript($root_assets->getUrl('moofx.js'));
RokCommon_Header::addScript($layout_assets->getUrl('features.js'));
self::$instanceHeadersRendered = true;
}
}
示例15: 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);
}