本文整理汇总了PHP中FlexicontentHelperRoute::getItemRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP FlexicontentHelperRoute::getItemRoute方法的具体用法?PHP FlexicontentHelperRoute::getItemRoute怎么用?PHP FlexicontentHelperRoute::getItemRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlexicontentHelperRoute
的用法示例。
在下文中一共展示了FlexicontentHelperRoute::getItemRoute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAssociations
/**
* Method to get the associations for a given item
*
* @param integer $id Id of the item
* @param string $view Name of the view
*
* @return array Array of associations for the item
*
* @since 3.0
*/
public static function getAssociations($id = 0, $view = null)
{
jimport('helper.route', JPATH_COMPONENT_SITE);
$app = JFactory::getApplication();
$jinput = $app->input;
$view = is_null($view) ? $jinput->get('view') : $view;
$id = empty($id) ? $jinput->getInt('id') : $id;
if ($view == 'item') {
if ($id) {
//$associations = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', $id);
$associations = FlexicontentHelperAssociation::getItemAssociations($id);
$return = array();
foreach ($associations as $tag => $item) {
$return[$tag] = FlexicontentHelperRoute::getItemRoute($item->id, $item->catid, 0, $item);
}
return $return;
}
} else {
if ($view == 'category') {
$cid = $jinput->getInt('cid');
if ($cid) {
$associations = FlexicontentHelperAssociation::getCatAssociations($cid);
$return = array();
foreach ($associations as $tag => $item) {
$return[$tag] = FlexicontentHelperRoute::getCategoryRoute($item->catid, 0, array(), $item);
}
return $return;
}
}
}
return array();
}
示例2: getLoc
public static function getLoc(&$params)
{
$catid = $params->get('catid');
$fieldaddressid = $params->get('fieldaddressid');
//var_dump ($catid);
global $globalcats;
//var_dump ($globalcats);
$catlist = !empty($globalcats[$catid]->descendants) ? $globalcats[$catid]->descendants : $catid;
$catids_join = 'JOIN #__flexicontent_cats_item_relations AS rel ON rel.itemid = a.id ';
//var_dump ($catlist);
$catids_where = ' rel.catid IN (' . $catlist . ') ';
//var_dump ($catids_where);
// recupere la connexion à la BD
if (!empty($fieldaddressid)) {
$count = $params->get('count');
$forced_itemid = $params->get('forced_itemid', '');
$db = JFactory::getDbo();
$queryLoc = 'SELECT a.id, a.title, b.field_id, b.value , a.catid FROM #__content AS a LEFT JOIN #__flexicontent_fields_item_relations AS b ON a.id = b.item_id ' . $catids_join . ' WHERE b.field_id = ' . $fieldaddressid . ' AND ' . $catids_where . ' AND state = 1 ORDER BY title ' . $count;
//var_dump ($queryLoc);
$db->setQuery($queryLoc);
$itemsLoc = $db->loadObjectList();
//var_dump ($itemsLoc);
foreach ($itemsLoc as &$itemLoc) {
$id = $itemLoc->id;
//$itemLoc->link = JRoute::_( FlexicontentHelperRoute::getItemRoute($id, $catid ) );
$itemLoc->link = JRoute::_(FlexicontentHelperRoute::getItemRoute($itemLoc->id, $itemLoc->catid, $forced_itemid, $itemLoc));
}
return $itemsLoc;
} else {
echo JText::_('FLEXI_GOOGLEMAP_ADRESSFORGOT');
}
}
示例3: getObjectLink
function getObjectLink($id)
{
require_once JPATH_ROOT . DS . 'components' . DS . 'com_flexicontent' . DS . 'helpers' . DS . 'route.php';
$db =& JFactory::getDBO();
$query = 'SELECT CASE WHEN CHAR_LENGTH(i.alias) THEN CONCAT_WS(\':\', i.id, i.alias) ELSE i.id END as slug,' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as categoryslug' . ' FROM #__content AS i' . ' LEFT JOIN #__categories AS c ON c.id = i.catid' . ' WHERE i.id = ' . $id;
$db->setQuery($query);
$row = $db->loadObject();
$link = JRoute::_(FlexicontentHelperRoute::getItemRoute($row->slug, $row->categoryslug));
return $link;
}
示例4: getObjectInfo
function getObjectInfo($id, $language = null)
{
$info = new JCommentsObjectInfo();
$routerHelper = JPATH_ROOT . '/components/com_flexicontent/helpers/route.php';
if (is_file($routerHelper)) {
require_once $routerHelper;
$db = JFactory::getDBO();
$query = 'SELECT i.id, i.title, i.access, i.created_by ' . ' , CASE WHEN CHAR_LENGTH(i.alias) THEN CONCAT_WS(\':\', i.id, i.alias) ELSE i.id END as slug' . ' , CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug' . ' FROM #__content AS i' . ' LEFT JOIN #__categories AS c ON c.id = i.catid' . ' WHERE i.id = ' . $id;
$db->setQuery($query);
$row = $db->loadObject();
if (!empty($row)) {
$info->title = $row->title;
$info->access = $row->access;
$info->userid = $row->created_by;
$info->link = JRoute::_(FlexicontentHelperRoute::getItemRoute($row->slug, $row->catslug));
}
}
return $info;
}
示例5: sendNotificationEmails
//.........这里部分代码省略.........
$body .= $tz_offset_str . "<br/>\r\n";
}
$body .= "<br/>\r\n";
// ADD INFO about category assignments
$body .= '<u>' . JText::_('FLEXI_NF_CATEGORIES_ASSIGNMENTS') . '</u>';
if (!$isnew) {
$body .= " [ " . JText::_($cats_altered ? 'FLEXI_NF_MODIFIED' : 'FLEXI_NF_UNCHANGED') . " ] : <br/>\r\n";
} else {
$body .= " : <br/>\r\n";
}
foreach ($cats_titles as $i => $cats_title) {
$body .= " " . ($i + 1) . ". " . $cats_title . "<br/>\r\n";
}
// ADD INFO for category assignments added or removed
if (!empty($cats_added_titles) && count($cats_added_titles)) {
$body .= '<u>' . JText::_('FLEXI_NF_ITEM_CATEGORIES_ADDED') . "</u> : <br/>\r\n";
foreach ($cats_added_titles as $i => $cats_title) {
$body .= " " . ($i + 1) . ". " . $cats_title . "<br/>\r\n";
}
}
if (!empty($cats_removed_titles) && count($cats_removed_titles)) {
$body .= '<u>' . JText::_('FLEXI_NF_ITEM_CATEGORIES_REMOVED') . "</u> : <br/>\r\n";
foreach ($cats_removed_titles as $i => $cats_title) {
$body .= " " . ($i + 1) . ". " . $cats_title . "<br/>\r\n";
}
}
$body .= "<br/>\r\n<br/>\r\n";
$lang = '&lang=' . substr($this->get('language'), 0, 2);
// ADD INFO for custom notify text
$subject .= ' ' . JText::_($notify_text);
// ADD INFO for view/edit link
if (in_array('viewlink', $nf_extra_properties)) {
$body .= '<u>' . JText::_('FLEXI_NF_VIEW_IN_FRONTEND') . "</u> : <br/>\r\n ";
$link = JRoute::_(JURI::root(false) . FlexicontentHelperRoute::getItemRoute($this->get('id'), $this->get('catid')) . $lang);
$body .= '<a href="' . $link . '" target="_blank">' . $link . "</a><br/>\r\n<br/>\r\n";
// THIS IS BOGUS *** for unicode menu aliases
//$body .= $link . "<br/>\r\n<br/>\r\n";
}
if (in_array('editlinkfe', $nf_extra_properties)) {
$body .= '<u>' . JText::_('FLEXI_NF_EDIT_IN_FRONTEND') . "</u> : <br/>\r\n ";
$link = JRoute::_(JURI::root(false) . 'index.php?option=com_flexicontent&view=' . FLEXI_ITEMVIEW . '&cid=' . $this->get('catid') . '&id=' . $this->get('id') . '&task=edit');
$body .= '<a href="' . $link . '" target="_blank">' . $link . "</a><br/>\r\n<br/>\r\n";
// THIS IS BOGUS *** for unicode menu aliases
//$body .= $link . "<br/>\r\n<br/>\r\n";
}
if (in_array('editlinkbe', $nf_extra_properties)) {
$body .= '<u>' . JText::_('FLEXI_NF_EDIT_IN_BACKEND') . "</u> : <br/>\r\n ";
$fc_ctrl_task = FLEXI_J16GE ? 'task=items.edit' : 'controller=items&task=edit';
$link = JRoute::_(JURI::root(false) . 'administrator/index.php?option=com_flexicontent&' . $fc_ctrl_task . '&cid=' . $this->get('id'));
$body .= '<a href="' . $link . '" target="_blank">' . $link . "</a><br/>\r\n<br/>\r\n";
// THIS IS BOGUS *** for unicode menu aliases
//$body .= $link . "<br/>\r\n<br/>\r\n";
}
// ADD INFO for introtext/fulltext
if ($params->get('nf_add_introtext')) {
//echo "<pre>"; print_r($this->_item); exit;
$body .= "<br/><br/>\r\n";
$body .= "*************************************************************** <br/>\r\n";
$body .= JText::_('FLEXI_NF_INTROTEXT_LONG') . "<br/>\r\n";
$body .= "*************************************************************** <br/>\r\n";
$body .= flexicontent_html::striptagsandcut($this->get('introtext'), 200);
}
if ($params->get('nf_add_fulltext')) {
$body .= "<br/><br/>\r\n";
$body .= "*************************************************************** <br/>\r\n";
$body .= JText::_('FLEXI_NF_FULLTEXT_LONG') . "<br/>\r\n";
示例6: getLinks
public function getLinks($args)
{
$view = isset($args->view) ? $args->view : '';
if (!($view = 'category')) {
return array();
}
require_once JPATH_SITE . DS . 'components' . DS . 'com_flexicontent' . DS . 'helpers' . DS . 'route.php';
$items = array();
$CategoryId = $args->cid;
//adding categoryes
$db =& JFactory::getDBO();
$query = $db->getQuery(true);
$query->clear();
$query->select('id, title, lft, CASE WHEN CHAR_LENGTH(alias) THEN CONCAT_WS(\':\', id, alias) ELSE id END as slug');
$query->from('#__categories');
$query->where('published = 1 AND extension = \'com_content\' AND parent_id = ' . $CategoryId);
$query->order('lft ASC');
$db->setQuery($query);
$categories = $db->loadObjectList();
foreach ($categories as $category) {
$items[] = array('url' => FlexicontentHelperRoute::getCategoryRoute($category->slug), 'id' => 'index.php?option=com_flexicontent_items&view=category&cid=' . $category->id, 'name' => $category->title, 'class' => 'folderflexiitems');
}
//adding items
$query->clear();
$query->select(' i.id as iid, i.title AS ititle, c.id as catid,' . ' CASE WHEN CHAR_LENGTH(i.alias) THEN CONCAT_WS(\':\', i.id, i.alias) ELSE i.id END as slug,' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as catslug');
$query->from('#__content AS i' . ' LEFT JOIN #__flexicontent_cats_item_relations AS rel ON rel.itemid = i.id ' . ' LEFT JOIN #__categories AS c ON c.id = rel.catid ');
$query->where('c.id = ' . $CategoryId);
$query->order('i.title ASC');
$db->setQuery($query);
$contents = $db->loadObjectList();
foreach ($contents as $content) {
$items[] = array('url' => FlexicontentHelperRoute::getItemRoute($content->slug, $content->catslug), 'id' => 'index.php?option=com_flexicontent_items&view=category&cid=' . $category->id . '&id=' . $content->iid, 'name' => $content->ititle . '(id=' . $content->iid . ')', 'class' => 'fileflexiitems');
}
return $items;
}
示例7: _replaceContent
private function _replaceContent(&$results, $i)
{
$acypluginsHelper = acymailing_get('helper.acyplugins');
$tag = $acypluginsHelper->extractTag($results[1][$i]);
$tag->id = intval($tag->id);
if (!ACYMAILING_J16) {
$query = 'SELECT a.*,b.name as authorname, c.alias as catalias, c.title as cattitle, s.alias as secalias, s.title as sectitle FROM ' . acymailing_table('content', false) . ' as a ';
$query .= 'LEFT JOIN ' . acymailing_table('users', false) . ' as b ON a.created_by = b.id ';
$query .= ' LEFT JOIN ' . acymailing_table('categories', false) . ' AS c ON c.id = a.catid ';
$query .= ' LEFT JOIN ' . acymailing_table('sections', false) . ' AS s ON s.id = a.sectionid ';
$query .= 'WHERE a.id = ' . $tag->id . ' LIMIT 1';
} else {
$query = 'SELECT a.*,b.name as authorname, c.alias as catalias, c.title as cattitle FROM ' . acymailing_table('content', false) . ' as a ';
$query .= 'LEFT JOIN ' . acymailing_table('users', false) . ' as b ON a.created_by = b.id ';
$query .= ' LEFT JOIN ' . acymailing_table('categories', false) . ' AS c ON c.id = a.catid ';
$query .= 'WHERE a.id = ' . $tag->id . ' LIMIT 1';
}
$db = JFactory::getDBO();
$db->setQuery($query);
$article = $db->loadObject();
$result = '';
if (empty($article)) {
$app = JFactory::getApplication();
if ($app->isAdmin()) {
$app->enqueueMessage('The article "' . $tag->id . '" could not be loaded', 'notice');
}
return $result;
}
if (!empty($tag->lang)) {
$langid = (int) substr($tag->lang, strpos($tag->lang, ',') + 1);
if (!empty($langid)) {
$query = "SELECT reference_field, value FROM " . (ACYMAILING_J16 && file_exists(JPATH_SITE . DS . 'components' . DS . 'com_falang') ? '`#__falang_content`' : '`#__jf_content`') . " WHERE `published` = 1 AND `reference_table` = 'content' AND `language_id` = {$langid} AND `reference_id` = " . $tag->id;
$db->setQuery($query);
$translations = $db->loadObjectList();
if (!empty($translations)) {
foreach ($translations as $oneTranslation) {
if (!empty($oneTranslation->value)) {
$translatedfield = $oneTranslation->reference_field;
$article->{$translatedfield} = $oneTranslation->value;
}
}
}
}
}
$acypluginsHelper = acymailing_get('helper.acyplugins');
$acypluginsHelper->cleanHtml($article->introtext);
$acypluginsHelper->cleanHtml($article->fulltext);
if ($this->params->get('integration') == 'jreviews' and !empty($article->images)) {
$firstpict = explode('|', trim(reset(explode("\n", $article->images))) . '|||||||');
if (!empty($firstpict[0])) {
$picturePath = file_exists(ACYMAILING_ROOT . 'images' . DS . 'stories' . DS . str_replace('/', DS, $firstpict[0])) ? ACYMAILING_LIVE . 'images/stories/' . $firstpict[0] : ACYMAILING_LIVE . 'images/' . $firstpict[0];
$myPict = '<img src="' . $picturePath . '" alt="" hspace="5" style="margin:5px" align="left" border="' . intval($firstpict[5]) . '" />';
$article->introtext = $myPict . $article->introtext;
}
}
$completeId = $article->id;
$completeCat = $article->catid;
if (!empty($article->alias)) {
$completeId .= ':' . $article->alias;
}
if (!empty($article->catalias)) {
$completeCat .= ':' . $article->catalias;
}
if (empty($tag->itemid)) {
if (!ACYMAILING_J16) {
$completeSec = $article->sectionid;
if (!empty($article->secalias)) {
$completeSec .= ':' . $article->secalias;
}
if ($this->params->get('integration') == 'flexicontent' && class_exists('FlexicontentHelperRoute')) {
$link = FlexicontentHelperRoute::getItemRoute($completeId, $completeCat, $completeSec);
} else {
$link = ContentHelperRoute::getArticleRoute($completeId, $completeCat, $completeSec);
}
} else {
if ($this->params->get('integration') == 'flexicontent' && class_exists('FlexicontentHelperRoute')) {
$link = FlexicontentHelperRoute::getItemRoute($completeId, $completeCat);
} else {
$link = ContentHelperRoute::getArticleRoute($completeId, $completeCat);
}
}
} else {
$link = 'index.php?option=com_content&view=article&id=' . $completeId . '&catid=' . $completeCat;
}
if ($this->params->get('integration') == 'flexicontent' && !class_exists('FlexicontentHelperRoute')) {
$link = 'index.php?option=com_flexicontent&view=items&id=' . $completeId;
} elseif ($this->params->get('integration') == 'jaggyblog') {
$link = 'index.php?option=com_jaggyblog&task=viewpost&id=' . $completeId;
}
if (!empty($tag->itemid)) {
$link .= '&Itemid=' . $tag->itemid;
}
if (!empty($tag->lang)) {
$link .= (strpos($link, '?') ? '&' : '?') . 'lang=' . substr($tag->lang, 0, strpos($tag->lang, ','));
}
if (!empty($tag->autologin)) {
$link .= (strpos($link, '?') ? '&' : '?') . 'user={usertag:username|urlencode}&passw={usertag:password|urlencode}';
}
if (empty($tag->lang) && !empty($article->language) && $article->language != '*') {
if (!isset($this->langcodes[$article->language])) {
//.........这里部分代码省略.........
示例8: _generateToc
function _generateToc(&$row, $index)
{
$display_method = $this->params->get('display_method', 1);
$limitstart = JRequest::getInt('limitstart', 0);
$result = new stdClass();
if (0 == $index && $this->texts[$index] != "") {
//$result->title = $this->params->get('intro_text') != "" ? $this->params->get('intro_text') : $this->article->title ;
$result->title = ' - ' . JText::_($this->params->get('custom_introtext', 'FLEXIBREAK_INTRO_TEXT')) . ' - ';
$result->name = $result->id = 'start';
$result->link = JRoute::_(FlexicontentHelperRoute::getItemRoute($row->slug, $row->catid, 0, $row) . '&showall=&limitstart=');
$this->pagescount++;
} else {
if ($this->texts[0] == "") {
$attrs = JUtility::parseAttributes($this->pages[$index][0]);
} else {
$attrs = JUtility::parseAttributes($this->pages[$index - 1][0]);
}
$result->title = isset($attrs['title']) ? $attrs['title'] : 'unknown';
$result->name = isset($attrs['name']) ? $attrs['name'] : preg_replace('/[ \\t]+/u', '', $result->title);
$result->link = JRoute::_(FlexicontentHelperRoute::getItemRoute($row->slug, $row->catid, 0, $row) . '&showall=&limitstart=' . $index);
$result->id = $result->name ? $result->name : 'start';
}
$curr_index = $this->texts[0] == "" ? $index + 1 : $index;
if (!isset($this->_text)) {
$this->_text = '';
}
switch ($display_method) {
case 0:
$this->_text .= '<a id="' . $result->id . '_toc_page"></a>' . $this->texts[$curr_index];
// add an anchor link for scrolling
break;
case 1:
$this->_text .= '<div class="articlePage" id="' . $result->id . '"> ' . $this->texts[$curr_index] . '</div>';
break;
case 2:
if ($limitstart == $curr_index) {
$this->_text .= $this->texts[$curr_index];
}
break;
}
return $result;
}
示例9: display
//.........这里部分代码省略.........
}
// Set remaining META keys
$mdata = $item->metadata->toArray();
foreach ($mdata as $k => $v) {
if ($v) {
$document->setMetadata($k, $v);
}
}
// Overwrite with menu META data if menu matched
if ($menu_matches) {
if ($_mp = $menu->params->get('menu-meta_description')) {
$document->setDescription($_mp);
}
if ($_mp = $menu->params->get('menu-meta_keywords')) {
$document->setMetadata('keywords', $_mp);
}
if ($_mp = $menu->params->get('robots')) {
$document->setMetadata('robots', $_mp);
}
if ($_mp = $menu->params->get('secure')) {
$document->setMetadata('secure', $_mp);
}
}
// ****************************************************************
// Make sure Joomla SEF plugin has inserted a correct REL canonical
// or that it has not insert any REL if current URL is sufficient
// ****************************************************************
if ($params->get('add_canonical')) {
// Get canonical URL that SEF plugin adds, also $domain passed by reference, to get the domain configured in SEF plugin (multi-domain website)
$domain = null;
$defaultCanonical = flexicontent_html::getDefaultCanonical($domain);
$domain = $domain ? $domain : $uri->toString(array('scheme', 'host', 'port'));
// Create desired REL canonical URL
$ucanonical = $domain . JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $globalcats[$item->maincatid]->slug, 0, $item));
// $item->categoryslug
// Check if SEF plugin inserted a different REL canonical
if ($defaultCanonical != $ucanonical) {
// Add REL canonical only if different than current URL
$head_obj = $document->addHeadLink(htmlspecialchars($ucanonical), 'canonical', 'rel', '');
if ($uri->toString() == $ucanonical) {
unset($head_obj->_links[htmlspecialchars($ucanonical)]);
}
// Remove canonical inserted by SEF plugin
unset($head_obj->_links[htmlspecialchars($defaultCanonical)]);
}
}
// *************************
// increment the hit counter
// *************************
// MOVED to flexisystem plugin due to ...
/*if (FLEXIUtilities::count_new_hit($item->id) ) {
$model->hit();
}*/
// Load template css/js and set template data variable
$tmplvar = $themes->items->{$ilayout}->tmplvar;
if ($ilayout) {
// Add the templates css files if availables
if (isset($themes->items->{$ilayout}->css)) {
foreach ($themes->items->{$ilayout}->css as $css) {
$document->addStyleSheet($this->baseurl . '/' . $css);
}
}
// Add the templates js files if availables
if (isset($themes->items->{$ilayout}->js)) {
foreach ($themes->items->{$ilayout}->js as $js) {
$document->addScript($this->baseurl . '/' . $js);
示例10: _replaceContent
private function _replaceContent(&$tag)
{
$oldFormat = empty($tag->format);
if (!ACYMAILING_J16) {
$query = 'SELECT a.*,b.name as authorname, c.alias as catalias, c.title as cattitle, c.image AS catpict, s.alias as secalias, s.title as sectitle FROM ' . acymailing_table('content', false) . ' as a ';
$query .= 'LEFT JOIN ' . acymailing_table('users', false) . ' as b ON a.created_by = b.id ';
$query .= ' LEFT JOIN ' . acymailing_table('categories', false) . ' AS c ON c.id = a.catid ';
$query .= ' LEFT JOIN ' . acymailing_table('sections', false) . ' AS s ON s.id = a.sectionid ';
$query .= 'WHERE a.id = ' . $tag->id . ' LIMIT 1';
} else {
$query = 'SELECT a.*,b.name as authorname, c.alias as catalias, c.title as cattitle, c.params AS catparams FROM ' . acymailing_table('content', false) . ' as a ';
$query .= 'LEFT JOIN ' . acymailing_table('users', false) . ' as b ON a.created_by = b.id ';
$query .= ' LEFT JOIN ' . acymailing_table('categories', false) . ' AS c ON c.id = a.catid ';
$query .= 'WHERE a.id = ' . $tag->id . ' LIMIT 1';
}
$this->db->setQuery($query);
$article = $this->db->loadObject();
if (empty($article)) {
$app = JFactory::getApplication();
if ($app->isAdmin()) {
$app->enqueueMessage('The article "' . $tag->id . '" could not be loaded', 'notice');
}
return '';
}
if (empty($tag->lang) && !empty($this->newslanguage) && !empty($this->newslanguage->lang_code)) {
$tag->lang = $this->newslanguage->lang_code . ',' . $this->newslanguage->lang_id;
}
$this->acypluginsHelper->translateItem($article, $tag, 'content');
$varFields = array();
foreach ($article as $fieldName => $oneField) {
$varFields['{' . $fieldName . '}'] = $oneField;
}
$this->acypluginsHelper->cleanHtml($article->introtext);
$this->acypluginsHelper->cleanHtml($article->fulltext);
if ($this->params->get('integration') == 'jreviews' && !empty($article->images)) {
$firstpict = explode('|', trim(reset(explode("\n", $article->images))) . '|||||||');
if (!empty($firstpict[0])) {
$picturePath = file_exists(ACYMAILING_ROOT . 'images' . DS . 'stories' . DS . str_replace('/', DS, $firstpict[0])) ? ACYMAILING_LIVE . 'images/stories/' . $firstpict[0] : ACYMAILING_LIVE . 'images/' . $firstpict[0];
$myPict = '<img src="' . $picturePath . '" alt="" hspace="5" style="margin:5px" align="left" border="' . intval($firstpict[5]) . '" />';
$article->introtext = $myPict . $article->introtext;
}
}
$completeId = $article->id;
$completeCat = $article->catid;
if (!empty($article->alias)) {
$completeId .= ':' . $article->alias;
}
if (!empty($article->catalias)) {
$completeCat .= ':' . $article->catalias;
}
if (empty($tag->itemid)) {
if (!ACYMAILING_J16) {
$completeSec = $article->sectionid;
if (!empty($article->secalias)) {
$completeSec .= ':' . $article->secalias;
}
if ($this->params->get('integration') == 'flexicontent' && class_exists('FlexicontentHelperRoute')) {
$link = FlexicontentHelperRoute::getItemRoute($completeId, $completeCat, $completeSec);
} else {
$link = ContentHelperRoute::getArticleRoute($completeId, $completeCat, $completeSec);
}
} else {
if ($this->params->get('integration') == 'flexicontent' && class_exists('FlexicontentHelperRoute')) {
$link = FlexicontentHelperRoute::getItemRoute($completeId, $completeCat);
} else {
$link = ContentHelperRoute::getArticleRoute($completeId, $completeCat);
}
}
} else {
$link = 'index.php?option=com_content&view=article&id=' . $completeId . '&catid=' . $completeCat;
}
if ($this->params->get('integration') == 'flexicontent' && !class_exists('FlexicontentHelperRoute')) {
$link = 'index.php?option=com_flexicontent&view=items&id=' . $completeId;
} elseif ($this->params->get('integration') == 'jaggyblog') {
$link = 'index.php?option=com_jaggyblog&task=viewpost&id=' . $completeId;
}
if (!empty($tag->itemid)) {
$link .= '&Itemid=' . $tag->itemid;
}
if (!empty($tag->lang)) {
$link .= (strpos($link, '?') ? '&' : '?') . 'lang=' . substr($tag->lang, 0, strpos($tag->lang, ','));
}
if (!empty($tag->autologin)) {
$link .= (strpos($link, '?') ? '&' : '?') . 'user={usertag:username|urlencode}&passw={usertag:password|urlencode}';
}
if (empty($tag->lang) && !empty($article->language) && $article->language != '*') {
if (!isset($this->langcodes[$article->language])) {
$this->db->setQuery('SELECT sef FROM #__languages WHERE lang_code = ' . $this->db->Quote($article->language) . ' ORDER BY `published` DESC LIMIT 1');
$this->langcodes[$article->language] = $this->db->loadResult();
if (empty($this->langcodes[$article->language])) {
$this->langcodes[$article->language] = $article->language;
}
}
$link .= (strpos($link, '?') ? '&' : '?') . 'lang=' . $this->langcodes[$article->language];
}
$link = acymailing_frontendLink($link);
$varFields['{link}'] = $link;
$afterTitle = '';
$afterArticle = '';
$contentText = '';
//.........这里部分代码省略.........
示例11: pathinfo
$w = '&w=' . $this->params->get('intro_width', 200);
$h = '&h=' . $this->params->get('intro_height', 200);
$aoe = '&aoe=1';
$q = '&q=95';
$zc = $this->params->get('intro_method') ? '&zc=' . $this->params->get('intro_method') : '';
$ext = pathinfo($src, PATHINFO_EXTENSION);
$f = in_array($ext, array('png', 'ico', 'gif')) ? '&f=' . $ext : '';
$conf = $w . $h . $aoe . $q . $zc . $f;
$base_url = !preg_match("#^http|^https|^ftp|^/#i", $src) ? JURI::base(true) . '/' : '';
$thumb = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $base_url . $src . $conf;
} else {
// Do not resize image when (a) image src path not set or (b) using image field's already created thumbnails
$thumb = $src;
}
}
$link_url = $custom_link ? $custom_link : JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->categoryslug, 0, $item));
// MICRODATA document type (itemtype) for each item
// -- NOTE: category's microdata itemtype will override the microdata itemtype of the CONTENT TYPE
$microdata_itemtype = $microdata_itemtype_cat ? $microdata_itemtype_cat : $item->params->get('microdata_itemtype');
$microdata_itemtype_props = $microdata_itemtype ? 'itemscope itemtype="http://schema.org/' . $microdata_itemtype . '"' : '';
?>
<?php
echo $intro_catblock ? '<li class="intro_catblock">' . ($intro_catblock_title && @$globalcats[$item->rel_catid] ? $globalcats[$item->rel_catid]->title : '') . '</li>' : '';
?>
<li id="fc_bloglist_item_<?php
echo $i;
?>
" class="<?php
echo $fc_item_classes;
示例12: display
//.........这里部分代码省略.........
// **************
// Common Buttons
// **************
// Applying new item type is a special case that has not loaded custom fieds yet
JToolBarHelper::apply($item->type_id ? 'items.apply' : 'items.apply_type', !$isnew ? 'FLEXI_APPLY' : ($typesselected->id ? 'FLEXI_ADD' : 'FLEXI_APPLY_TYPE'), false);
/*if (!$isnew || $item->version) flexicontent_html::addToolBarButton(
'FLEXI_FAST_APPLY', $btn_name='apply_ajax', $full_js="Joomla.submitbutton('items.apply_ajax')", $msg_alert='', $msg_confirm='',
$btn_task='items.apply_ajax', $extra_js='', $btn_list=false, $btn_menu=true, $btn_confirm=false, $btn_class="".$tip_class, $btn_icon="icon-loop",
'data-placement="bottom" title="Fast saving, without reloading the form. <br/><br/>Note: new files will not be uploaded, <br/>- in such a case please use \'Apply\'"');*/
if (!$isnew || $item->version) {
JToolBarHelper::save('items.save');
}
if (!$isnew || $item->version) {
JToolBarHelper::custom('items.saveandnew', 'savenew.png', 'savenew.png', 'FLEXI_SAVE_AND_NEW', false);
}
JToolBarHelper::cancel('items.cancel');
// ***********************
// Add a preview button(s)
// ***********************
//$_sh404sef = JPluginHelper::isEnabled('system', 'sh404sef') && $config->get('sef');
$_sh404sef = defined('SH404SEF_IS_RUNNING') && $config->get('sef');
if ($cid) {
// Domain URL and autologin vars
$server = JURI::getInstance()->toString(array('scheme', 'host', 'port'));
$autologin = '';
//$params->get('autoflogin', 1) ? '&fcu='.$user->username . '&fcp='.$user->password : '';
// Check if we are in the backend, in the back end we need to set the application to the site app instead
// we do not remove 'isAdmin' check so that we can copy later without change, e.g. to a plugin
$isAdmin = JFactory::getApplication()->isAdmin();
if ($isAdmin && !$_sh404sef) {
JFactory::$application = JApplication::getInstance('site');
}
// Create the URL
$item_url = FlexicontentHelperRoute::getItemRoute($item->id . ':' . $item->alias, $categories[$item->catid]->slug) . ($item->language != '*' ? '&lang=' . substr($item->language, 0, 2) : '');
$item_url = $_sh404sef ? Sh404sefHelperGeneral::getSefFromNonSef($item_url, $fullyQualified = true, $xhtml = false, $ssl = null) : JRoute::_($item_url);
// Check if we are in the backend again
// In backend we need to remove administrator from URL as it is added even though we've set the application to the site app
if ($isAdmin && !$_sh404sef) {
$admin_folder = str_replace(JURI::root(true), '', JURI::base(true));
$item_url = str_replace($admin_folder . '/', '/', $item_url);
// Restore application
JFactory::$application = JApplication::getInstance('administrator');
}
$previewlink = $item_url . (strstr($item_url, '?') ? '&' : '?') . 'preview=1' . $autologin;
//$previewlink = str_replace('&', '&', $previewlink);
//$previewlink = JRoute::_(JURI::root() . FlexicontentHelperRoute::getItemRoute($item->id.':'.$item->alias, $categories[$item->catid]->slug)) .$autologin;
// PREVIEW for latest version
if (!$params->get('use_versioning', 1) || $item->version == $item->current_version && $item->version == $item->last_version) {
$toolbar->appendButton('Custom', '<button class="preview btn btn-small btn-info spaced-btn" onClick="window.open(\'' . $previewlink . '\');"><span title="' . JText::_('Preview') . '" class="icon-screen"></span>' . JText::_('Preview') . '</button>', 'preview');
} else {
// Add a preview button for (currently) LOADED version of the item
$previewlink_loaded_ver = $previewlink . '&version=' . $item->version;
$toolbar->appendButton('Custom', '<button class="preview btn btn-small" onClick="window.open(\'' . $previewlink_loaded_ver . '\');" target="_blank"><span title="' . JText::_('Preview') . '" class="icon-screen"></span>' . JText::_('FLEXI_PREVIEW_FORM_LOADED_VERSION') . ' [' . $item->version . ']</button>', 'preview');
// Add a preview button for currently ACTIVE version of the item
$previewlink_active_ver = $previewlink . '&version=' . $item->current_version;
$toolbar->appendButton('Custom', '<button class="preview btn btn-small" onClick="window.open(\'' . $previewlink_active_ver . '\');" target="_blank"><span title="' . JText::_('Preview') . '" class="icon-screen"></span>' . JText::_('FLEXI_PREVIEW_FRONTEND_ACTIVE_VERSION') . ' [' . $item->current_version . ']</button>', 'preview');
// Add a preview button for currently LATEST version of the item
$previewlink_last_ver = $previewlink;
//'&version='.$item->last_version;
$toolbar->appendButton('Custom', '<button class="preview btn btn-small" onClick="window.open(\'' . $previewlink_last_ver . '\');" target="_blank"><span title="' . JText::_('Preview') . '" class="icon-screen"></span>' . JText::_('FLEXI_PREVIEW_LATEST_SAVED_VERSION') . ' [' . $item->last_version . ']</button>', 'preview');
}
JToolBarHelper::spacer();
JToolBarHelper::divider();
JToolBarHelper::spacer();
}
// ************************
示例13: flexi_submit
<button class="<?php
echo $btn_class;
?>
btn-success" type="button" onclick="return flexi_submit('save_a_preview', 'flexi_form_submit_btns', 'flexi_form_submit_msg');">
<span class="fcbutton_preview_save"><?php
echo JText::_(!$isnew ? 'FLEXI_SAVE_A_PREVIEW' : 'FLEXI_ADD_A_PREVIEW');
?>
</span>
</button>
<?php
}
?>
<?php
$params = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,left=50,width=\'+((screen.width-100) > 1360 ? 1360 : (screen.width-100))+\',top=20,height=\'+((screen.width-160) > 100 ? 1000 : (screen.width-160))+\',directories=no,location=no';
$link = JRoute::_(FlexicontentHelperRoute::getItemRoute($this->item->id . ':' . $this->item->alias, $this->item->catid, 0, $this->item) . '&preview=1');
?>
<?php
if (in_array('preview_latest', $allowbuttons_fe) && !$isredirected_after_submit && !$isnew) {
?>
<button class="<?php
echo $btn_class;
?>
btn-default" type="button" onclick="window.open('<?php
echo $link;
?>
','preview2','<?php
echo $params;
?>
'); return false;">
示例14: editbutton
/**
* Creates the edit button
*
* @param int $id
* @param array $params
* @since 1.0
*/
static function editbutton($item, &$params)
{
if (!$params->get('show_editbutton', 1) || JRequest::getCmd('print')) {
return;
}
$user = JFactory::getUser();
// Determine if current user can edit the given item
$has_edit_state = false;
$asset = 'com_content.article.' . $item->id;
$has_edit_state = $user->authorise('core.edit', $asset) || $user->authorise('core.edit.own', $asset) && $item->created_by == $user->get('id');
// ALTERNATIVE 1
//$rights = FlexicontentHelperPerm::checkAllItemAccess($user->get('id'), 'item', $item->id);
//$has_edit_state = in_array('edit', $rights) || (in_array('edit.own', $rights) && $item->created_by == $user->get('id')) ;
// Create the edit button only if user can edit the give item
if (!$has_edit_state) {
return;
}
$show_icons = $params->get('show_icons');
if ($show_icons) {
$attribs = '';
$image = JHTML::image(FLEXI_ICONPATH . 'edit.png', JText::_('FLEXI_EDIT'), $attribs);
} else {
$image = '';
}
$overlib = JText::_('FLEXI_EDIT_TIP');
$text = JText::_('FLEXI_EDIT');
$button_classes = 'fc_editbutton';
if ($show_icons == 1) {
$caption = '';
$button_classes .= '';
} else {
$caption = $text;
$button_classes .= FLEXI_J30GE ? ' btn btn-small' : ' fc_button fcsimple fcsmall';
}
$button_classes .= FLEXI_J30GE ? ' hasTooltip' : ' hasTip';
$tooltip_title = flexicontent_html::getToolTip($text, $overlib, 0);
if ($params->get('show_editbutton', 1) == '1') {
// Maintain menu item ? e.g. current category view,
$Itemid = JRequest::getInt('Itemid', 0);
//$Itemid = 0;
$item_url = JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->categoryslug, $Itemid, $item));
$link = $item_url . (strstr($item_url, '?') ? '&' : '?') . 'task=edit';
$targetLink = "_self";
} else {
if ($params->get('show_editbutton', 1) == '2') {
//$link = JURI::base(true).'/administrator/index.php?option=com_flexicontent&view=items&filter_id='.$item->id;
$link = JURI::base(true) . '/administrator/index.php?option=com_flexicontent&task=items.edit&cid[]=' . $item->id;
$targetLink = "_blank";
}
}
$output = '<a href="' . $link . '" class="' . $button_classes . '" target="' . $targetLink . '" title="' . $tooltip_title . '">' . $image . $caption . '</a>';
$output = JText::_('FLEXI_ICON_SEP') . $output . JText::_('FLEXI_ICON_SEP');
return $output;
}
示例15: onDisplayFieldValue
//.........这里部分代码省略.........
$db->setQuery($query);
$category = $db->loadObject();
$category->parameters = new JRegistry($category->params);
if (isset($ids_to_loc[$item->id])) {
$location = $ids_to_loc[$item->id];
} else {
// Get list of ids of selected, null indicates to return item ids array. TODO retrieve item ids from view:
// This will allow special navigating layouts "mcats,author,myitems,tags,favs" and also utilize current filtering
$ids = null;
$loc_to_ids = $this->getItemList($ids, $cid, $user->id);
$ids_to_loc = array_flip($loc_to_ids);
// Item ID to location MAP
$item_count = count($loc_to_ids);
// Total items in category
$location = isset($ids_to_loc[$item->id]) ? $ids_to_loc[$item->id] : false;
// Location of current content item in array list
if ($location !== false) {
$offset = $location - 50 > 0 ? $location - 50 : 0;
$length = $offset + 100 < $item_count ? 100 : $item_count - $offset;
$nav_loc_to_ids = array_slice($loc_to_ids, $offset, $length, true);
$app->setUserState($option . '.' . $cid . 'nav_item_count', $item_count);
$app->setUserState($option . '.' . $cid . 'nav_loc_to_ids', $nav_loc_to_ids);
} else {
$app->setUserState($option . '.' . $cid . 'nav_item_count', null);
$app->setUserState($option . '.' . $cid . 'nav_loc_to_ids', null);
}
}
// Get previous and next item data
$field->prev = null;
$field->prevtitle = null;
$field->prevurl = null;
$field->next = null;
$field->nexttitle = null;
$field->nexturl = null;
$field->category = null;
$field->categorytitle = null;
$field->categoryurl = null;
// Get item data
$rows = false;
$prev_id = null;
$next_id = null;
if ($location !== false) {
$prev_id = $location - 1 >= 0 ? $loc_to_ids[$location - 1] : null;
$next_id = $location + 1 < $item_count ? $loc_to_ids[$location + 1] : null;
$ids = array();
// Previous item if it exists
if ($prev_id) {
$ids[] = $prev_id;
}
// Current item may belong may not be list in main category so retrieve it to get a proper categoryslug
$ids[] = $item->id;
// Next item if it exists
if ($next_id) {
$ids[] = $next_id;
}
// Query specific ids
$rows = $this->getItemList($ids, $cid, $user->id);
// previous content item
if ($prev_id) {
$field->prev = $rows[$prev_id];
$field->prevtitle = $field->prev->title;
$field->prevurl = JRoute::_(FlexicontentHelperRoute::getItemRoute($field->prev->slug, $field->prev->categoryslug, 0, $field->prev));
}
// next content item
if ($next_id) {
$field->next = $rows[$next_id];
$field->nexttitle = $field->next->title;
$field->nexturl = JRoute::_(FlexicontentHelperRoute::getItemRoute($field->next->slug, $field->next->categoryslug, 0, $field->next));
}
}
// Check if displaying nothing and stop
if (!$field->prev && !$field->next && !$use_category_link) {
return;
}
// Get images
$items_arr = array();
if ($field->prev) {
$items_arr[$field->prev->id] = $field->prev;
}
if ($field->next) {
$items_arr[$field->next->id] = $field->next;
}
$thumbs = $this->getItemThumbs($field->parameters, $items_arr);
$field->prevThumb = $field->prev && isset($thumbs[$field->prev->id]) ? $thumbs[$field->prev->id] : '';
$field->nextThumb = $field->next && isset($thumbs[$field->next->id]) ? $thumbs[$field->next->id] : '';
// Get layout name
$viewlayout = $field->parameters->get('viewlayout', '');
$viewlayout = $viewlayout ? 'value_' . $viewlayout : 'value_default';
//$this->values = $values;
//$this->displayFieldValue( $prop, $viewlayout );
include self::getFormPath($this->fieldtypes[0], $viewlayout);
// Load needed JS/CSS
if ($use_tooltip) {
JHtml::_('bootstrap.tooltip');
}
if ($load_css) {
JFactory::getDocument()->addStyleSheet(JURI::root(true) . '/plugins/flexicontent_fields/fcpagenav/' . (FLEXI_J16GE ? 'fcpagenav/' : '') . 'fcpagenav.css');
}
$field->{$prop} = $html;
}