2 defined('_JEXEC') or die;
4 if (!defined('_ARTX_FUNCTIONS')) {
6 define('_ARTX_FUNCTIONS', 1);
8 $GLOBALS['artx_settings'] = array(
9 'block' => array('has_header' => true),
10 'menu' => array('show_submenus' => true),
11 'vmenu' => array('show_submenus' => false, 'simple' => false)
15 * Base class with index.php view routines. Contains method for placing positions,
16 * calculating classes, decorating components. Version-specific routines are defined
17 * in subclasses: ArtxPage15 and ArtxPage16.
32 function ArtxPageView(&$page) {
33 $this->page = & $page;
37 * Returns version-specific body class: art-j15 for joomla15 or art-j16 for joomla16.
40 * <body class="art-j15">
45 function bodyClass() { }
48 * Checks whether Joomla! has system messages to display.
53 function hasMessages() { }
56 * Returns true when one of the given positions contains at least one module.
58 * if ($obj->containsModules('top1', 'top2', 'top3')) {
59 * // the following code will be executed when one of the positions contains modules:
65 function containsModules()
67 foreach (func_get_args() as $position)
68 if (0 != $this->page->countModules($position))
74 * Builds list of positions, collapsing the empty ones.
78 * No empty positions: 25%:25%:25%:25%
79 * With one empty position: -:50%:25%:25%, 50%:-:25%:25%, 25%:50%:-:25%, 25%:25%:50%:-
80 * With two empty positions: -:-:75%:25%, -:50%:-:50%, -:50%:50%:-, -:50%:50%:-, 75%:-:-:25%, 50%:-:50%:-, 25%:75%:-:-
81 * One non-empty position: 100%
83 * No empty positions: 33%:33%:34%
84 * With one empty position: -:66%:34%, 50%:-:50%, 33%:67%:-
85 * One non-empty position: 100%
89 function positions($positions, $style) {
90 // Build $cells by collapsing empty positions:
94 foreach ($positions as $name => $width) {
95 if ($this->containsModules($name)) {
96 $cells[$name] = $buffer + $width;
99 } else if (null == $cell)
102 $cells[$cell] += $width;
105 // Backward compatibility:
106 // For three equal width columns with empty center position width should be 50/50:
107 if (3 == count($positions) && 2 == count($cells)) {
108 $columns1 = array_keys($positions);
109 $columns2 = array_keys($cells);
110 if (33 == $positions[$columns1[0]] && 33 == $positions[$columns1[1]] && 34 == $positions[$columns1[2]]
111 && $columns2[0] == $columns1[0] && $columns2[1] == $columns1[2])
112 $cells[$columns2[0]] = 50;
113 $cells[$columns2[1]] = 50;
117 if (count($cells) == 0)
119 if (count($cells) == 1)
120 foreach ($cells as $name => $width)
121 return $this->position($name, $style);
122 $result = '<table class="position" cellpadding="0" cellspacing="0" border="0">';
123 $result .= '<tr valign="top">';
124 foreach ($cells as $name => $width)
125 $result .='<td width="' . $width. '%">' . $this->position($name, $style) . '</td>';
127 $result .= '</table>';
134 function position($position, $style = null)
136 return '<jdoc:include type="modules" name="' . $position . '"' . (null != $style ? ' style="artstyle" artstyle="' . $style . '"' : '') . ' />';
140 * Preprocess component content before printing it.
145 function componentWrapper()
152 function getWysiwygBackgroundImprovement($id)
158 var waitFor = function (interval, criteria, callback) {
159 var interval = setInterval(function () {
162 clearInterval(interval);
166 waitFor(20, function () { return 'undefined' != typeof jQuery; },
168 var editor = ('undefined' != typeof tinyMCE)
170 : (('undefined' != typeof JContentEditor)
171 ? JContentEditor : null);
177 for (var key in editor.editors)
178 if (editor.editors.hasOwnProperty(key))
179 return editor.editors[key].initialized;
183 var ifr = jQuery('#<?php echo $id; ?>');
184 var ifrdoc = ifr.attr('contentDocument');
185 setTimeout(function () {
186 // check whether editor.css is included or not:
187 if (0 == jQuery('link[href*="/css/editor.css"]', ifrdoc).length)
189 var background = ifr.css('background-color');
190 ifr.css('background', 'transparent');
191 ifr.attr('allowtransparency', 'true');
192 var layout = jQuery('table.mceLayout');
193 var background = layout.css('background-color');
194 layout.css('background', 'transparent');
195 layout.find('.mceToolbar').css('background', background);
196 layout.find('.mceStatusbar').css('background', background);
197 jQuery('body', ifrdoc).css('background', 'transparent');
204 return ob_get_clean();
208 class ArtxPage15 extends ArtxPageView
213 function ArtxPage15(&$page) {
214 parent::ArtxPageView($page);
220 function bodyClass() {
227 function hasMessages()
230 $messages = $mainframe->getMessageQueue();
231 if (is_array($messages) && count($messages))
232 foreach ($messages as $msg)
233 if (isset($msg['type']) && isset($msg['message']))
239 * Wraps component content into article style unless it is not wrapped already.
241 * The componentWrapper method gets the content of the 'component' buffer and searches for the '<div class="art-post">' string in it.
242 * Then it replaces the componentheading DIV tag with span (to fix the w3.org validation) and replaces content of the buffer with
247 function componentWrapper()
249 if ($this->page->getType() != 'html')
251 $option = JRequest::getCmd('option');
252 $view = JRequest::getCmd('view');
253 $layout = JRequest::getCmd('layout');
254 $task = JRequest::getCmd('task');
255 $content = $this->page->getBuffer('component');
256 // Workarounds for Joomla bugs and inconsistencies:
262 $content = str_replace('<button type="submit" class="validate">', '<button type="submit" class="button validate">', $content);
266 $content = str_replace('<button type="submit" class="validate">', '<button type="submit" class="button validate">', $content);
277 $this->page->addScriptDeclaration($this->getWysiwygBackgroundImprovement('text_ifr'));
282 if ('com_content' == $option && ('frontpage' == $view || 'article' == $view || ('category' == $view && 'blog' == $layout)))
284 if (false === strpos($content, '<div class="art-post')) {
286 if (preg_match('~<div\s+class="(componentheading[^"]*)"([^>]*)>([^<]+)</div>~', $content, $matches, PREG_OFFSET_CAPTURE)) {
287 $content = substr($content, 0, $matches[0][1]) . substr($content, $matches[0][1] + strlen($matches[0][0]));
288 $title = '<span class="' . $matches[1][0] . '"' . $matches[2][0] . '>' . $matches[3][0] . '</span>';
290 $this->page->setBuffer(artxPost(array('header-text' => $title, 'content' => $content)), 'component');
295 class ArtxPage16 extends ArtxPageView
300 function ArtxPage16($page) {
301 parent::ArtxPageView($page);
307 function bodyClass() {
314 function hasMessages()
316 $app = JFactory::getApplication();
317 $messages = $app->getMessageQueue();
318 if (is_array($messages) && count($messages))
319 foreach ($messages as $msg)
320 if (isset($msg['type']) && isset($msg['message']))
326 * Wraps component content into article style unless it is not wrapped already.
328 * The componentWrapper method gets the content of the 'component' buffer and searches for the '<div class="art-post">' string in it.
329 * Then it wraps content of the buffer with art-post.
333 function componentWrapper()
335 if ($this->page->getType() != 'html')
337 $option = JRequest::getCmd('option');
338 $view = JRequest::getCmd('view');
339 $layout = JRequest::getCmd('layout');
340 $content = $this->page->getBuffer('component');
341 // Workarounds for Joomla bugs and inconsistencies:
346 if ("edit" == $layout)
347 $content = str_replace('<button type="button" onclick="', '<button type="button" class="button" onclick="', $content);
355 $content = str_replace('<button type="submit">', '<button type="submit" class="button">', $content);
359 $content = str_replace('<button type="submit">', '<button type="submit" class="button">', $content);
363 $content = str_replace('<button type="submit" class="validate">', '<button type="submit" class="button validate">', $content);
373 if ("edit" == $layout)
374 $this->page->addScriptDeclaration($this->getWysiwygBackgroundImprovement('jform_articletext_ifr'));
379 if ('com_content' == $option && ('featured' == $view || 'article' == $view || ('category' == $view && 'blog' == $layout)))
381 if (false === strpos($content, '<div class="art-post'))
382 $this->page->setBuffer(artxPost(array('header-text' => null, 'content' => $content)), 'component');
387 * Base class with content page routines for rendering page header and article factory.
391 class ArtxContentView
401 var $_componentParams;
404 * Component page class suffix.
414 var $showPageHeading;
417 * Page heading (or page title).
426 function ArtxContentView(&$component, &$params)
428 $this->_component = $component;
429 $this->_componentParams = $params;
436 function pageHeading($heading = null) { }
442 function article($article, $print) { }
448 function articleListItem($item) { }
453 function beginPageContainer($class)
455 return '<div class="' . $class . $this->pageClassSfx .'">';
461 function endPageContainer()
467 class ArtxContent15 extends ArtxContentView
473 function ArtxContent15(&$component, &$params)
475 parent::ArtxContentView($component, $params);
476 $this->pageClassSfx = $this->_componentParams->get('pageclass_sfx');
477 $this->showPageHeading = $this->_componentParams->def('show_page_title', 1);
478 $this->pageHeading = $this->showPageHeading ? $this->_componentParams->get('page_title') : '';
484 function pageHeading($heading = null)
486 return artxPost(array('header-text' => null == $heading ? $this->pageHeading : $heading));
492 function article($article, $print)
494 return new ArtxContentArticleView15($this->_component, $this->_componentParams, $article, $print);
500 function articleListItem($item)
502 return new ArtxContentFrontpageItemView15($this->_component, $this->_componentParams, $item);
506 class ArtxContent16 extends ArtxContentView
511 function ArtxContent16($component, $params)
513 parent::ArtxContentView($component, $params);
514 $this->pageClassSfx = $this->_component->pageclass_sfx;
515 $this->showPageHeading = $this->_componentParams->def('show_page_heading', 1);
516 $this->pageHeading = $this->showPageHeading ? $this->_componentParams->get('page_heading') : '';
522 function pageHeading($heading = null)
524 return artxPost(array('header-text' => null == $heading ? $this->pageHeading : $heading));
530 function article($article, $print)
532 return new ArtxContentArticleView16($this->_component, $this->_componentParams, $article, $print);
538 function articleListItem($item)
540 return new ArtxContentFeaturedItemView16($this->_component, $this->_componentParams, $item);
547 class ArtxContentGeneralArticleView
557 var $_componentParams;
617 var $showPublishDate;
672 var $showParentCategory;
677 var $parentCategoryLink;
702 function ArtxContentGeneralArticleView(&$component, &$componentParams, &$article)
705 $this->_component = &$component;
706 $this->_componentParams = &$componentParams;
707 $this->_article = &$article;
708 // Calculate properties:
709 $this->isPublished = 0 != $this->_article->state;
715 function introText() { return ''; }
720 function createDateInfo() { return ''; }
725 function modifyDateInfo() { return ''; }
730 function publishDateInfo() { return ''; }
735 function authorInfo() { return ''; }
740 function hitsInfo() { return ''; }
745 function pdfIcon() { return ''; }
750 function emailIcon() { return ''; }
755 function editIcon() { return ''; }
760 function printPopupIcon() { return ''; }
765 function printScreenIcon() { return ''; }
770 function readmore() { return ''; }
775 function beginUnpublishedArticle() { return '<div class="system-unpublished">'; }
780 function endUnpublishedArticle() { return '</div>'; }
785 function articleSeparator() { return '<div class="item-separator"></div>'; }
790 function categories()
792 $showParentCategory = $this->showParentCategory && !empty($this->parentCategory);
793 $showCategory = $this->showCategory && !empty($this->category);
794 $result = JText::_('Category') . ': ';
795 if ($showParentCategory) {
796 $result .= '<span class="art-post-metadata-category-parent">';
797 $title = $this->_component->escape($this->parentCategory);
798 if (!empty($this->parentCategoryLink))
799 $result .= '<a href="' . $this->parentCategoryLink . '">' . $title . '</a>';
802 $result .= '</span>';
804 if ($showParentCategory && $showCategory)
807 $result .= '<span class="art-post-metadata-category-name">';
808 $title = $this->_component->escape($this->category);
809 if (!empty($this->categoryLink))
810 $result .= '<a href="' . $this->categoryLink . '">' . $title . '</a>';
813 $result .= '</span>';
823 return '<a href="http://' . $this->_component->escape($this->_article->urls) . '" target="_blank">'
824 . $this->_component->escape($this->_article->urls) . '</a>';
830 function getArticleViewParameters()
832 return array('metadata-header-icons' => array(), 'metadata-footer-icons' => array());
838 function event($name)
840 return $this->_article->event->{$name};
846 function article($article)
848 return artxPost($article);
856 return isset($this->_article->toc) ? $this->_article->toc : '';
864 return "<div class=\"art-article\">" . $this->_article->text . "</div>";
868 class ArtxContentArticleView15 extends ArtxContentGeneralArticleView
873 function ArtxContentArticleView15(&$component, &$componentParams, &$article, $print)
875 parent::ArtxContentGeneralArticleView($component, $componentParams, $article);
877 $this->print = $print;
878 $this->canEdit = $this->_component->user->authorize('com_content', 'edit', 'content', 'all')
879 || $this->_component->user->authorize('com_content', 'edit', 'content', 'own');
880 $this->title = $this->_article->title;
881 $this->titleVisible = $this->_componentParams->get('show_title') && strlen($this->title);
882 $this->titleLink = $this->_componentParams->get('link_titles') && '' != $this->_article->readmore_link
883 ? $this->_article->readmore_link : '';
884 $this->showCreateDate = $this->_componentParams->get('show_create_date');
885 $this->showModifyDate = 0 != intval($this->_article->modified) && $this->_componentParams->get('show_modify_date');
886 $this->showPublishDate = false; // - not available in J! 1.5
887 $this->showAuthor = $this->_componentParams->get('show_author') && '' != $this->_article->author;
888 $this->showPdfIcon = $this->_componentParams->get('show_pdf_icon');
889 $this->showPrintIcon = $this->_componentParams->get('show_print_icon');
890 $this->showEmailIcon = $this->_componentParams->get('show_email_icon');
891 $this->showHits = false; // - not available in J! 1.5
892 $this->showUrl = $this->_componentParams->get('show_url') && $this->_article->urls;
893 $this->showIntro = $this->_componentParams->get('show_intro');
894 $this->showReadmore = false; // - no readmore in article
895 $this->showTeaser = false; // - not available in J! 1.5
896 $this->showText = true; // - not available in J! 1.5
898 $this->showParentCategory = $this->_componentParams->get('show_section') && $this->_article->sectionid && isset($this->_article->section);
899 $this->parentCategory = $this->showParentCategory ? $this->_article->section : '';
900 $this->parentCategoryLink = ($this->showParentCategory && $this->_componentParams->get('link_section'))
901 ? JRoute::_(ContentHelperRoute::getSectionRoute($this->_article->sectionid)) : '';
902 $this->showCategory = $this->_componentParams->get('show_category') && $this->_article->catid;
903 $this->category = $this->showCategory ? $this->_article->category : '';
904 $this->categoryLink = ($this->showCategory && $this->_componentParams->get('link_category'))
905 ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug, $this->_article->sectionid)) : '';
911 function createDateInfo()
913 return JHTML::_('date', $this->_article->created, JText::_('DATE_FORMAT_LC2'));
919 function modifyDateInfo()
921 return JText::sprintf('LAST_UPDATED2', JHTML::_('date', $this->_article->modified, JText::_('DATE_FORMAT_LC2')));
927 function authorInfo()
929 return JText::sprintf('Written by', $this->_component->escape($this->_article->created_by_alias
930 ? $this->_article->created_by_alias : $this->_article->author));
938 return JHTML::_('icon.pdf', $this->_article, $this->_componentParams, $this->_component->access);
946 return JHTML::_('icon.email', $this->_article, $this->_componentParams, $this->_component->access);
954 return JHTML::_('icon.edit', $this->_article, $this->_componentParams, $this->_component->access);
960 function printPopupIcon()
962 return JHTML::_('icon.print_popup', $this->_article, $this->_componentParams, $this->_component->access);
968 function printScreenIcon()
970 return JHtml::_('icon.print_screen', $this->_article, $this->_componentParams, $this->_component->access);
974 class ArtxContentArticleView16 extends ArtxContentGeneralArticleView
979 function ArtxContentArticleView16($component, $componentParams, $article, $print)
981 parent::ArtxContentGeneralArticleView($component, $componentParams, $article);
983 $user = JFactory::getUser();
985 $this->print = $print;
986 $this->canEdit = $this->_article->params->get('access-edit');
987 $this->title = $this->_article->title;
988 $this->titleVisible = $this->_article->params->get('show_title');
989 $this->titleLink = $this->_article->params->get('link_titles') && !empty($this->_article->readmore_link)
990 ? $this->_article->readmore_link : '';
991 $this->hits = $this->_article->hits;
992 $this->showCreateDate = $this->_article->params->get('show_create_date');
993 $this->showModifyDate = $this->_article->params->get('show_modify_date');
994 $this->showPublishDate = $this->_article->params->get('show_publish_date');
995 $this->showAuthor = $this->_article->params->get('show_author') && !empty($this->_article->author);
996 $this->showPdfIcon = false; // - not available in J! 1.6
997 $this->showPrintIcon = $this->_article->params->get('show_print_icon');
998 $this->showEmailIcon = $this->_article->params->get('show_email_icon');
999 $this->showHits = $this->_article->params->get('show_hits');
1000 $this->showUrl = false; // - not available in J! 1.6
1001 $this->showIntro = $this->_article->params->get('show_intro');
1002 $this->showReadmore = $this->_article->params->get('show_readmore') && $this->_article->fulltext != null;
1003 $this->showTeaser = $this->_article->params->get('show_noauth') == true && $user->get('guest');
1004 $this->showText = $this->_article->params->get('access-view');
1006 $this->showParentCategory = $this->_article->params->get('show_parent_category') && $this->_article->parent_slug != '1:root';
1007 $this->parentCategory = $this->showParentCategory ? $this->_article->parent_title : '';
1008 $this->parentCategoryLink = ($this->showParentCategory && $this->_article->params->get('link_parent_category') && $this->_article->parent_slug)
1009 ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->parent_slug)) : '';
1010 $this->showCategory = $this->_article->params->get('show_category');
1011 $this->category = $this->showCategory ? $this->_article->category_title : '';
1012 $this->categoryLink = ($this->showCategory && $this->_article->params->get('link_category') && $this->_article->catslug)
1013 ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug)) : '';
1019 function createDateInfo()
1021 return JHtml::_('date', $this->_article->created, JText::_('DATE_FORMAT_LC2'));
1027 function modifyDateInfo()
1029 return JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $this->_article->modified, JText::_('DATE_FORMAT_LC2')));
1035 function publishDateInfo()
1037 return JText::sprintf('COM_CONTENT_PUBLISHED_DATE', JHtml::_('date', $this->_article->publish_up, JText::_('DATE_FORMAT_LC2')));
1043 function authorInfo()
1045 $author = $this->_article->created_by_alias ? $this->_article->created_by_alias : $this->_article->author;
1046 if (!empty($this->_article->contactid) && $this->_article->params->get('link_author'))
1047 return JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link',
1048 JRoute::_('index.php?option=com_contact&view=contact&id=' . $this->_article->contactid), $author));
1049 return JText::sprintf('COM_CONTENT_WRITTEN_BY', $author);
1055 function emailIcon()
1057 return JHtml::_('icon.email', $this->_article, $this->_article->params);
1065 return JHtml::_('icon.edit', $this->_article, $this->_article->params);
1071 function printPopupIcon()
1073 return JHtml::_('icon.print_popup', $this->_article, $this->_article->params);
1079 function printScreenIcon()
1081 return JHtml::_('icon.print_screen', $this->_article, $this->_article->params);
1089 return JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->_article->hits);
1095 function introText()
1097 return "<div class=\"art-article\">" . $this->_article->introtext . "</div>";
1106 $link1 = JRoute::_('index.php?option=com_users&view=login');
1107 $link = new JURI($link1);
1108 $content .= '<p class="readmore"><a href="' . $link . '">';
1109 $attribs = json_decode($this->_article->attribs);
1110 if ($attribs->alternative_readmore == null) {
1111 $content .= JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
1112 } elseif ($readmore = $this->_article->alternative_readmore) {
1113 $content .= $readmore;
1114 if ($this->_article->params->get('show_readmore_title', 0) != 0) {
1115 $content .= JHTML::_('string.truncate', ($this->_article->title), $this->_article->params->get('readmore_limit'));
1117 } elseif ($this->_article->get('show_readmore_title', 0) == 0) {
1118 $content .= JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
1120 $content .= JText::_('COM_CONTENT_READ_MORE');
1121 $content .= JHTML::_('string.truncate', ($this->_article->title), $this->_article->params->get('readmore_limit'));
1123 $content .= '</a></p>';
1129 * Based on Joomla 1.5.23.
1131 class ArtxContentFrontpageItemView15 extends ArtxContentGeneralArticleView
1136 function ArtxContentFrontpageItemView15(&$component, &$componentParams, &$article)
1138 parent::ArtxContentGeneralArticleView($component, $componentParams, $article);
1140 $this->canEdit = $this->_component->user->authorize('com_content', 'edit', 'content', 'all')
1141 || $this->_component->user->authorize('com_content', 'edit', 'content', 'own');
1142 $this->title = $this->_article->title;
1143 $this->titleVisible = $this->_article->params->get('show_title') && strlen($this->title);
1144 $this->titleLink = $this->_article->params->get('link_titles') && '' != $this->_article->readmore_link
1145 ? $this->_article->readmore_link : '';
1146 $this->showCreateDate = $this->_article->params->get('show_create_date');
1147 $this->showModifyDate = 0 != intval($this->_article->modified) && $this->_article->params->get('show_modify_date');
1148 $this->showPublishDate = false; // - not available in J! 1.5
1149 $this->showAuthor = $this->_article->params->get('show_author') && '' != $this->_article->author;
1150 $this->showPdfIcon = $this->_article->params->get('show_pdf_icon');
1151 $this->showPrintIcon = $this->_article->params->get('show_print_icon');
1152 $this->showEmailIcon = $this->_article->params->get('show_email_icon');
1153 $this->showHits = false; // - not available in J! 1.5
1154 $this->showUrl = $this->_componentParams->get('show_url') && $this->_article->urls;
1155 $this->showIntro = $this->_article->params->get('show_intro');
1156 $this->showReadmore = $this->_article->params->get('show_readmore') && $this->_article->readmore;
1157 $this->showTeaser = true; // - not available in J! 1.5
1158 $this->showText = false; // - not available in J! 1.5
1161 $this->showParentCategory = $this->_article->params->get('show_section') && $this->_article->sectionid && isset($this->_article->section);
1162 $this->parentCategory = $this->showParentCategory ? $this->_article->section : '';
1163 $this->parentCategoryLink = ($this->showParentCategory && $this->_article->params->get('link_section'))
1164 ? JRoute::_(ContentHelperRoute::getSectionRoute($this->_article->sectionid)) : '';
1165 $this->showCategory = $this->_article->params->get('show_category') && $this->_article->catid;
1166 $this->category = $this->showCategory ? $this->_article->category : '';
1167 $this->categoryLink = ($this->showCategory && $this->_article->params->get('link_category'))
1168 ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug, $this->_article->sectionid)) : '';
1174 function createDateInfo()
1176 return JHTML::_('date', $this->_article->created, JText::_('DATE_FORMAT_LC2'));
1182 function modifyDateInfo()
1184 return JText::sprintf('LAST_UPDATED2', JHTML::_('date', $this->_article->modified, JText::_('DATE_FORMAT_LC2')));
1190 function authorInfo()
1192 return JText::sprintf('Written by', $this->_component->escape($this->_article->created_by_alias
1193 ? $this->_article->created_by_alias : $this->_article->author));
1201 return JHTML::_('icon.pdf', $this->_article, $this->_article->params, $this->_component->access);
1207 function emailIcon()
1209 return JHTML::_('icon.email', $this->_article, $this->_article->params, $this->_component->access);
1217 return JHTML::_('icon.edit', $this->_article, $this->_article->params, $this->_component->access);
1223 function printPopupIcon()
1225 return JHTML::_('icon.print_popup', $this->_article, $this->_article->params, $this->_component->access);
1231 function introText()
1233 return "<div class=\"art-article\">" . $this->_article->text . "</div>";
1241 if ($this->_article->readmore_register)
1242 $text = JText::_('Register to read more...');
1243 elseif ($readmore = $this->_article->params->get('readmore'))
1246 $text = JText::sprintf('Read more...');
1247 return '<p class="readmore">' . artxLinkButton(array(
1248 'classes' => array('a' => 'readon'),
1249 'link' => $this->_article->readmore_link,
1250 'content' => str_replace(' ', ' ', $text))) . '</p>';
1255 * Based on Joomla 1.6.1
1257 class ArtxContentFeaturedItemView16 extends ArtxContentGeneralArticleView
1262 function ArtxContentFeaturedItemView16($component, $componentParams, $article)
1264 parent::ArtxContentGeneralArticleView($component, $componentParams, $article);
1266 $this->canEdit = $this->_article->params->get('access-edit');
1267 $this->title = $this->_article->title;
1268 $this->titleVisible = $this->_article->params->get('show_title') && strlen($this->title);
1269 $this->titleLink = $this->_article->params->get('link_titles') && $this->_article->params->get('access-view')
1270 ? JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid)) : '';
1271 $this->hits = $this->_article->hits;
1272 $this->showCreateDate = $this->_article->params->get('show_create_date');
1273 $this->showModifyDate = $this->_article->params->get('show_modify_date');
1274 $this->showPublishDate = $this->_article->params->get('show_publish_date');
1275 $this->showAuthor = $this->_article->params->get('show_author') && !empty($this->_article->author);
1276 $this->showPdfIcon = false; // - not available in J! 1.6
1277 $this->showPrintIcon = $this->_article->params->get('show_print_icon');
1278 $this->showEmailIcon = $this->_article->params->get('show_email_icon');
1279 $this->showHits = $this->_article->params->get('show_hits');
1280 $this->showUrl = false; // - not available in J! 1.6
1281 $this->showIntro = $this->_article->params->get('show_intro');
1282 $this->showReadmore = $this->_article->params->get('show_readmore') && $this->_article->readmore;
1283 $this->showTeaser = true;
1284 $this->showText = false;
1286 // Because category blog layout view does not support catslug:
1287 if (!isset($this->_article->catslug))
1288 $this->_article->catslug = $this->_article->category_alias ? ($this->_article->catid . ':' . $this->_article->category_alias) : $this->_article->catid;
1289 if (!isset($this->_article->parent_slug))
1290 $this->_article->parent_slug = $this->_article->parent_alias ? ($this->_article->parent_id . ':' . $this->_article->parent_alias) : $this->_article->parent_id;
1292 $this->showParentCategory = $this->_article->params->get('show_parent_category') && $this->_article->parent_id != 1;
1293 $this->parentCategory = $this->showParentCategory ? $this->_article->parent_title : '';
1294 $this->parentCategoryLink = ($this->showParentCategory && $this->_article->params->get('link_parent_category') && $this->_article->parent_slug)
1295 ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->parent_slug)) : '';
1296 $this->showCategory = $this->_article->params->get('show_category');
1297 $this->category = $this->showCategory ? $this->_article->category_title : '';
1298 $this->categoryLink = ($this->showCategory && $this->_article->params->get('link_category') && $this->_article->catslug)
1299 ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug)) : '';
1305 function createDateInfo()
1307 return JHtml::_('date', $this->_article->created, JText::_('DATE_FORMAT_LC2'));
1313 function modifyDateInfo()
1315 return JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $this->_article->modified, JText::_('DATE_FORMAT_LC2')));
1321 function publishDateInfo()
1323 return JText::sprintf('COM_CONTENT_PUBLISHED_DATE', JHtml::_('date', $this->_article->publish_up, JText::_('DATE_FORMAT_LC2')));
1329 function authorInfo()
1331 $author = $this->_article->created_by_alias ? $this->_article->created_by_alias : $this->_article->author;
1332 if (!empty($this->_article->contactid) && $this->_article->params->get('link_author'))
1333 return JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link',
1334 JRoute::_('index.php?option=com_contact&view=contact&id=' . $this->_article->contactid), $author));
1335 return JText::sprintf('COM_CONTENT_WRITTEN_BY', $author);
1341 function emailIcon()
1343 return JHtml::_('icon.email', $this->_article, $this->_article->params);
1351 return JHtml::_('icon.edit', $this->_article, $this->_article->params);
1357 function printPopupIcon()
1359 return JHtml::_('icon.print_popup', $this->_article, $this->_article->params);
1367 return JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->_article->hits);
1373 function introText()
1375 return "<div class=\"art-article\">" . $this->_article->introtext . "</div>";
1383 if ($this->_article->params->get('access-view')) {
1384 $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
1386 $app = JFactory::getApplication();
1387 $menu = $app->getMenu();
1388 $active = $menu->getActive();
1389 $itemId = $active->id;
1390 $link1 = JRoute::_('index.php?option=com_users&view=login&&Itemid=' . $itemId);
1391 $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
1392 $link = new JURI($link1);
1393 $link->setVar('return', base64_encode($returnURL));
1395 if (!$this->_article->params->get('access-view'))
1396 $text = JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
1397 elseif ($readmore = $this->_article->alternative_readmore) {
1399 if ($this->_article->params->get('show_readmore_title', 0) != 0)
1400 $text .= JHtml::_('string.truncate', ($this->_article->title), $this->_article->params->get('readmore_limit'));
1401 } elseif ($this->_article->params->get('show_readmore_title', 0) == 0)
1402 $text = JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
1404 $text = JText::_('COM_CONTENT_READ_MORE') . JHtml::_('string.truncate', $this->_article->title, $this->_article->params->get('readmore_limit'));
1405 return '<p class="readmore">' . artxLinkButton(array(
1406 'classes' => array('a' => 'readon'),
1408 'content' => str_replace(' ', ' ', $text))) . '</p>';
1414 * Renders article or block in the Post style.
1416 * Elements of the $data array:
1421 * 'metadata-header-icons'
1422 * 'metadata-footer-icons'
1425 function artxPost($data)
1427 if (is_string($data))
1428 $data = array('content' => $data);
1429 $classes = isset($data['classes']) && strlen($data['classes']) ? $data['classes'] : '';
1430 artxFragmentBegin(str_replace('class="art-post">', 'class="art-post' . $classes . '">', "<div class=\"art-post\">\r\n <div class=\"art-post-body\">\r\n<div class=\"art-post-inner\">\r\n"));
1431 artxFragmentBegin("<h2 class=\"art-postheader\">" . JHTML::_('image.site', 'postheadericon.png', null, null, null, '', array('width' => '25', 'height' => '22')) . " ");
1432 artxFragmentBegin("");
1433 if (isset($data['header-text']) && strlen($data['header-text'])) {
1434 if (isset($data['header-link']) && strlen($data['header-link']))
1435 artxFragmentContent('<a href="' . $data['header-link'] . '" class="PostHeader">' . $data['header-text'] . '</a>');
1437 artxFragmentContent($data['header-text']);
1439 artxFragmentEnd("\r\n");
1440 artxFragmentEnd("</h2>\r\n");
1441 artxFragmentBegin("<div class=\"art-postheadericons art-metadata-icons\">\r\n");
1442 if (isset($data['metadata-header-icons']) && count($data['metadata-header-icons']))
1443 foreach ($data['metadata-header-icons'] as $icon)
1444 artxFragment('', $icon, '', ' | ');
1445 artxFragmentEnd("\r\n</div>\r\n");
1446 artxFragmentBegin("<div class=\"art-postcontent\">\r\n");
1447 if (isset($data['content']) && strlen($data['content']))
1448 artxFragmentContent(artxPostprocessPostContent($data['content']));
1449 artxFragmentEnd("\r\n</div>\r\n<div class=\"cleared\"></div>\r\n");
1450 artxFragmentBegin("<div class=\"art-postmetadatafooter\">\r\n");
1451 artxFragmentBegin("<div class=\"art-postfootericons art-metadata-icons\">\r\n");
1452 if (isset($data['metadata-footer-icons']) && count($data['metadata-footer-icons']))
1453 foreach ($data['metadata-footer-icons'] as $icon)
1454 artxFragment('', $icon, '', ' | ');
1455 artxFragmentEnd("\r\n</div>\r\n");
1456 artxFragmentEnd("\r\n</div>\r\n");
1457 return artxFragmentEnd("\r\n</div>\r\n\r\n <div class=\"cleared\"></div>\r\n </div>\r\n</div>\r\n", '', true);
1460 function artxBlock($caption, $content, $classes = '')
1462 $hasCaption = ($GLOBALS['artx_settings']['block']['has_header']
1463 && null !== $caption && strlen(trim($caption)) > 0);
1464 $hasContent = (null !== $content && strlen(trim($content)) > 0);
1466 if (!$hasCaption && !$hasContent)
1471 <?php ob_start(); ?>
1472 <div class="art-block">
1473 <div class="art-block-body">
1475 <?php echo str_replace('class="art-block">', 'class="art-block' . $classes . '">', ob_get_clean()); ?>
1476 <?php if ($hasCaption): ?>
1477 <div class="art-blockheader">
1478 <div class="l"></div>
1479 <div class="r"></div>
1481 <?php echo $caption; ?>
1485 <?php if ($hasContent): ?>
1486 <div class="art-blockcontent">
1487 <div class="art-blockcontent-body">
1489 <?php echo artxPostprocessBlockContent($content); ?>
1492 <div class="cleared"></div>
1498 <div class="cleared"></div>
1503 return ob_get_clean();
1507 function artxVMenuBlock($caption, $content, $classes = '')
1509 $hasCaption = (null !== $caption && strlen(trim($caption)) > 0);
1510 $hasContent = (null !== $content && strlen(trim($content)) > 0);
1512 if (!$hasCaption && !$hasContent)
1517 <?php ob_start(); ?><div class="art-vmenublock">
1518 <div class="art-vmenublock-body">
1520 <?php echo str_replace('class="art-vmenublock">', 'class="art-vmenublock' . $classes . '">', ob_get_clean()); ?>
1521 <?php if ($hasCaption): ?><div class="art-vmenublockheader">
1523 <?php echo $caption; ?></h3>
1526 <?php if ($hasContent): ?><div class="art-vmenublockcontent">
1527 <div class="art-vmenublockcontent-body">
1529 <?php echo $content; ?>
1531 <div class="cleared"></div>
1536 <div class="cleared"></div>
1541 return ob_get_clean();
1545 * Deprecated since Artisteer 3.0.
1547 function artxCountModules(&$document, $position)
1549 return $document->artx->countModules($position);
1553 * Deprecated since Artisteer 3.0.
1555 function artxPositions(&$document, $positions, $style)
1558 if (count($positions) == 3) {
1559 if (artxCountModules($document, $positions[0])
1560 && artxCountModules($document, $positions[1])
1561 && artxCountModules($document, $positions[2]))
1564 <table class="position" cellpadding="0" cellspacing="0" border="0">
1566 <td width="33%"><?php echo artxModules($document, $positions[0], $style); ?></td>
1567 <td width="33%"><?php echo artxModules($document, $positions[1], $style); ?></td>
1568 <td><?php echo artxModules($document, $positions[2], $style); ?></td>
1572 } elseif (artxCountModules($document, $positions[0]) && artxCountModules($document, $positions[1])) {
1574 <table class="position" cellpadding="0" cellspacing="0" border="0">
1576 <td width="33%"><?php echo artxModules($document, $positions[0], $style); ?></td>
1577 <td><?php echo artxModules($document, $positions[1], $style); ?></td>
1581 } elseif (artxCountModules($document, $positions[1]) && artxCountModules($document, $positions[2])) {
1583 <table class="position" cellpadding="0" cellspacing="0" border="0">
1585 <td width="67%"><?php echo artxModules($document, $positions[1], $style); ?></td>
1586 <td><?php echo artxModules($document, $positions[2], $style); ?></td>
1590 } elseif (artxCountModules($document, $positions[0]) && artxCountModules($document, $positions[2])) {
1592 <table class="position" cellpadding="0" cellspacing="0" border="0">
1594 <td width="50%"><?php echo artxModules($document, $positions[0], $style); ?></td>
1595 <td><?php echo artxModules($document, $positions[2], $style); ?></td>
1600 echo artxModules($document, $positions[0], $style);
1601 echo artxModules($document, $positions[1], $style);
1602 echo artxModules($document, $positions[2], $style);
1604 } elseif (count($positions) == 2) {
1605 if (artxCountModules($document, $positions[0]) && artxCountModules($document, $positions[1])) {
1607 <table class="position" cellpadding="0" cellspacing="0" border="0">
1609 <td width="50%"><?php echo artxModules($document, $positions[0], $style); ?></td>
1610 <td><?php echo artxModules($document, $positions[1], $style); ?></td>
1615 echo artxModules($document, $positions[0], $style);
1616 echo artxModules($document, $positions[1], $style);
1618 } // count($positions)
1619 return ob_get_clean();
1623 * Deprecated since Artisteer 3.0.
1625 function artxComponentWrapper(&$document)
1627 $this->artx->componentWrapper();
1631 * Deprecated since Artisteer 3.0.
1633 function artxModules(&$document, $position, $style = null)
1635 $this->artx->position($position, $style);
1639 function artxUrlToHref($url)
1642 $p = parse_url($url);
1643 if (isset($p['scheme']) && isset($p['host'])) {
1644 $result = $p['scheme'] . '://';
1645 if (isset($p['user'])) {
1646 $result .= $p['user'];
1647 if (isset($p['pass']))
1648 $result .= ':' . $p['pass'];
1651 $result .= $p['host'];
1652 if (isset($p['port']))
1653 $result .= ':' . $p['port'];
1654 if (!isset($p['path']))
1657 if (isset($p['path']))
1658 $result .= $p['path'];
1659 if (isset($p['query'])) {
1660 $result .= '?' . str_replace('&', '&', $p['query']);
1662 if (isset($p['fragment']))
1663 $result .= '#' . $p['fragment'];
1668 * Searches $content for tags and returns information about each found tag.
1670 * Created to support button replacing process, e.g. wrapping submit/reset
1671 * inputs and buttons with artisteer style.
1673 * When all the $name tags are found, they are processed by the $filter specified.
1674 * Filter is applied to the attributes. When an attribute contains several values
1675 * (e.g. class attribute), only tags that contain all the values from filter
1676 * will be selected. E.g. filtering by the button class will select elements
1677 * with class="button" and class="button validate".
1679 * Parsing does not support nested tags. Looking for span tags in
1680 * <span>1<span>2</span>3</span> will return <span>1<span>2</span> and
1684 * Select all tags with class='readon':
1685 * artxFindTags($html, array('*' => array('class' => 'readon')))
1686 * Select inputs with type='submit' and class='button':
1687 * artxFindTags($html, array('input' => array('type' => 'submit', 'class' => 'button')))
1688 * Select inputs with type='submit' and class='button validate':
1689 * artxFindTags($html, array('input' => array('type' => 'submit', 'class' => array('button', 'validate'))))
1690 * Select inputs with class != 'art-button'
1691 * artxFindTags($html, array('input' => array('class' => '!art-button')))
1692 * Select inputs with non-empty class
1693 * artxFindTags($html, array('input' => array('class' => '!')))
1694 * Select inputs with class != 'art-button' and non-empty class:
1695 * artxFindTags($html, array('input' => array('class' => array('!art-button', '!'))))
1696 * Select inputs with class = button but != 'art-button'
1697 * artxFindTags($html, array('input' => array('class' => array('button', '!art-button'))))
1699 * @return array of text fragments and tag information: position, length,
1700 * name, attributes, raw_open_tag, body.
1702 function artxFindTags($content, $filters)
1704 $result = array('');
1707 $name = implode('|', array_keys($filters));
1708 $name = str_replace('*', '\w+', $name);
1709 // search for open tag
1711 '~<(' . $name . ')\b(?:\s+[^\s]+\s*=\s*(?:"[^"]+"|\'[^\']+\'|[^\s>]+))*\s*/?>~i', $content,
1712 $tagMatches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER))
1714 foreach ($tagMatches as $tagMatch) {
1715 $rawMatch = $tagMatch[0][0];
1716 $name = $tagMatch[1][0];
1717 $tag = array('name' => $name, 'position' => $tagMatch[0][1]);
1718 $openTagTail = (strlen($rawMatch) > 1 && '/' == $rawMatch[strlen($rawMatch) - 2])
1720 // different instructions for paired and unpaired tags
1726 $tag['paired'] = false;
1727 $tag['length'] = strlen($tagMatch[0][0]);
1728 $tag['body'] = null;
1729 $tag['close'] = 2 == strlen($openTagTail);
1732 $closeTag = '</' . $name . '>';
1733 $closeTagLength = strlen($closeTag);
1734 $tag['paired'] = true;
1735 $end = strpos($content, $closeTag, $tag['position']);
1738 $openTagLength = strlen($tagMatch[0][0]);
1739 $tag['body'] = substr($content, $tag['position'] + $openTagLength,
1740 $end - $openTagLength - $tag['position']);
1741 $tag['length'] = $end + $closeTagLength - $tag['position'];
1745 $rawAttributes = trim(substr($tagMatch[0][0], strlen($name) + 1,
1746 strlen($tagMatch[0][0]) - strlen($name) - 1 - strlen($openTagTail)));
1747 $attributes = array();
1748 if (preg_match_all('~([^=\s]+)\s*=\s*(?:(")([^"]+)"|(\')([^\']+)\'|([^\s]+))~',
1749 $rawAttributes, $attributeMatches, PREG_SET_ORDER))
1751 foreach ($attributeMatches as $attrMatch) {
1752 $attrName = $attrMatch[1];
1753 $attrDelimeter = (isset($attrMatch[2]) && '' !== $attrMatch[2])
1755 : ((isset($attrMatch[4]) && '' !== $attrMatch[4])
1756 ? $attrMatch[4] : '');
1757 $attrValue = (isset($attrMatch[3]) && '' !== $attrMatch[3])
1759 : ((isset($attrMatch[5]) && '' !== $attrMatch[5])
1760 ? $attrMatch[5] : $attrMatch[6]);
1761 if ('class' == $attrName)
1762 $attrValue = explode(' ', preg_replace('~\s+~', ' ', $attrValue));
1763 $attributes[$attrName] = array('delimeter' => $attrDelimeter,
1764 'value' => $attrValue);
1767 // apply filter to attributes
1769 $filter = isset($filters[$name])
1771 : (isset($filters['*']) ? $filters['*'] : array());
1772 foreach ($filter as $key => $value) {
1773 $criteria = is_array($value) ? $value : array($value);
1774 for ($c = 0; $c < count($criteria) && $passed; $c++) {
1775 $crit = $criteria[$c];
1777 // attribute should be empty
1778 if ('class' == $key) {
1779 if (isset($attributes[$key]) && count($attributes[$key]['value']) != 0) {
1784 if (isset($attributes[$key]) && strlen($attributes[$key]['value']) != 0) {
1789 } else if ('!' == $crit) {
1790 // attribute should be not set or empty
1791 if ('class' == $key) {
1792 if (!isset($attributes[$key]) || count($attributes[$key]['value']) == 0) {
1797 if (!isset($attributes[$key]) || strlen($attributes[$key]['value']) == 0) {
1802 } else if ('!' == $crit[0]) {
1803 // * attribute should not contain value
1804 // * if attribute is empty, it does not contain value
1805 if ('class' == $key) {
1806 if (isset($attributes[$key]) && count($attributes[$key]['value']) != 0
1807 && in_array(substr($crit, 1), $attributes[$key]['value']))
1813 if (isset($attributes[$key]) && strlen($attributes[$key]['value']) != 0
1814 && $crit == $attributes[$key]['value'])
1821 // * attribute should contain value
1822 // * if attribute is empty, it does not contain value
1823 if ('class' == $key) {
1824 if (!isset($attributes[$key]) || count($attributes[$key]['value']) == 0) {
1828 if (!in_array($crit, $attributes[$key]['value'])) {
1833 if (!isset($attributes[$key]) || strlen($attributes[$key]['value']) == 0) {
1837 if ($crit != $attributes[$key]['value']) {
1849 // finalize tag info constrution
1850 $tag['attributes'] = $attributes;
1851 $result[$index] = substr($content, $position, $tag['position'] - $position);
1852 $position = $tag['position'] + $tag['length'];
1854 $result[$index] = $tag;
1858 $result[$index] = $position < strlen($content) ? substr($content, $position) : '';
1863 * Converts tag info created by artxFindTags back to text tag.
1867 function artxTagInfoToString($info)
1869 $result = '<' . $info['name'];
1870 if (isset($info['attributes']) && 0 != count($info['attributes'])) {
1872 foreach ($info['attributes'] as $key => $value)
1873 $attributes .= ' ' . $key . '=' . $value['delimeter']
1874 . (is_array($value['value']) ? implode(' ', $value['value']) : $value['value'])
1875 . $value['delimeter'];
1876 $result .= $attributes;
1878 if ($info['paired']) {
1880 $result .= $info['body'];
1881 $result .= '</' . $info['name'] . '>';
1883 $result .= ($info['close'] ? ' /' : '') . '>';
1888 * Decorates the specified tag with artisteer button style.
1890 * @param string $name tag name that should be decorated
1891 * @param array $filter select $name tags with attributes matching $filter
1892 * @return $content with replaced $name tags
1894 function artxReplaceButtons($content, $filter = array('input' => array('class' => 'button')))
1897 foreach (artxFindTags($content, $filter) as $tag) {
1898 if (is_string($tag))
1901 $tag['attributes']['class']['value'][] = 'art-button';
1902 $delimeter = '' == $tag['attributes']['class']['delimeter']
1903 ? '"' : $tag['attributes']['class']['delimeter'];
1904 $tag['attributes']['class']['delimeter'] = $delimeter;
1905 $button = str_replace('"', $delimeter, '<span class="art-button-wrapper">'
1906 . '<span class="art-button-l"> </span><span class="art-button-r"> </span>')
1907 . artxTagInfoToString($tag) . '</span>';
1914 function artxLinkButton($data = array())
1916 return '<span class="art-button-wrapper"><span class="art-button-l"> </span><span class="art-button-r"> </span>'
1917 . '<a class="' . (isset($data['classes']) && isset($data['classes']['a']) ? $data['classes']['a'] . ' ' : '')
1918 . 'art-button" href="' . $data['link'] . '">' . $data['content'] . '</a></span>';
1921 function artxHtmlFixFormAction($content)
1923 if (preg_match('~ action="([^"]+)" ~', $content, $matches, PREG_OFFSET_CAPTURE)) {
1924 $content = substr($content, 0, $matches[0][1])
1925 . ' action="' . artxUrlToHref($matches[1][0]) . '" '
1926 . substr($content, $matches[0][1] + strlen($matches[0][0]));
1931 function artxTagBuilder($tag, $attributes, $content) {
1932 $result = '<' . $tag;
1933 foreach ($attributes as $name => $value) {
1934 if (is_string($value)) {
1936 $result .= ' ' . $name . '="' . $value . '"';
1937 } else if (is_array($value)) {
1938 $values = array_filter($value);
1940 $result .= ' ' . $name . '="' . implode(' ', $value) . '"';
1943 $result .= '>' . $content . '</' . $tag . '>';
1947 $artxFragments = array();
1949 function artxFragmentBegin($head = '')
1951 global $artxFragments;
1952 $artxFragments[] = array('head' => $head, 'content' => '', 'tail' => '');
1955 function artxFragmentContent($content = '')
1957 global $artxFragments;
1958 $artxFragments[count($artxFragments) - 1]['content'] = $content;
1961 function artxFragmentEnd($tail = '', $separator = '', $return = false)
1963 global $artxFragments;
1964 $fragment = array_pop($artxFragments);
1965 $fragment['tail'] = $tail;
1966 $content = trim($fragment['content']);
1967 if (count($artxFragments) == 0) {
1969 return (trim($content) == '') ? '' : ($fragment['head'] . $content . $fragment['tail']);
1970 echo (trim($content) == '') ? '' : ($fragment['head'] . $content . $fragment['tail']);
1972 $result = (trim($content) == '') ? '' : ($fragment['head'] . $content . $fragment['tail']);
1973 $fragment =& $artxFragments[count($artxFragments) - 1];
1974 $fragment['content'] .= (trim($fragment['content']) == '' ? '' : $separator) . $result;
1978 function artxFragment($head = '', $content = '', $tail = '', $separator = '', $return = false)
1980 global $artxFragments;
1981 if ($head != '' && $content == '' && $tail == '' && $separator == '') {
1984 } elseif ($head != '' && $content != '' && $tail == '' && $separator == '') {
1985 $separator = $content;
1989 artxFragmentBegin($head);
1990 artxFragmentContent($content);
1991 artxFragmentEnd($tail, $separator, $return);
1995 function artxPostprocessBlockContent($content)
1997 return artxPostprocessContent($content);
2000 function artxPostprocessPostContent($content)
2002 return artxPostprocessContent($content);
2005 function artxPostprocessContent($content)
2007 $content = artxReplaceButtons($content, array('input' => array('class' => array('button', '!art-button')),
2008 'button' => array('class' => array('button', '!art-button'))));