本文整理汇总了PHP中RokCommon_Service类的典型用法代码示例。如果您正苦于以下问题:PHP RokCommon_Service类的具体用法?PHP RokCommon_Service怎么用?PHP RokCommon_Service使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RokCommon_Service类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: addInlineStyle
/**
* @param $text
*/
public static function addInlineStyle($text)
{
$container = RokCommon_Service::getContainer();
/** @var $self RokCommon_Header_Interface */
$self = $container->header;
$self->addInlineStyle($text);
}
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:10,代码来源:Header.php
示例2: convert
/**
* @static
*
* @param $original
* @return \RokCommon_Registry
*/
public static function convert($original)
{
$container = RokCommon_Service::getContainer();
/** @var $converter RokCommon_Registry_IConverter */
$converter = $container->registry_converter;
return $converter->convert($original);
}
开发者ID:TeamCodeStudio,项目名称:fpmoz,代码行数:13,代码来源:Converter.php
示例3: addInlineStyle
/**
* @param $text
* @deprecated
*/
public static function addInlineStyle($text)
{
$container = RokCommon_Service::getContainer();
/** @var $header RokCommon_IHeader */
$header = $container->header;
$header->addInlineStyle($text);
}
开发者ID:densem-2013,项目名称:exikom,代码行数:11,代码来源:Header.php
示例4: loadPlatformInstance
/**
* @throws RokCommon_Loader_Exception
* @return RokCommon_Doctrine_Platform
*/
protected function loadPlatformInstance()
{
if (!isset($this->platform_instance)) {
$container = RokCommon_Service::getContainer();
$this->platform_instance = $container->doctrine_platform;
}
}
开发者ID:networksoft,项目名称:networksoft.com.co,代码行数:11,代码来源:Doctrine.php
示例5: compile
public static function compile($lessfile, $outfile, $force = false)
{
try {
$container = RokCommon_Service::getContainer();
/** @var $cache_handler RokCommon_ICache */
$cache_handler = $container->getService('cache');
$less_file_md5 = md5($lessfile);
if ($force || !($cache = $cache_handler->get(self::CACHE_GROUP, $less_file_md5))) {
$cache = $lessfile;
}
$new_cache = RokCommon_Less_Compiler::cexecute($cache);
if (!is_array($cache) || $new_cache['updated'] > $cache['updated']) {
$cache_handler->set(self::CACHE_GROUP, $less_file_md5, $new_cache);
$tmp_ouput_file = tempnam(dirname($outfile), 'rokcommon_less');
file_put_contents($tmp_ouput_file, $new_cache['compiled']);
// Do the messed up file renaming for windows
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$move_old_file_name = tempnam(dirname($outfile), 'rokcommon_less');
if (is_file($outfile)) {
@rename($outfile, $move_old_file_name);
}
@rename($tmp_ouput_file, $outfile);
@unlink($move_old_file_name);
} else {
@rename($tmp_ouput_file, $outfile);
}
}
} catch (Exception $ex) {
echo "lessphp fatal error: " . $ex->getMessage();
}
}
开发者ID:TeamCodeStudio,项目名称:fpmoz,代码行数:31,代码来源:Less.php
示例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 $provider_id => $provider_info) {
/** @var $provider RokSprocket_IProvider */
$provider_class = $container[sprintf('roksprocket.providers.registered.%s.class', $provider_id)];
$available = call_user_func(array($provider_class, 'isAvailable'));
if ($available) {
//if ($this->value == $provider_id) $selected = ' selected="selected"'; else $selected = "";
$tmp = JHtml::_('select.option', $provider_id, $provider_info->displayname);
// Set some option attributes.
$tmp->attr = array('rel' => $fieldname . '_' . $provider_id);
$tmp->icon = 'provider ' . $provider_id;
$options[] = $tmp;
}
}
reset($options);
return $options;
}
开发者ID:TeamCodeStudio,项目名称:fpmoz,代码行数:31,代码来源:providerselection.php
示例7: 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();
/** @var $model RokSprocket_Model_Widgets */
$model = $container->getService('roksprocket.widgets.model');
$widgets = $model->getAvailableInstances();
$fieldname = $this->element['name'];
$options = array();
$options[] = RokCommon_HTML_SelectList::option('', rc__('- Select RokSprocket Widget -'));
foreach ($widgets as $info) {
if ($this->value == $info['id']) {
$selected = ' selected="selected"';
} else {
$selected = "";
}
$tmp = RokCommon_HTML_SelectList::option($info['id'], $info['title']);
$options[] = $tmp;
}
$options = array_merge(parent::getOptions(), $options);
foreach ($options as &$option) {
// Set some option attributes.
$option->attr = array('class' => $option->value, 'rel' => $fieldname . '_' . $option->value);
}
reset($options);
return $options;
}
开发者ID:densem-2013,项目名称:exikom,代码行数:32,代码来源:widgetinstancepicker.php
示例8: 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'];
$options = array();
if (isset($this->element['configkey'])) {
$configkey = (string) $this->element['configkey'];
$params = $container[$configkey];
foreach ($params as $id => $info) {
if ($this->value == $id) {
$selected = ' selected="selected"';
} else {
$selected = "";
}
$tmp = RokCommon_HTML_SelectList::option($id, $info->displayname);
$options[] = $tmp;
}
}
$options = array_merge(parent::getOptions(), $options);
foreach ($options as &$option) {
// Set some option attributes.
$option->attr = array('class' => $option->value, 'rel' => $fieldname . '_' . $option->value);
}
reset($options);
return $options;
}
开发者ID:densem-2013,项目名称:exikom,代码行数:32,代码来源:containerlist.php
示例9: 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'];
$provider = (string) $this->element['provider'];
$populator = (string) $this->element['populator'];
$options = array();
/** @var $provider RokSprocket_IProvider */
$provider_class = $container[sprintf('roksprocket.providers.registered.%s.class', $provider)];
$available = call_user_func(array($provider_class, 'isAvailable'));
if ($available) {
if (method_exists($provider_class, $populator)) {
$provider_options = call_user_func(array($provider_class, $populator));
foreach ($provider_options as $provider_option_value => $provider_option_label) {
//if ($this->value == $provider_option_value) $selected = ' selected="selected"'; else $selected = "";
$tmp = RokCommon_HTML_SelectList::option($provider_option_value, $provider_option_label);
// Set some option attributes.
$tmp->attr = array('rel' => $fieldname . '_' . $provider_option_value);
//$tmp->icon = 'provider ' . $provider_id;
$options[] = $tmp;
}
}
}
reset($options);
return $options;
}
开发者ID:densem-2013,项目名称:exikom,代码行数:32,代码来源:providerbasedlist.php
示例10: ajax
/**
*
*/
public function ajax()
{
$app = JFactory::getApplication();
$input = $app->input;
try {
$container = RokCommon_Service::getContainer();
foreach ($container['roksprocket.layouts'] as $layout) {
if (isset($layout->paths) && isset($layout->ajax->dir)) {
$paths = $layout->paths;
$ajax_dir = $layout->ajax->dir;
foreach ($paths as $priority => $path) {
$ajax_path = $path . '/' . $ajax_dir;
if (is_dir($ajax_path)) {
RokCommon_Ajax::addModelPath($ajax_path, 'RokSprocketSiteLayoutAjaxModel', $priority);
}
}
}
}
$model = $input->get('model', null, 'word');
$action = $input->get('model_action', $input->get('action', null, 'word'), 'word');
if (isset($_REQUEST['params'])) {
$params = RokCommon_Ajax::smartStripSlashes($_REQUEST['params']);
}
echo RokCommon_Ajax::run($model, $action, $params);
} catch (Exception $e) {
$result = new RokCommon_Ajax_Result();
$result->setAsError();
$result->setMessage($e->getMessage());
echo json_encode($result);
}
}
开发者ID:networksoft,项目名称:networksoft.com.co,代码行数:34,代码来源:controller.php
示例11: addNewItem
/**
* @param $module_id
*
* @return bool
*/
public static function addNewItem($module_id)
{
$container = RokCommon_Service::getContainer();
/** @var RokSprocket_Provider_Simple_Storage_Interface $storage */
$storage = $container->getService('roksprocket.provider.simple_storage');
return $storage->addNewItem($module_id);
}
开发者ID:TeamCodeStudio,项目名称:fpmoz,代码行数:12,代码来源:Simple.php
示例12:
/**
* @param string $model
*
* @return RokCommon_Ajax_Model
*/
protected static function &getModel($model)
{
$container = RokCommon_Service::getContainer();
/** @var $ajaxModelLoader RokCommon_ClassLoader_PrefixedLoader */
$ajaxModelLoader = $container->getService('ajax.model.loader');
$model = $ajaxModelLoader->getItem($model, null, 'RokCommon_Ajax_Model');
return $model;
}
开发者ID:networksoft,项目名称:networksoft.com.co,代码行数:13,代码来源:Ajax.php
示例13: display
/**
* Display the view
*/
public function display($tpl = null)
{
JHTML::_('behavior.mootools');
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 */
$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=" . JRequest::getString('option') . "&task=ajax&format=raw';" . $load_more_script);
RokCommon_Header::addStyle($siteURL . '/components/com_roksprocket/fields/filters/css/datepicker.css');
parent::display($tpl);
}
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:61,代码来源:view.html.php
示例14: addPath
/**
* @param $path
* @param $prefix
* @param int $priority
*/
public function addPath($path, $prefix, $priority = self::DEFAULT_PATH_PRIORITY)
{
$container = RokCommon_Service::getContainer();
if (!$container->hasParameter($this->classpath_key)) {
$container->setParameter($this->classpath_key, new stdClass());
}
$container->setParameter($this->classpath_key . '.' . $prefix . '.' . $priority, array($path));
$this->clearChecked();
}
开发者ID:densem-2013,项目名称:exikom,代码行数:14,代码来源:PrefixedLoader.php
示例15: __construct
/**
* @param null|SimpleXMLElement $xmlnode
* @param null $renderer
*/
public function __construct(SimpleXMLElement &$xmlnode = null, $renderer = null)
{
$this->container = RokCommon_Service::getContainer();
$this->xmlnode = $xmlnode;
$this->initializeSelections();
if (null != $renderer) {
$this->selectRenderer = $renderer;
}
}
开发者ID:densem-2013,项目名称:exikom,代码行数:13,代码来源:Type.php
示例16: __construct
/**
* @param string $identifier the identifier for the options
* @param string $filename
* @param string $joinmode
* @param string $searchmode
*/
public function __construct($identifier, $filename, $joinmode = self::JOIN_MODE_MERGE, $searchmode = self::SEARCH_MODE_BASEDIRS)
{
$this->identifier = $identifier;
$this->container = RokCommon_Service::getContainer();
$this->logger = $this->container->logger;
$this->joinMode = $joinmode;
$this->searchMode = $searchmode;
$this->xml = new RokCommon_XMLElement('<config/>');
$this->filename = $filename;
}
开发者ID:TeamCodeStudio,项目名称:fpmoz,代码行数:16,代码来源:Section.php
示例17: __toString
/**
* Magic function to render this object as a string using default args of toString method.
* @return string
*/
public function __toString()
{
try {
return $this->toString();
} catch (Exception $e) {
$container = RokCommon_Service::getContainer();
$logger = $container->logger;
$logger->error($e->getMessage());
return '';
}
}
开发者ID:densem-2013,项目名称:exikom,代码行数:15,代码来源:Registry.php
示例18: __construct
/**
* @param string $provider_name
*/
public function __construct($provider_name = 'unsupported')
{
$this->container = RokCommon_Service::getContainer();
$this->provider_name = $provider_name;
$this->filter_file = $this->container['roksprocket.providers.registered.' . $provider_name . '.path'] . '/' . $this->container['roksprocket.providers.registered.' . $provider_name . '.filter.file'];
if (!file_exists($this->filter_file)) {
throw new Exception(rc__('Unable to find filter file for %1s at path %2s.', $provider_name, $this->filter_file));
}
$xmlfile = simplexml_load_file($this->filter_file);
$this->filter = new RokCommon_Filter($xmlfile);
}
开发者ID:densem-2013,项目名称:exikom,代码行数:14,代码来源:Provider.php
示例19: rc_n
/**
* @param $string
* @param $n
*
* @return string
*/
function rc_n($string, $n)
{
try {
$container = RokCommon_Service::getContainer();
$i18n = $container->i18n;
$args = func_get_args();
return call_user_func_array(array($i18n, 'translatePlural'), $args);
} catch (RokCommon_Loader_Exception $le) {
//TODO: log a failure to load a translation driver
return $string;
}
}
开发者ID:networksoft,项目名称:networksoft.com.co,代码行数:18,代码来源:functions.php
示例20: run
/**
* @param $action
* @param $params
*
* @throws Exception
* @throws RokCommon_Ajax_Exception
* @return RokCommon_Ajax_Result
*/
public function run($action, $params)
{
$result = parent::run($action, $params);
$payload = $result->getPayload();
if (isset($payload['html'])) {
$container = RokCommon_Service::getContainer();
/** @var $helper RokSprocket_PlatformHelper */
$helper = $container->roksprocket_platformhelper;
$payload['html'] = $helper->cleanup($payload['html']);
}
$result->setPayload($payload);
return $result;
}
开发者ID:TeamCodeStudio,项目名称:fpmoz,代码行数:21,代码来源:AbstractAjaxRenderingLayoutModel.php
注:本文中的RokCommon_Service类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论