本文整理汇总了PHP中JRegistry::loadObject方法的典型用法代码示例。如果您正苦于以下问题:PHP JRegistry::loadObject方法的具体用法?PHP JRegistry::loadObject怎么用?PHP JRegistry::loadObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRegistry
的用法示例。
在下文中一共展示了JRegistry::loadObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItem
public function getItem($pk = null)
{
$storeId = md5(__METHOD__);
if (!isset($this->cache[$storeId])) {
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('config_params');
$query->from('#__judownload_categories');
$query->where('parent_id = 0');
$query->where('level = 0');
$db->setQuery($query);
$config_params = $db->loadResult();
$registry = new JRegistry();
$registry->loadString($config_params);
$globalConfig = $registry->toObject();
foreach ($globalConfig as $key => $value) {
if (is_object($value)) {
$registry = new JRegistry();
$registry->loadObject($value);
$globalConfig->{$key} = $registry->toArray();
}
}
$this->cache[$storeId] = $globalConfig;
}
return $this->cache[$storeId];
}
示例2: getOptions
/**
* getOptions
*
* Generates list options
*
* @return array The field option objects.
* @since 1.6
*/
protected function getOptions()
{
$obj = $this->form->getValue('params');
$params = new JRegistry();
$params->loadObject($obj);
$apiKey = $params->get('googlewebfontapikey');
if ($apiKey) {
$link = 'https://www.googleapis.com/webfonts/v1/webfonts?key=' . $apiKey;
} else {
$link = 'https://www.googleapis.com/webfonts/v1/webfonts';
}
$json = @file_get_contents($link);
$data = json_decode($json, TRUE);
$items = $data['items'];
$options = array();
if ($items) {
$options[] = JHtml::_('select.option', '', '- None Selected -');
foreach ($items as $item) {
$options[] = JHtml::_('select.option', str_replace(" ", "+", $item['family']), $item['family']);
}
} else {
$options[] = JHtml::_('select.option', '', 'Google Web Font API Not Available');
}
return $options;
}
示例3: JRegistry
/**
* Gets a reference to the cache object, loading it from the disk if
* needed.
*
* @param boolean $force Should I forcibly reload the registry?
*
* @return JRegistry
*/
private function &getCacheObject($force = false)
{
// Check if we have to load the cache file or we are forced to do that
if (is_null($this->_cache) || $force) {
// Create a new JRegistry object
JLoader::import('joomla.registry.registry');
$this->_cache = new JRegistry();
// Try to get data from Joomla!'s cache
$cache = JFactory::getCache('fof', '');
$data = $cache->get('cache', 'fof');
// If data is not found, fall back to the legacy (F0F 2.1.rc3 and earlier) method
if ($data === false) {
// Find the path to the file
$cachePath = JPATH_CACHE . '/fof';
$filename = $cachePath . '/cache.php';
$filesystem = $this->getIntegrationObject('filesystem');
// Load the cache file if it exists. JRegistryFormatPHP fails
// miserably, so I have to work around it.
if ($filesystem->fileExists($filename)) {
@(include_once $filename);
$filesystem->fileDelete($filename);
$className = 'F0FCacheStorage';
if (class_exists($className)) {
$object = new $className();
$this->_cache->loadObject($object);
$options = array('class' => 'F0FCacheStorage');
$cache->store($this->_cache, 'cache', 'fof');
}
}
} else {
$this->_cache = $data;
}
}
return $this->_cache;
}
示例4: loadConfiguration
/**
* Load an object or array into the application configuration object.
*
* @param mixed $data Either an array or object to be loaded into the configuration object.
*
* @return void
*
* @since 11.1
*/
public function loadConfiguration($data)
{
// Load the data into the configuration object.
if (is_array($data)) {
$this->config->loadArray($data);
} elseif (is_object($data)) {
$this->config->loadObject($data);
}
}
示例5: save
public static function save($path)
{
$result = array();
if(empty($path)){
return self::error(JText::_('T3_TM_UNKNOWN_THEME'));
}
$theme = JFactory::getApplication()->input->getCmd('theme');
$from = JFactory::getApplication()->input->getCmd('from');
if (!$theme) {
return self::error(JText::_('T3_TM_INVALID_DATA_TO_SAVE'));
}
$file = $path . '/less/themes/' . $theme . '/variables-custom.less';
if(!class_exists('JRegistryFormatLESS')){
T3::import('format/less');
}
$variables = new JRegistry();
$variables->loadObject($_POST);
$data = $variables->toString('LESS');
$type = 'new';
if (JFile::exists($file)) {
$type = 'overwrite';
} else {
if(JFolder::exists($path . '/less/themes/' . $from)){
if(@JFolder::copy($path . '/less/themes/' . $from, $path . '/less/themes/' . $theme) != true){
return self::error(JText::_('T3_TM_NOT_FOUND'));
}
} else if($from == 'base') {
$dummydata = "";
@JFile::write($path . '/less/themes/' . $theme . '/template.less', $dummydata);
@JFile::write($path . '/less/themes/' . $theme . '/variables.less', $dummydata);
@JFile::write($path . '/less/themes/' . $theme . '/template-responsive.less', $dummydata);
}
}
$return = @JFile::write($file, $data);
if (!$return) {
return self::error(JText::_('T3_TM_OPERATION_FAILED'));
} else {
$result['success'] = JText::sprintf('T3_TM_SAVE_SUCCESSFULLY', $theme);
$result['theme'] = $theme;
$result['type'] = $type;
}
//LessHelper::compileForTemplate(T3_TEMPLATE_PATH, $theme);
T3::import ('core/less');
T3Less::compileAll($theme);
return self::response($result);
}
示例6: onAfterDispatch
public function onAfterDispatch()
{
if (JFactory::getApplication()->isAdmin()) {
return true;
}
$input = JFactory::getApplication()->input;
$extension = $input->get('option', '', 'cmd');
$view = $input->get('view', '', 'cmd');
$categories = $input->get('categories', array(), 'array');
$category_id = count($categories) == 1 ? array_shift($categories) : null;
if ($extension !== 'com_ksenmart') {
return true;
}
if (JFactory::getDocument()->getType() !== 'html' || $input->get('tmpl', '', 'cmd') === 'ksenmart') {
return true;
}
$doc = JFactory::getDocument();
$renderer = $doc->loadRenderer('module');
$modules = $this->params->get('modules', new stdClass());
foreach ($modules as $position => $mods) {
$attribs = array('name' => $position);
$buf = $doc->getBuffer('modules', $position, $attribs);
foreach (JModuleHelper::getModules($position) as $mod) {
foreach ($mods as $mod_id => $mod_params) {
$registry = new JRegistry();
$mod_params = $registry->loadObject($mod_params);
$categories = $mod_params->get('categories', array());
$pages = $mod_params->get('pages', array());
if ($mod->id == $mod_id) {
if ($view == 'catalog' && !empty($category_id)) {
if (in_array(-1, $categories) || !in_array($category_id, $categories) && !in_array(0, $categories)) {
$moduleHtml = $renderer->render($mod, $attribs, null);
$buf = str_replace($moduleHtml, '', $buf);
}
} else {
$page_id = 0;
foreach ($this->pages as $key => $page) {
if ($page == $view) {
$page_id = $key;
}
}
if (in_array(-1, $pages) || !in_array($page_id, $pages) && !in_array(0, $pages)) {
$moduleHtml = $renderer->render($mod, $attribs, null);
$buf = str_replace($moduleHtml, '', $buf);
}
}
}
}
}
$doc->setBuffer($buf, 'modules', $position);
}
return true;
}
示例7: getInput
public function getInput()
{
if (!defined('YJSGRUN')) {
echo '<h1 style="color:red;">' . JText::_('YJSG_PLUGIN_NOT_FOUND') . '</h1>';
return;
}
$document = YjsgDochead::getDocument();
$document->addJsInhead("var comp_dis ='" . JText::_('YJSG_COMPONENT_DISABLED') . "';");
$yjsg = Yjsg::getInstance();
$YjsgCurrentVersion = $yjsg->version;
$YjsgHasUpdate = $yjsg->hasupdate;
$YjsgLatestVersion = $yjsg->getUpdateVersion();
$template_folder = basename(dirname(dirname(__FILE__)));
$params_obj = $this->form->getValue('params');
$params = new JRegistry();
$params->loadObject($params_obj);
$comp_dis = '<div id="option-resut">';
if ($params->get('component_switch')) {
$comp_dis .= JText::_('YJSG_COMPONENT_DISABLED');
}
$comp_dis .= '</div>';
$yjsgManageLink = 'index.php?option=com_plugins&view=plugins&filter_folder=system&filter_search=Yjsg';
$yjsgText = '' . JText::_('YJSG_INS_PUB') . " <strong>v" . $YjsgCurrentVersion . "</strong> " . JText::_('YJSG_INS_PUB2') . ' <a href="' . $yjsgManageLink . '">' . JText::_('YJSC_MAN_EXT') . '</a>';
if ($YjsgHasUpdate == 1) {
$updateclass = ' updateavailable';
} else {
$updateclass = '';
}
// yjsg
$syshtml = '<div class="yj_system_check">';
$syshtml .= '<div id="yjsgBox" class="systemBox' . $updateclass . '">';
$syshtml .= '<h2 id="yjmmpTitle" class="systemBoxTitle yjsgtips" data-original-title="' . JText::_('YJSG_CHECK') . '" data-content="' . JText::_('YJSG_CHECK_TIP') . '">' . JText::_('YJSG_CHECK') . '</h2>';
if ($YjsgHasUpdate == 1) {
$syshtml .= '<div class="infoText"><span class="showIcon"></span> ';
$syshtml .= JText::_('UPDATE_AVAILABLE_TEXT') . '<strong>' . $YjsgCurrentVersion . '</strong>';
$syshtml .= JText::_('UPDATE_AVAILABLE_TEXT2') . '<strong>' . $YjsgLatestVersion . '</strong>';
$syshtml .= '<a href="index.php?option=com_installer&view=update">' . JText::_('UPDATE_AVAILABLE_TEXT3') . '</a>';
$syshtml .= '</div>';
} else {
$syshtml .= '<div class="infoText"><span class="showIcon"></span>' . $yjsgText . '</div>';
}
$syshtml .= '</div>';
$syshtml .= '<div id="settmsgBox" class="systemBox hide">';
$syshtml .= '<h2 id="yjjbpTitle" class="systemBoxTitle yjsgtips" data-original-title="' . JText::_('YJSG_SETT_MSG') . '" data-content="' . JText::_('YJSG_SETT_MSG_TIP') . '">' . JText::_('YJSG_SETT_MSG') . '</h2>';
$syshtml .= '<div class="infoText"><span class="showIcon"></span>' . $comp_dis . '</div>';
$syshtml .= '</div>';
$syshtml .= '</div>';
// close yj_system_check
// Output
echo $syshtml;
}
示例8: request
/**
*
* Ajax request set/get data
*/
public function request()
{
$data = new JRegistry();
$dataFromRequest = JRequest::getVar('data', '');
$data->loadObject(json_decode($dataFromRequest));
if ($data->get('requestTask', '') == 'brankNewData') {
JSNFactory::localimport('libraries.joomlashine.mode.rawmode');
$jsnrawmode = JSNRawmode::getInstance($data->toArray());
$jsnrawmode->renderComponent();
echo $jsnrawmode->getHTML('component');
jexit();
}
$params = $data->get('params', array());
if (is_object($params)) {
$params = (array) $params;
}
if ($data->get('prefix_params', false)) {
$prefixId = 0;
$_params = array();
foreach ($params as $key => $val) {
$suffixs = explode('_', $key);
$number = (int) $suffixs[count($suffixs) - 1];
if (!$prefixId) {
$prefixId = $number;
}
$_params[str_replace('_' . $number, '', $key)] = $val;
}
$params = $_params;
}
$jsnConfig = JSNFactory::getConfig();
// Execute saveParams event if option is supported ext
JSNPaExtensionsHelper::executeExtMethod(str_ireplace('com_', '', $data->get('option')), 'saveParams', array('data' => $data, 'jsnConfig' => $jsnConfig, 'params' => $params));
switch ($data->get('requestType', 'only')) {
case 'only':
$jsnConfig->menuitem($data->get('Itemid', ''), $params);
break;
case 'globally':
//Set global config
$jsnConfig->extension($data->get('option', ''), $params);
foreach ($params as $k => $param) {
$params[$k] = '';
}
//Set for menu article layout
$allMenuitems = $this->getModel('menuitem')->getAllItems(array('option' => $data->get('option', $data->get('option')), 'view' => $data->get('view', 'article'), 'layout' => $data->get('layout', '')));
foreach ($allMenuitems as $item) {
$jsnConfig->menuitem($item->id, $params);
}
break;
}
jexit('success');
}
示例9: addChannel
public function addChannel($channel)
{
$channelId = trim($channel);
$row = JTable::getInstance('Channel', 'Table');
$row->load($channelId);
if ($row->published) {
$options = new JRegistry();
$options->loadObject($row->attribs);
$channel = JFBCFactory::provider($row->provider)->channel($row->type, $options);
// This is a bit hacky as we're temporarily saving the row to use in the addPost. Should be handling this better.
$this->currentRow = $row;
$channel->getStream($this);
}
}
示例10: addItem
public function addItem()
{
$app = JFactory::getApplication();
$model = $this->getModel('Carts', 'J2StoreModel');
$result = $model->addCartItem();
$registry = new JRegistry();
if (is_object($result)) {
$registry->loadObject($result);
$json = $registry->toArray();
} elseif (is_array($result)) {
$json = $result;
} else {
$json = $result;
}
$config = J2Store::config();
$cart_url = $model->getCartUrl();
//if javascript submissions is not enabled
$ajax = $app->input->getInt('ajax', 0);
if ($ajax) {
if (isset($json['success'])) {
if ($config->get('addtocart_action', 3) == 3) {
$json['redirect'] = $cart_url;
}
}
$json['product_redirect'] = JRoute::_('index.php?option=com_j2store&view=product&id=' . $this->input->getInt('product_id'));
echo json_encode($json);
$app->close();
} else {
$return = $app->input->getBase64('return');
if (!is_null($return)) {
$return_url = base64_decode($return);
} else {
$return_url = $cart_url;
}
if ($json['success']) {
$this->setRedirect($cart_url, JText::_('J2STORE_ITEM_ADDED_TO_CART'), 'success');
} elseif ($json['error']) {
$error = J2Store::utilities()->errors_to_string($json['error']);
$this->setRedirect($return_url, $error, 'error');
} else {
$this->setRedirect($return_url);
}
}
}
示例11: ajaxCreatePost
public function ajaxCreatePost()
{
if (JFactory::getUser()->authorise('jfbconnect.channels.post', 'com_jfbconnect')) {
$response = array();
$input = JFactory::getApplication()->input;
$message = $input->post->getString('message');
$link = $input->post->getString('link');
$cids = $input->post->get('cids', array(), 'array');
if (empty($cids)) {
$response[] = JText::_('COM_JFBCONNECT_CHANNELS_SELECT_CHANNEL_LABEL');
}
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_jfbconnect/tables/');
$row = JTable::getInstance('Channel', 'Table');
foreach ($cids as $cid) {
$row->load($cid);
$options = new JRegistry();
$options->loadObject($row->attribs);
$channel = JFBCFactory::provider($row->provider)->channel($row->type, $options);
$post = new JRegistry();
$post->set('message', $message);
$post->set('link', $link);
try {
$return = $channel->post($post);
} catch (Exception $e) {
$return = false;
}
if (!$return) {
$response[] = JText::sprintf('COM_JFBCONNECT_CHANNELS_POST_FAILED_LABEL', $row->provider, $row->type);
} else {
$response[] = $return;
}
}
echo implode("<br/>", $response);
}
exit;
}
示例12: getTheme
private function getTheme()
{
static $theme;
if (!isset($theme)) {
$query = $this->_db->getQuery(true);
$query->select(' jth.name AS theme ');
$query->select(' jth.params ');
$query->from(' #__joaktree_trees jte ');
$query->innerJoin(' #__joaktree_themes jth ' . ' ON (jth.id = jte.theme_id) ');
$query->where(' jte.id = ' . (int) $this->params['tree_id'] . ' ');
// retrieve the name
$this->_db->setQuery($query);
$tmp = $this->_db->loadObject();
$theme = new JRegistry();
// load parameters into registry object
$theme->loadString($tmp->params, 'JSON');
unset($tmp->params);
// load the rest of the object into registry object
$theme->loadObject($tmp);
}
return $theme;
}
示例13: beforeLoad
function beforeLoad(&$params)
{
//lets create JS object
$javascript = new JCKJavascript();
if ($this->_overwrite) {
$javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\r\n\t\t\t\t{\r\n\t\t\t\t\teditor.config.plugins = 'html5support,' + editor.config.plugins\r\n\t\t\t\t\tif(editor.config.extraPlugins)\r\n\t\t\t\t\t\teditor.config.extraPlugins += ',video,audio,uicolor,imagedragndrop,ie9selectionoverride';\r\n\t\t\t\t\telse \t\r\n\t\t\t\t\t\teditor.config.extraPlugins += 'video,audio,uicolor,imagedragndrop,ie9selectionoverride';\r\n\t\t\t\t\r\n\t\t\t\t\tif(editor.config.toolbar == 'Full')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar toolbar = editor.config.toolbar_Full[editor.config.toolbar_Full.length-1];\r\n\t\t\t\t\t\tvar extra = ['Video','Audio','UIColor'];\r\n\t\t\t\t\t\teditor.config.toolbar_Full[editor.config.toolbar_Full.length-1] = toolbar.concat(extra);\r\n\t\t\t\t\t}\t\r\n\t\t\t\t});");
}
$config = JFactory::getConfig();
$dbname = $config->get('db');
$db = JFactory::getDBO();
$query = "SELECT COUNT(1)\r\n\t\tFROM information_schema.tables \r\n\t\tWHERE table_schema = '" . $dbname . "' \r\n\t\tAND table_name = '" . $db->getPrefix() . "jcktoolbarplugins'";
$db->setQuery($query);
if (!$db->loadResult()) {
return $javascript->toRaw();
}
$query = "SELECT COUNT(p.id) AS pcount,COUNT(tp.pluginid) AS tpcount FROM #__jckplugins p\r\n\t\tLEFT JOIN #__jcktoolbarplugins tp on tp.pluginid = p.id\r\n\t\tWHERE `name` IN('html5support','video','audio','uicolor') ";
$db->setQuery($query);
$info = $db->loadObject();
if ($info && $info->tpcount) {
return;
}
if (!$info->pcount) {
$query = "INSERT INTO #__jckplugins (`title`,`name`,`type`,`row`,`published`,`editable`,`icon`,`iscore`,`params`, `parentid`) VALUES \r\n\t\t\t('','html5support','plugin',0,1,1,'',1,'',NULL)";
$db->setQuery($query);
if (!$db->query()) {
return $javascript->toRaw();
}
$parentid = $db->insertid();
$query = "INSERT INTO #__jckplugins (`title`,`name`,`type`,`row`,`published`,`editable`,`icon`,`iscore`,`params`, `parentid`) VALUES \r\n ('Video','video','plugin',3,1,1,'images/icon.png',1,''," . $parentid . "),\t\r\n ('Audio','audio','plugin',3,1,1,'images/icon.png',1,''," . $parentid . "),\t\r\n ('UIColor','uicolor','plugin',3,1,1,'uicolor.gif',1,'',NULL),\t\r\n ('','imagedragndrop','plugin',0,1,1,'',1,'',NULL),\r\n\t\t\t('','ie9selectionoverride','plugin',0,1,1,'',1,'',NULL)";
$db->setQuery($query);
if (!$db->query()) {
return $javascript->toRaw();
}
$first = $db->insertid();
$last = $first + 2;
//get next layout row details
$query = "SELECT row as rowid,MAX(`ordering`) +1 AS rowordering FROM #__jcktoolbarplugins WHERE toolbarid = 1 \r\n GROUP BY row\r\n ORDER BY row DESC LIMIT 1";
$db->setQuery($query);
$rowDetail = $db->loadObject();
$values = array();
for ($i = $first; $i <= $last; $i++) {
$values[] = '(1,' . $i . ',' . $rowDetail->rowid . ',' . $rowDetail->rowordering++ . ',1)';
}
$query = "INSERT INTO #__jcktoolbarplugins(toolbarid,pluginid,row,ordering,state) VALUES " . implode(",", $values);
$db->setQuery($query);
$db->query();
}
if ($this->_overwrite) {
//Get toolbar plugins object
jckimport('ckeditor.plugins');
jckimport('ckeditor.plugins.toolbarplugins');
$plugins = new JCKtoolbarPlugins();
foreach (get_object_vars($plugins) as $key => $value) {
if (strpos('p' . $key, '_')) {
unset($plugins->{$key});
}
}
$plugins->html5support = 1;
$plugins->video = 1;
$plugins->audio = 1;
$plugins->uicolor = 1;
$plugins->imagedragndrop = 1;
$plugins->ie9selectionoverride = 1;
$config = new JRegistry('config');
$config->loadObject($plugins);
$cfgFile = '';
$is1_6plus = file_exists(JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'jckeditor' . DS . 'includes' . DS . 'ckeditor');
if ($is1_6plus) {
$cfgFile = JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'jckeditor' . DS . 'includes' . DS . 'ckeditor' . DS . 'plugins' . DS . 'toolbarplugins.php';
} else {
$cfgFile = JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'includes' . DS . 'ckeditor' . DS . 'plugins' . DS . 'toolbarplugins.php';
}
// Get the config registry in PHP class format and write it to file
if ($is1_6plus) {
if (!JFile::write($cfgFile, $config->toString('PHP', array('class' => 'JCKToolbarPlugins extends JCKPlugins')))) {
return $javascript->toRaw();
}
//if fail then bail out
} else {
if (!JFile::write($cfgFile, $config->toString('PHP', 'config', array('class' => 'JCKToolbarPlugins extends JCKPlugins')))) {
return $javascript->toRaw();
}
//if fail then bail out
}
jckimport('ckeditor.toolbar');
jckimport('ckeditor.toolbar.full');
$toolbar = new JCKFull();
//fix toolbar values or they will get wiped out
foreach (get_object_vars($toolbar) as $k => $v) {
if (is_null($v)) {
$toolbar->{$k} = '';
}
if ($k[0] == '_') {
$toolbar->{$k} = NULL;
}
}
if (isset($toolbar->Video) || isset($toolbar->Audio) || isset($toolbar->UIColor)) {
return false;
}
$toolbar->Video = '';
//.........这里部分代码省略.........
示例14: testLoadObject
/**
* Test the JRegistry::loadObject method.
*
* @covers JRegistry::loadObject
*
* @return void
*/
public function testLoadObject()
{
$object = new stdClass();
$object->foo = 'testloadobject';
$registry = new JRegistry();
$result = $registry->loadObject($object);
// Result is always true, no error checking in method.
// Test getting a known value.
$this->assertThat($registry->get('foo'), $this->equalTo('testloadobject'), 'Line: ' . __LINE__ . '.');
// Test case from Tracker Issue 22444
$registry = new JRegistry();
$object = new JObject();
$object2 = new JObject();
$object2->set('test', 'testcase');
$object->set('test', $object2);
$this->assertTrue($registry->loadObject($object), 'Line: ' . __LINE__ . '. Should load object successfully');
}
示例15: getMenuContent
function getMenuContent($S5row)
{
global $flexmv;
//return "<li><a href='#'>".$row->name."</a></li>";
//silviu module code - start
//$S5_menu_items_params = new JParameter( $S5row->params );
$S5_menu_items_params = new JRegistry();
if ($flexmv <= 2.5) {
$S5_menu_items_params->loadJSON($S5row->params);
} else {
$S5_menu_items_params->loadObject($S5row->params);
}
$S5_load_mod = $S5_menu_items_params->get($flexmv <= 2.5 ? 's5_load_mod' : 'data.s5_load_mod');
$S5_subtext = $S5_menu_items_params->get($flexmv <= 2.5 ? 's5_subtext' : 'data.s5_subtext');
//retrieve the parent params
//$S5_parent_items_params = new JParameter( $parent_params );
$s5_group_child = $S5_menu_items_params->get($flexmv <= 2.5 ? 's5_group_child' : 'data.s5_group_child', 0);
$S5_mod_array_orig = $S5_menu_items_params->get($flexmv <= 2.5 ? 's5_position' : 'data.s5_position');
if (!is_array($S5_mod_array_orig)) {
$S5_mod_array = array($S5_mod_array_orig);
} else {
$S5_mod_array = $S5_mod_array_orig;
}
//recreate the menu content with link on it
//after that remove the link so the module content won't have link on it
//$router = JSite::getRouter();
//$S5row->url = $router->getMode() == JROUTER_MODE_SEF ? 'index.php?Itemid='.$S5row->id : $S5row->link.'&Itemid='.$S5row->id;
$S5row->url = $S5row->flink;
if ($S5row->type == "separator") {
$S5row->url = $S5row->link . 'javascript:;';
//$router->getMode() == JROUTER_MODE_SEF ? 'index.php?Itemid='.$pitem->id : $pitem->link.'javascript:;';
}
$tmp = $S5row;
//$iParams = new JParameter($tmp->params);
$iParams = new JRegistry();
if ($flexmv <= 2.5) {
$iParams->loadJSON($tmp->params);
} else {
$iParams->loadObject($tmp->params);
}
if ($iParams->get($flexmv <= 2.5 ? 'menu_image' : 'data.menu_image') && $iParams->get($flexmv <= 2.5 ? 'menu_image' : 'data.menu_image') != -1) {
switch ($iParams->get($flexmv <= 2.5 ? 'menu_images_align' : 'data.menu_images_align', 0)) {
case 0:
$imgalign = 'float:left;';
break;
case 1:
$imgalign = 'float:right;';
break;
default:
$imgalign = 'float:left;';
break;
}
switch ($tmp->browserNav) {
default:
case 0:
// _top
$image = '<span class="s5_img_span"><img style="' . $imgalign . 'cursor:pointer" src="' . $iParams->get($flexmv <= 2.5 ? 'menu_image' : 'data.menu_image') . '" onclick="window.document.location.href=\'' . $S5row->url . '\'" alt="' . $S5row->alias . '" /></span>';
break;
case 1:
// _blank
$image = '<span class="s5_img_span"><img style="' . $imgalign . 'cursor:pointer" src="' . $iParams->get($flexmv <= 2.5 ? 'menu_image' : 'data.menu_image') . '" onclick="window.open(\'' . $S5row->url . '\')" alt="' . $S5row->alias . '" /></span>';
break;
case 2:
// window.open
$image = '<span class="s5_img_span"><img style="' . $imgalign . 'cursor:pointer" src="' . $iParams->get($flexmv <= 2.5 ? 'menu_image' : 'data.menu_image') . '" onclick="window.open(\'' . $S5row->url . '\')" alt="' . $S5row->alias . '" /></span>';
break;
}
/*if($tmp->ionly){
$tmp->name = null;
}*/
} else {
$image = null;
}
/* silviu add new funcitonality to 1.7 version
* remove the menu title if param is set to 0 and menu image exists
*/
if ($iParams->get($flexmv <= 2.5 ? 'menu_image' : 'data.menu_image') && $iParams->get($flexmv <= 2.5 ? 'menu_image' : 'data.menu_image') != -1 && $iParams->get($flexmv <= 2.5 ? 'menu_text' : 'data.menu_text') == 0) {
$S5row->title = "";
}
switch ($tmp->browserNav) {
default:
case 0:
// _top
if (strstr($S5row->url, "#s5")) {
if ($S5row->title != "") {
$link_format = "<a href='#' onclick=\"s5_page_scroll('" . $S5row->url . "')\"><span class='s5_sub_a_span' onclick=\"s5_page_scroll('" . $S5row->url . "')\" >" . $S5row->title . "</span></a>";
if ($S5_subtext != "") {
$parent_subtext_flex = "<span class='S5_subtext' onclick=\"s5_page_scroll('" . $S5row->url . "')\" >" . $S5_subtext . "</span>";
} else {
$parent_subtext_flex = "";
}
break;
}
} else {
$link_format = "<a href='{$S5row->url}'><span class='s5_sub_a_span' onclick='window.document.location.href=\"{$S5row->url}\"'>" . $S5row->title . "</span></a>";
if ($S5_subtext != "") {
$parent_subtext_flex = "<span class='S5_subtext' onclick='window.document.location.href=\"{$S5row->url}\"'>" . $S5_subtext . "</span>";
} else {
$parent_subtext_flex = "";
}
//.........这里部分代码省略.........