table {
text-align: left;
}
-#main-nav li.begin { margin: 0 0 0 2em; }
-#main-nav li ul { _top: 1.8em; }
-#main-nav li ul li.begin { margin: 0 0 0 2.5em !important; }
-#main-nav { font-size: 74%; }
/* inner table style canceled */
.simple-table table
{
width:60%;
margin: 5% auto 0;
}
-/* Main nav */
-#main-nav
-{
- background: #6c0006 url("../images/nav_bg.gif") repeat-x;
- padding: .1em 0;
- margin: 0 0 25px 0;
- font-size: 78%;
- line-height: 140%;
- border-top: 2px solid #6c0006;
- border-bottom: 2px solid #6c0006;
- position: relative;
-}
-#main-nav li
-{
- display: inline;
- list-style: none;
- padding: 0 1em;
- margin: 0;
- line-height: 130%;
-}
-#main-nav li a
-{
-/* color: #fff;*/
- text-decoration: none;
- text-shadow: 2px 2px #6c0006;
- font-weight: bold;
- margin: 0;
- padding: .1em 1em .3em 1em !important;
-}
-
-#main-nav li.begin { margin: 0 0 0 1.4em; }
-
-#main-nav li a:hover, #main-nav li#high li a:hover
-{
- color: #adb8c4;
- text-decoration: none;
- text-shadow: none;
-}
-
-/* Highlights for main nav */
-#main-nav li#high a.top, #main-nav li#high li.select a
-{
-/* color: #fff !important;*/
- background: #adb8c4 url("../images/sub_bg.gif") repeat-x top !important;
- margin: 0;
- border: 1px solid #789;
- border-top: 1px solid #56626d;
- border-bottom: 1px solid #adb8c4;
- text-shadow: 2px 2px #56626d !important;
-}
-
-/* subnav */
-#main-nav li ul
-{
- display: none;
- background: url("../images/main_select_bg.gif") top repeat-x #789;
- padding: .2em 0;
- margin: 1px 0 0 0;
- position: absolute;
- left: 0;
- top: 1.51em;
-/* z-index: 2;*/
- width: 100%;
- border-bottom: 1px solid #56626d;
-}
-#main-nav li ul li
-{
- padding: .2em;
- margin: 0;
-}
-#main-nav li ul li a, #main-nav li#high li.select ul li a
-{
-/* color: #fff !important;*/
- font-weight: normal;
- border: none;
- background: transparent !important;
- padding: .2em .4em !important;
- text-shadow: none !important;
-}
-#main-nav li ul li.begin { margin: 0 0 0 1.8em !important; }
-#main-nav li ul li a:hover { color: #56626d !important; }
/* default table define */
table {
+++ /dev/null
-<?php
-
-defined('_JEXEC') or die;
-
-if (!defined('_ARTX_FUNCTIONS')) {
-
- define('_ARTX_FUNCTIONS', 1);
- define('_M3_BUTTON_CLASS', 'btn'); // Magic3用のボタンクラス
-
- $GLOBALS['artx_settings'] = array(
- 'block' => array('has_header' => true),
- 'menu' => array('show_submenus' => true),
- 'vmenu' => array('show_submenus' => false, 'simple' => false)
- );
-
- require_once dirname(__FILE__) . '/library/Artx.php';
-
- /**
- * Decorates an article or block with the art-post style.
- *
- * Elements of the $data array:
- * 'classes'
- * 'header-text'
- * 'header-icon'
- * 'header-link'
- * 'metadata-header-icons'
- * 'metadata-footer-icons'
- * 'content'
- */
- function artxPost($data)
- {
- if (is_string($data))
- $data = array('content' => $data);
- $classes = isset($data['classes']) && strlen($data['classes']) ? $data['classes'] : '';
- artxFragmentBegin("<article class=\"art-post" . $classes . "\">");
- artxFragmentBegin("<h2 class=\"art-postheader\">");
- if (isset($data['header-text']) && strlen($data['header-text'])) {
- if (isset($data['header-link']) && strlen($data['header-link']))
- artxFragmentContent('<a href="' . $data['header-link'] . '">' . $data['header-text'] . '</a>');
- else
- artxFragmentContent($data['header-text']);
- }
- artxFragmentEnd("</h2>");
- artxFragmentBegin("<div class=\"art-postheadericons art-metadata-icons\">");
- if (isset($data['metadata-header-icons']) && count($data['metadata-header-icons']))
- foreach ($data['metadata-header-icons'] as $icon)
- artxFragment('', $icon, '', ' | ');
- artxFragmentEnd("</div>");
- artxFragmentBegin("<div class=\"art-postcontent clearfix\">");
- if (isset($data['content']) && strlen($data['content']))
- artxFragmentContent(artxPostprocessPostContent($data['content']));
- artxFragmentEnd("</div>");
- artxFragmentBegin("<div class=\"art-postfootericons art-metadata-icons\">");
- if (isset($data['metadata-footer-icons']) && count($data['metadata-footer-icons']))
- foreach ($data['metadata-footer-icons'] as $icon)
- artxFragment('', $icon, '', ' | ');
- artxFragmentEnd("</div>");
-
- return artxFragmentEnd("</article>", '', true);
-
- }
-
- function artxBlock($caption, $content, $classes = '')
- {
- $hasCaption = ($GLOBALS['artx_settings']['block']['has_header']
- && null !== $caption && strlen(trim($caption)) > 0);
- $hasContent = (null !== $content && strlen(trim($content)) > 0);
- if (!$hasCaption && !$hasContent) return '';
-
- /*
- artxFragmentBegin("<div class=\"art-block clearfix" . $classes . "\">");
- artxFragmentBegin("<div class=\"art-blockheader\"><h3 class=\"t\">");
- artxFragmentContent($caption);
- artxFragmentEnd("</h3></div>");
- artxFragmentBegin("<div class=\"art-blockcontent\">");
- artxFragmentContent(artxPostprocessBlockContent($content));
- artxFragmentEnd("</div>");*/
-
- artxFragmentBegin('<div class="m3widget_box ui-widget">');
- artxFragmentBegin('<div class="m3widget_box_head ui-state-default ui-priority-primary ui-corner-tl ui-corner-tr">');
- artxFragmentContent($caption);
- artxFragmentEnd('</div>');
- artxFragmentBegin('<div class="m3widget_box_content ui-widget-content ui-corner-bl ui-corner-br">');
- artxFragmentContent(artxPostprocessBlockContent($content));
- artxFragmentEnd('</div>');
- return artxFragmentEnd("</div>", '', true);
- }
-
-
-
- function artxUrlToHref($url)
- {
- $result = '';
- $p = parse_url($url);
- if (isset($p['scheme']) && isset($p['host'])) {
- $result = $p['scheme'] . '://';
- if (isset($p['user'])) {
- $result .= $p['user'];
- if (isset($p['pass']))
- $result .= ':' . $p['pass'];
- $result .= '@';
- }
- $result .= $p['host'];
- if (isset($p['port']))
- $result .= ':' . $p['port'];
- if (!isset($p['path']))
- $result .= '/';
- }
- if (isset($p['path']))
- $result .= $p['path'];
- if (isset($p['query'])) {
- $result .= '?' . str_replace('&', '&', $p['query']);
- }
- if (isset($p['fragment']))
- $result .= '#' . $p['fragment'];
- return $result;
- }
-
- /**
- * Searches $content for tags and returns information about each found tag.
- *
- * Created to support button replacing process, e.g. wrapping submit/reset
- * inputs and buttons with artisteer style.
- *
- * When all the $name tags are found, they are processed by the $filter specified.
- * Filter is applied to the attributes. When an attribute contains several values
- * (e.g. class attribute), only tags that contain all the values from filter
- * will be selected. E.g. filtering by the button class will select elements
- * with class="button" and class="button validate".
- *
- * Parsing does not support nested tags. Looking for span tags in
- * <span>1<span>2</span>3</span> will return <span>1<span>2</span> and
- * <span>2</span>.
- *
- * Examples:
- * Select all tags with class='readon':
- * artxFindTags($html, array('*' => array('class' => 'readon')))
- * Select inputs with type='submit' and class='button':
- * artxFindTags($html, array('input' => array('type' => 'submit', 'class' => 'button')))
- * Select inputs with type='submit' and class='button validate':
- * artxFindTags($html, array('input' => array('type' => 'submit', 'class' => array('button', 'validate'))))
- * Select inputs with class != 'art-button'
- * artxFindTags($html, array('input' => array('class' => '!art-button')))
- * Select inputs with non-empty class
- * artxFindTags($html, array('input' => array('class' => '!')))
- * Select inputs with class != 'art-button' and non-empty class:
- * artxFindTags($html, array('input' => array('class' => array('!art-button', '!'))))
- * Select inputs with class = button but != 'art-button'
- * artxFindTags($html, array('input' => array('class' => array('button', '!art-button'))))
- *
- * @return array of text fragments and tag information: position, length,
- * name, attributes, raw_open_tag, body.
- */
- function artxFindTags($content, $filters)
- {
- $result = array('');
- $index = 0;
- $position = 0;
- $name = implode('|', array_keys($filters));
- $name = str_replace('*', '\w+', $name);
- // search for open tag
- if (preg_match_all(
- '~<(' . $name . ')\b(?:\s+[^\s]+\s*=\s*(?:"[^"]+"|\'[^\']+\'|[^\s>]+))*\s*/?' . '>~i', $content,
- $tagMatches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER))
- {
- foreach ($tagMatches as $tagMatch) {
- $rawMatch = $tagMatch[0][0];
- $name = $tagMatch[1][0];
- $normalName = strtolower($name);
- $tag = array('name' => $name, 'position' => $tagMatch[0][1]);
- $openTagTail = (strlen($rawMatch) > 1 && '/' == $rawMatch[strlen($rawMatch) - 2])
- ? '/>' : '>';
- // different instructions for paired and unpaired tags
- switch ($normalName)
- {
- case 'input':
- case 'img':
- case 'br':
- $tag['paired'] = false;
- $tag['length'] = strlen($tagMatch[0][0]);
- $tag['body'] = null;
- $tag['close'] = 2 == strlen($openTagTail);
- break;
- default:
- $closeTag = '</' . $name . '>';
- $closeTagLength = strlen($closeTag);
- $tag['paired'] = true;
- $end = strpos($content, $closeTag, $tag['position']);
- if (false === $end)
- continue;
- $openTagLength = strlen($tagMatch[0][0]);
- $tag['body'] = substr($content, $tag['position'] + $openTagLength,
- $end - $openTagLength - $tag['position']);
- $tag['length'] = $end + $closeTagLength - $tag['position'];
- break;
- }
- // parse attributes
- $rawAttributes = trim(substr($tagMatch[0][0], strlen($name) + 1,
- strlen($tagMatch[0][0]) - strlen($name) - 1 - strlen($openTagTail)));
- $attributes = array();
- if (preg_match_all('~([^=\s]+)\s*=\s*(?:(")([^"]+)"|(\')([^\']+)\'|([^\s]+))~',
- $rawAttributes, $attributeMatches, PREG_SET_ORDER))
- {
- foreach ($attributeMatches as $attrMatch) {
- $attrName = $attrMatch[1];
- $attrDelimeter = (isset($attrMatch[2]) && '' !== $attrMatch[2])
- ? $attrMatch[2]
- : ((isset($attrMatch[4]) && '' !== $attrMatch[4])
- ? $attrMatch[4] : '');
- $attrValue = (isset($attrMatch[3]) && '' !== $attrMatch[3])
- ? $attrMatch[3]
- : ((isset($attrMatch[5]) && '' !== $attrMatch[5])
- ? $attrMatch[5] : $attrMatch[6]);
- if ('class' == $attrName)
- $attrValue = explode(' ', preg_replace('~\s+~', ' ', $attrValue));
- $attributes[$attrName] = array('delimeter' => $attrDelimeter,
- 'value' => $attrValue);
- }
- }
- // apply filter to attributes
- $passed = true;
- $filter = isset($filters[$normalName])
- ? $filters[$normalName]
- : (isset($filters['*']) ? $filters['*'] : array());
- foreach ($filter as $key => $value) {
- $criteria = is_array($value) ? $value : array($value);
- for ($c = 0; $c < count($criteria) && $passed; $c++) {
- $crit = $criteria[$c];
- if ('' == $crit) {
- // attribute should be empty
- if ('class' == $key) {
- if (isset($attributes[$key]) && count($attributes[$key]['value']) != 0) {
- $passed = false;
- break;
- }
- } else {
- if (isset($attributes[$key]) && strlen($attributes[$key]['value']) != 0) {
- $passed = false;
- break;
- }
- }
- } else if ('!' == $crit) {
- // attribute should be not set or empty
- if ('class' == $key) {
- if (!isset($attributes[$key]) || count($attributes[$key]['value']) == 0) {
- $passed = false;
- break;
- }
- } else {
- if (!isset($attributes[$key]) || strlen($attributes[$key]['value']) == 0) {
- $passed = false;
- break;
- }
- }
- } else if ('!' == $crit[0]) {
- // * attribute should not contain value
- // * if attribute is empty, it does not contain value
- if ('class' == $key) {
- if (isset($attributes[$key]) && count($attributes[$key]['value']) != 0
- && in_array(substr($crit, 1), $attributes[$key]['value']))
- {
- $passed = false;
- break;
- }
- } else {
- if (isset($attributes[$key]) && strlen($attributes[$key]['value']) != 0
- && $crit == $attributes[$key]['value'])
- {
- $passed = false;
- break;
- }
- }
- } else {
- // * attribute should contain value
- // * if attribute is empty, it does not contain value
- if ('class' == $key) {
- if (!isset($attributes[$key]) || count($attributes[$key]['value']) == 0) {
- $passed = false;
- break;
- }
- if (!in_array($crit, $attributes[$key]['value'])) {
- $passed = false;
- break;
- }
- } else {
- if (!isset($attributes[$key]) || strlen($attributes[$key]['value']) == 0) {
- $passed = false;
- break;
- }
- if ($crit != $attributes[$key]['value']) {
- $passed = false;
- break;
- }
- }
- }
- }
- if (!$passed)
- break;
- }
- if (!$passed)
- continue;
- // finalize tag info constrution
- $tag['attributes'] = $attributes;
- $result[$index] = substr($content, $position, $tag['position'] - $position);
- $position = $tag['position'] + $tag['length'];
- $index++;
- $result[$index] = $tag;
- $index++;
- }
- }
- $result[$index] = $position < strlen($content) ? substr($content, $position) : '';
- return $result;
- }
-
- /**
- * Converts tag info created by artxFindTags back to text tag.
- *
- * @return string
- */
- function artxTagInfoToString($info)
- {
- $result = '<' . $info['name'];
- if (isset($info['attributes']) && 0 != count($info['attributes'])) {
- $attributes = '';
- foreach ($info['attributes'] as $key => $value)
- $attributes .= ' ' . $key . '=' . $value['delimeter']
- . (is_array($value['value']) ? implode(' ', $value['value']) : $value['value'])
- . $value['delimeter'];
- $result .= $attributes;
- }
- if ($info['paired']) {
- $result .= '>';
- $result .= $info['body'];
- $result .= '</' . $info['name'] . '>';
- } else
- $result .= ($info['close'] ? ' /' : '') . '>';
- return $result;
- }
-
- /**
- * Decorates the specified tag with artisteer button style.
- *
- * @param string $name tag name that should be decorated
- * @param array $filter select $name tags with attributes matching $filter
- * @return $content with replaced $name tags
- */
- function artxReplaceButtons($content, $filter = array('input' => array('class' => 'button')))
- {
- $result = '';
- foreach (artxFindTags($content, $filter) as $tag) {
- if (is_string($tag))
- $result .= $tag;
- else {
- //$tag['attributes']['class']['value'][] = 'art-button'; // 追加しない
- $tag['attributes']['class']['value'] = array(_M3_BUTTON_CLASS); // ボタンクラスを変更
- $result .= artxTagInfoToString($tag);
- }
- }
- return $result;
- }
-
- function artxLinkButton($data = array())
- {
- return '<a class="' . (isset($data['classes']) && isset($data['classes']['a']) ? $data['classes']['a'] . ' ' : '')
- . 'art-button" href="' . $data['link'] . '">' . $data['content'] . '</a>';
- }
-
- function artxHtmlFixFormAction($content)
- {
- if (preg_match('~ action="([^"]+)" ~', $content, $matches, PREG_OFFSET_CAPTURE)) {
- $content = substr($content, 0, $matches[0][1])
- . ' action="' . artxUrlToHref($matches[1][0]) . '" '
- . substr($content, $matches[0][1] + strlen($matches[0][0]));
- }
- return $content;
- }
-
- function artxTagBuilder($tag, $attributes = array(), $content = '') {
- $result = '<' . $tag;
- foreach ($attributes as $name => $value) {
- if (is_string($value)) {
- if (!empty($value))
- $result .= ' ' . $name . '="' . $value . '"';
- } else if (is_array($value)) {
- $values = array_filter($value);
- if (count($values))
- $result .= ' ' . $name . '="' . implode(' ', $value) . '"';
- }
- }
- $result .= '>' . $content . '</' . $tag . '>';
- return $result;
- }
-
- $artxFragments = array();
-
- function artxFragmentBegin($head = '')
- {
- global $artxFragments;
- $artxFragments[] = array('head' => $head, 'content' => '', 'tail' => '');
- }
-
- function artxFragmentContent($content = '')
- {
- global $artxFragments;
- $artxFragments[count($artxFragments) - 1]['content'] = $content;
- }
-
- function artxFragmentEnd($tail = '', $separator = '', $return = false)
- {
- global $artxFragments;
- $fragment = array_pop($artxFragments);
- $fragment['tail'] = $tail;
- $content = trim($fragment['content']);
- if (count($artxFragments) == 0) {
- if ($return)
- return (trim($content) == '') ? '' : ($fragment['head'] . $content . $fragment['tail']);
- echo (trim($content) == '') ? '' : ($fragment['head'] . $content . $fragment['tail']);
- } else {
- $result = (trim($content) == '') ? '' : ($fragment['head'] . $content . $fragment['tail']);
- $fragment =& $artxFragments[count($artxFragments) - 1];
- $fragment['content'] .= (trim($fragment['content']) == '' ? '' : $separator) . $result;
- }
- }
-
- function artxFragment($head = '', $content = '', $tail = '', $separator = '', $return = false)
- {
- global $artxFragments;
- if ($head != '' && $content == '' && $tail == '' && $separator == '') {
- $content = $head;
- $head = '';
- } elseif ($head != '' && $content != '' && $tail == '' && $separator == '') {
- $separator = $content;
- $content = $head;
- $head = '';
- }
- artxFragmentBegin($head);
- artxFragmentContent($content);
- artxFragmentEnd($tail, $separator, $return);
- }
-
- function artxPostprocessBlockContent($content)
- {
- return artxPostprocessContent($content);
- }
-
- function artxPostprocessPostContent($content)
- {
- return artxPostprocessContent($content);
- }
-
- function artxPostprocessContent($content)
- {
-// $config = JFactory::getConfig();
-// $sef = method_exists($config, 'getValue') ? $config->getValue('config.sef') : $sef = $config->get('config.sef');
-// if ($sef) $content = str_replace('url(\'images/', 'url(\'' . JURI::base(true) . '/images/', $content);
-// $content = artxReplaceButtons($content, array('input' => array('class' => array('button', '!art-button')),
-// 'button' => array('class' => array('button', '!art-button'))));
- return $content;
- }
-
- function artxBalanceTags($text) {
-
- $singleTags = array('area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'source');
- $nestedTags = array('blockquote', 'div', 'object', 'q', 'span');
-
- $stack = array();
- $size = 0;
- $queue = '';
- $output = '';
-
- while (preg_match("/<(\/?[\w:]*)\s*([^>]*)>/", $text, $match)) {
- $output .= $queue;
-
- $i = strpos($text, $match[0]);
- $l = strlen($match[0]);
-
- $queue = '';
-
- if (isset($match[1][0]) && '/' == $match[1][0]) {
- // processing of the end tag
- $tag = strtolower(substr($match[1],1));
-
- if($size <= 0) {
- $tag = '';
- } else if ($stack[$size - 1] == $tag) {
- $tag = '</' . $tag . '>';
- array_pop($stack);
- $size--;
- } else {
- for ($j = $size-1; $j >= 0; $j--) {
- if ($stack[$j] == $tag) {
- for ($k = $size-1; $k >= $j; $k--) {
- $queue .= '</' . array_pop($stack) . '>';
- $size--;
- }
- break;
- }
- }
- $tag = '';
- }
- } else {
- // processing of the begin tag
- $tag = strtolower($match[1]);
-
- if (substr($match[2], -1) == '/') {
- if (!in_array($tag, $singleTags))
- $match[2] = trim(substr($match[2], 0, -1)) . "></$tag";
- } elseif (in_array($tag, $singleTags)) {
- $match[2] .= '/';
- } else {
- if ($size > 0 && !in_array($tag, $nestedTags) && $stack[$size - 1] == $tag) {
- $queue = '</' . array_pop($stack) . '>';
- $size--;
- }
- $size = array_push($stack, $tag);
- }
-
- // attributes
- $attributes = $match[2];
- if(!empty($attributes) && $attributes[0] != '>')
- $attributes = ' ' . $attributes;
-
- $tag = '<' . $tag . $attributes . '>';
-
- if (!empty($queue)) {
- $queue .= $tag;
- $tag = '';
- }
- }
- $output .= substr($text, 0, $i) . $tag;
- $text = substr($text, $i + $l);
- }
-
- $output .= ($queue . $text);
-
- while($t = array_pop($stack))
- $output .= '</' . $t . '>';
-
- return $output;
- }
-}
+++ /dev/null
-<?php
-defined('_JEXEC') or die;
-
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'functions.php';
-
-JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
-
-Artx::load("Artx_Content");
-
-$component = new ArtxContent($this, $this->params);
-$article = $component->article('article', $this->item, $this->item->params, array('print' => $this->print));
-
-echo $component->beginPageContainer('item-page');
-if (strlen($article->pageHeading))
- echo $component->pageHeading($article->pageHeading);
-$params = $article->getArticleViewParameters();
-if (strlen($article->title)) {
- $params['header-text'] = $this->escape($article->title);
- if (strlen($article->titleLink))
- $params['header-link'] = $article->titleLink;
-}
-// Change the order of ""if"" statements to change the order of article metadata header items.
-if (strlen($article->created))
- $params['metadata-header-icons'][] = "<span class=\"art-postdateicon\">" . $article->createdDateInfo($article->created) . "</span>";
-if (strlen($article->modified))
- $params['metadata-header-icons'][] = "<span class=\"art-postdateicon\">" . $article->modifiedDateInfo($article->modified) . "</span>";
-if (strlen($article->published))
- $params['metadata-header-icons'][] = "<span class=\"art-postdateicon\">" . $article->publishedDateInfo($article->published) . "</span>";
-if (strlen($article->author))
- $params['metadata-header-icons'][] = "<span class=\"art-postauthoricon\">" . $article->authorInfo($article->author, $article->authorLink) . "</span>";
-if ($article->printIconVisible)
- $params['metadata-header-icons'][] = $article->printIcon();
-if ($article->emailIconVisible)
- $params['metadata-header-icons'][] = $article->emailIcon();
-if ($article->editIconVisible)
- $params['metadata-header-icons'][] = $article->editIcon();
-if (strlen($article->hits))
- $params['metadata-header-icons'][] = $article->hitsInfo($article->hits);
-// Build article content
-$content = '';
-if ('above full article' === $article->paginationPosition)
- $content .= $article->pagination();
-if (!$article->introVisible)
- $content .= $article->event('afterDisplayTitle');
-$content .= $article->event('beforeDisplayContent');
-if (strlen($article->toc))
- $content .= $article->toc($article->toc);
-if (strlen($article->text)) {
- if (strlen($article->images['fulltext']['image']))
- $content .= $article->image($article->images['fulltext']);
- if ('above text' === $article->paginationPosition)
- $content .= $article->pagination();
- $content .= $article->text($article->text);
- if ('below text' === $article->paginationPosition)
- $content .= $article->pagination();
- if ($article->showLinks)
- $content .= $this->loadTemplate('links');
-}
-if ($article->introVisible)
- $content .= $article->intro($article->intro);
-if (strlen($article->readmore))
- $content .= $article->readmore($article->readmore, $article->readmoreLink);
-if ('below full article' === $article->paginationPosition)
- $content .= $article->pagination();
-$content .= $article->event('afterDisplayContent');
-$params['content'] = $content;
-// Change the order of ""if"" statements to change the order of article metadata footer items.
-if (strlen($article->category))
- $params['metadata-footer-icons'][] = "<span class=\"art-postcategoryicon\">"
- . $article->categories($article->parentCategory, $article->parentCategoryLink, $article->category, $article->categoryLink)
- . "</span>";
-
-// Render article
-echo $article->article($params);
-echo $component->endPageContainer();
+++ /dev/null
-<html><body bgcolor="#FFFFFF"></body></html>
\ No newline at end of file
+++ /dev/null
-<html><body bgcolor="#FFFFFF"></body></html>
+++ /dev/null
-<html><body bgcolor="#FFFFFF"></body></html>
+++ /dev/null
-<?php
-defined('_JEXEC') or die;
-
-if (!defined('_ARTX_FUNCTIONS'))
- require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../functions.php');
-
-function modChrome_artstyle($module, &$params, &$attribs)
-{
- $style = isset($attribs['artstyle']) ? $attribs['artstyle'] : 'art-nostyle';
- $styles = array(
- 'art-nostyle' => 'modChrome_artnostyle',
- 'art-block' => 'modChrome_artblock',
- 'art-article' => 'modChrome_artarticle',
- 'art-vmenu' => 'modChrome_artvmenu'
- );
- // moduleclass_sfx support:
- // '' or 'suffix' - the default module style: custom suffix will not be added to the module tag
- // but will be added to the module elements.
- // ' suffix' - adds suffix to the module as well as to the module elements.
- // 'art-...' - overwrites the default module style.
- // 'suffix art-...' - overwrites the default style and adds suffix to the module and
- // to its elements, does not add art-... to the module elements.
-
- $classes = explode(' ', rtrim($params->get('moduleclass_sfx')));
- $keys = array_keys($styles);
- $art = array();
- foreach ($classes as $key => $class) {
- if (in_array($class, $keys)) {
- $art[] = $class;
- $classes[$key] = ' ';
- }
- }
- $classes = str_replace(' ', ' ', rtrim(implode(' ', $classes)));
- $style = count($art) ? array_pop($art) : $style;
- $params->set('moduleclass_sfx', $classes);
- call_user_func($styles[$style], $module, $params, $attribs);
-}
-
-function modChrome_artnostyle($module, &$params, &$attribs)
-{
-if (!empty ($module->content)) : ?>
-<!-- begin nostyle -->
-<div class="art-nostyle<?php echo $params->get('moduleclass_sfx'); ?>">
-<?php if ($module->showtitle != 0) : ?>
-<h3><?php echo $module->title; ?></h3>
-<?php endif; ?>
-<!-- begin nostyle content -->
-<?php echo $module->content; ?>
-<!-- end nostyle content -->
-</div>
-<!-- end nostyle -->
-<?php endif;
-}
-
-function modChrome_artblock($module, &$params, &$attribs)
-{
- if (!empty ($module->content))
- echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content,
- $params->get('moduleclass_sfx'));
-}
-
-function modChrome_artvmenu($module, &$params, &$attribs)
-{
- if (!empty ($module->content)) {
- if (function_exists('artxVMenuBlock'))
- echo artxVMenuBlock(($module->showtitle != 0) ? $module->title : '', $module->content,
- $params->get('moduleclass_sfx'));
- else
- echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content,
- $params->get('moduleclass_sfx'));
- }
-}
-
-function modChrome_artarticle($module, &$params, &$attribs)
-{
- if (!empty ($module->content)) {
- $data = array('classes' => $params->get('moduleclass_sfx'), 'content' => $module->content);
- if ($module->showtitle != 0)
- $data['header-text'] = $module->title;
- echo artxPost($data);
- }
-}
* See readme.txt for more details on how to use the template.
*/
-require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'functions.php';
+//require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'functions.php';
// Create alias for $this object reference:
$document = $this;
<script src="<?php echo $templateUrl; ?>/html5shiv.js"></script>
<script src="<?php echo $templateUrl; ?>/respond.min.js"></script>
<![endif]-->
- <!-- Created by Artisteer v4.1.0.59688 -->
</head>
<body>
<div class="container">
<div class="col-lg-3"><jdoc:include type="modules" name="right" style="none" /></div>
<?php endif; ?>
</div>
+<jdoc:include type="modules" name="bottom" style="none" />
</div>
</body>
</html>
\ No newline at end of file
+++ /dev/null
-<?php
-
-class Artx
-{
- private static $_paths = array();
-
- public static function addPath($prefix, $path)
- {
- self::$_paths[$prefix . '_'] = rtrim($path, DIRECTORY_SEPARATOR);
- }
-
- public static function load($class)
- {
- if (class_exists($class))
- return;
- $includePath = dirname(__FILE__);
- foreach (self::$_paths as $prefix => $path) {
- if (0 === strpos($class, $prefix)) {
- $includePath = $path;
- $class = substr($class, strlen($prefix));
- break;
- }
- }
- $file = str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
- require_once $includePath . DIRECTORY_SEPARATOR . $file;
- }
-}
\ No newline at end of file
+++ /dev/null
-<?php
-defined('_JEXEC') or die;
-
-/**
- * Contains the article factory method and content component rendering helpers.
- */
-Artx::load("Artx_Content_ArchivedArticle");
-Artx::load("Artx_Content_SingleArticle");
-Artx::load("Artx_Content_CategoryArticle");
-Artx::load("Artx_Content_FeaturedArticle");
-
-class ArtxContent
-{
- protected $_component;
- protected $_componentParams;
-
- public $pageClassSfx;
-
- public $pageHeading;
-
- public function __construct($component, $params)
- {
- $this->_component = $component;
- $this->_componentParams = $params;
-
- $this->pageClassSfx = $component->pageclass_sfx;
- $this->pageHeading = $this->_componentParams->get('show_page_heading', 1)
- ? $this->_componentParams->get('page_heading') : '';
- }
-
- public function pageHeading($title = null)
- {
- return artxPost(array('header-text' => $this->_component->escape(null == $title ? $this->pageHeading : $title)));
- }
-
- public function article($view, $article, $params, $properties = array())
- {
- switch ($view) {
- case 'archive':
- return new ArtxContentArchivedArticle($this->_component, $this->_componentParams,
- $article, $params);
- case 'article':
- return new ArtxContentSingleArticle($this->_component, $this->_componentParams,
- $article, $params, $properties);
- case 'category':
- return new ArtxContentCategoryArticle($this->_component, $this->_componentParams,
- $article, $params);
- case 'featured':
- return new ArtxContentFeaturedArticle($this->_component, $this->_componentParams,
- $article, $params);
- }
- }
-
- public function beginPageContainer($class)
- {
- return '<div class="' . $class . $this->pageClassSfx .'">';
- }
-
- public function endPageContainer()
- {
- return '</div>';
- }
-}
+++ /dev/null
-<?php
-defined('_JEXEC') or die;
-
-Artx::load("Artx_Content_ArticleBase");
-
-class ArtxContentArchivedArticle extends ArtxContentArticleBase
-{
- public $intro;
-
- public function __construct($component, $componentParams, $article, $articleParams)
- {
- parent::__construct($component, $componentParams, $article, $articleParams);
- $this->titleLink = $this->_articleParams->get('link_titles')
- ? JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catslug))
- : '';
- $this->category = $this->_articleParams->get('show_category') ? $this->_article->category_title : '';
- $this->categoryLink = $this->_articleParams->get('link_category') && $this->_article->catslug
- ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug))
- : '';
- $this->parentCategoryLink = $this->_articleParams->get('link_parent_category') && $this->_article->parent_slug
- ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->parent_slug))
- : '';
- $this->intro = $this->_articleParams->get('show_intro') ? $this->_article->introtext : '';
- }
-
- public function intro($intro)
- {
- return '<div class="art-article">'
- . JHtml::_('string.truncate', $intro,
- $this->_articleParams->get('introtext_limit'))
- . '</div>';
- }
-}
+++ /dev/null
-<?php
-defined('_JEXEC') or die;
-
-abstract class ArtxContentArticleBase
-{
- protected $_component;
- protected $_componentParams;
- protected $_article;
- protected $_articleParams;
-
- public $title;
-
- public $titleLink;
-
- public $created;
-
- public $modified;
-
- public $published;
-
- public $hits;
-
- public $author;
-
- public $authorLink;
-
- public $category;
-
- public $categoryLink;
-
- public $parentCategory;
-
- public $parentCategoryLink;
-
- protected function __construct($component, $componentParams, $article, $articleParams)
- {
- // Initialization:
- $this->_component = $component;
- $this->_componentParams = $componentParams;
- $this->_article = $article;
- $this->_articleParams = $articleParams;
-
- // Configuring properties:
- $this->title = $this->_article->title;
- $this->created = $this->_articleParams->get('show_create_date')
- ? $this->_article->created : '';
- $this->modified = $this->_articleParams->get('show_modify_date')
- ? $this->_article->modified : '';
- $this->published = $this->_articleParams->get('show_publish_date')
- ? $this->_article->publish_up : '';
- $this->hits = $this->_articleParams->get('show_hits')
- ? $this->_article->hits : '';
- $this->author = $this->_articleParams->get('show_author') && !empty($this->_article->author)
- ? ($this->_article->created_by_alias ? $this->_article->created_by_alias : $this->_article->author)
- : '';
- $this->authorLink = strlen($this->author) && !empty($this->_article->contactid) && $this->_articleParams->get('link_author')
- ? 'index.php?option=com_contact&view=contact&id=' . $this->_article->contactid
- : '';
- }
-
- /**
- * @see $created
- */
- public function createdDateInfo($created)
- {
- return JText::sprintf('COM_CONTENT_CREATED_DATE_ON',
- JHtml::_('date', $created, JText::_('DATE_FORMAT_LC2')));
- }
-
- /**
- * @see $modified
- */
- public function modifiedDateInfo($modified)
- {
- return JText::sprintf('COM_CONTENT_LAST_UPDATED',
- JHtml::_('date', $modified, JText::_('DATE_FORMAT_LC2')));
- }
-
- /**
- * @see $published
- */
- public function publishedDateInfo($published)
- {
- return JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON',
- JHtml::_('date', $published, JText::_('DATE_FORMAT_LC2')));
- }
-
- /**
- * @see $author
- */
- public function authorInfo($author, $authorLink)
- {
- if (strlen($authorLink))
- return JText::sprintf('COM_CONTENT_WRITTEN_BY',
- JHtml::_('link', JRoute::_($authorLink), $author));
- return JText::sprintf('COM_CONTENT_WRITTEN_BY', $author);
- }
-
- public function articleSeparator() { return '<div class="item-separator"> </div>'; }
-
- /**
- * @see $section, $sectionLink, $category, $categoryLink
- */
- public function categories($parentCategory, $parentCategoryLink, $category, $categoryLink)
- {
- if (0 == strlen($parentCategory) && 0 == strlen($category))
- return '';
- ob_start();
- if (strlen($parentCategory)) {
- echo '<span class="art-post-metadata-category-parent">';
- if (strlen($parentCategoryLink))
- echo '<a href="' . $parentCategoryLink . '">' . $this->_component->escape($parentCategory) . '</a>';
- else
- echo $this->_component->escape($parentCategory);
- echo '</span>';
- if (strlen($category))
- echo ' / ';
- }
- if (strlen($category)) {
- echo '<span class="art-post-metadata-category-name">';
- if (strlen($categoryLink))
- echo '<a href="' . $categoryLink . '">' . $this->_component->escape($category) . '</a>';
- else
- echo $this->_component->escape($category);
- echo '</span>';
- }
- return JText::sprintf('COM_CONTENT_CATEGORY', ob_get_clean());
- }
-
- public function hitsInfo($hits)
- {
- return JText::sprintf('COM_CONTENT_ARTICLE_HITS', $hits);
- }
-
- public function event($name)
- {
- return $this->_article->event->{$name};
- }
-
- public function getArticleViewParameters()
- {
- return array('metadata-header-icons' => array(), 'metadata-footer-icons' => array());
- }
-
- public function article($article)
- {
- return artxPost($article);
- }
-}
+++ /dev/null
-<?php
-defined('_JEXEC') or die;
-
-Artx::load("Artx_Content_ListItem");
-
-class ArtxContentCategoryArticle extends ArtxContentListItem
-{
- function __construct($component, $componentParams, $article, $articleParams)
- {
- parent::__construct($component, $componentParams, $article, $articleParams);
- $this->category = $this->_articleParams->get('show_category') ? $this->_article->category_title : '';
- $this->categoryLink = $this->_articleParams->get('link_category')
- ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catid))
- : '';
- $this->parentCategory = $this->_articleParams->get('show_parent_category') && $this->_article->parent_id != 1
- ? $this->_article->parent_title : '';
- $this->parentCategoryLink = $this->_articleParams->get('link_parent_category')
- ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->parent_id))
- : '';
- }
-}
+++ /dev/null
-<?php
-defined('_JEXEC') or die;
-
-Artx::load("Artx_Content_ListItem");
-
-class ArtxContentFeaturedArticle extends ArtxContentListItem
-{
- public function __construct($component, $componentParams, $article, $articleParams)
- {
- parent::__construct($component, $componentParams, $article, $articleParams);
- $this->category = $this->_articleParams->get('show_category') ? $this->_article->category_title : '';
- $this->categoryLink = $this->_articleParams->get('link_category') && $this->_article->catslug
- ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug))
- : '';
- $this->parentCategory = $this->_articleParams->get('show_parent_category') && $this->_article->parent_id != 1
- ? $this->_article->parent_title : '';
- $this->parentCategoryLink = $this->_articleParams->get('link_parent_category') && $this->_article->parent_slug
- ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->parent_slug))
- : '';
- }
-}
+++ /dev/null
-<?php
-defined('_JEXEC') or die;
-
-Artx::load("Artx_Content_ArticleBase");
-
-abstract class ArtxContentItem extends ArtxContentArticleBase
-{
- public $isPublished;
-
- public $printIconVisible;
-
- public $emailIconVisible;
-
- public $editIconVisible;
-
- public $introVisible;
-
- public $readmore;
-
- public $readmoreLink;
-
- protected function __construct($component, $componentParams, $article, $articleParams)
- {
- parent::__construct($component, $componentParams, $article, $articleParams);
- $this->title = $this->_articleParams->get('show_title') ? $this->_article->title : '';
- $this->printIconVisible = $this->_articleParams->get('show_print_icon');
- $this->emailIconVisible = $this->_articleParams->get('show_email_icon');
- $this->editIconVisible = $this->_articleParams->get('access-edit');
- $this->introVisible = $this->_articleParams->get('show_intro');
- $this->images = $this->_buildImages($article, $articleParams);
- }
-
- private function _buildImages($article, $params) {
- $images = (isset($this->_article->images) && is_string($this->_article->images)) ? json_decode($this->_article->images) : null;
- return array(
- 'intro' => $this->_buildImageInfo('intro', $params, $images),
- 'fulltext' => $this->_buildImageInfo('fulltext', $params, $images));
- }
-
- private function _buildImageInfo($type, $params, $images) {
- $image = array('image' => '', 'float' => '', 'class' => '', 'caption' => '', 'alt' => '');
- if (is_null($images))
- return $image;
- $properties = array(
- 'image' => 'image_' . $type,
- 'float' => 'float_' . $type,
- 'caption' => 'image_' . $type . '_caption',
- 'alt' => 'image_' . $type . '_alt'
- );
- if (isset($images->{$properties['image']}) && !empty($images->{$properties['image']})) {
- $image['image'] = $images->{$properties['image']};
- $image['float'] = empty($images->{$properties['float']})
- ? $params->get($properties['float'])
- : $images->{$properties['float']};
- $image['class'] = 'img-' . $type . '-' . htmlspecialchars($image['float']);
- if ($images->{$properties['caption']})
- $image['caption'] = htmlspecialchars($images->{$properties['caption']});
- $image['alt'] = $images->{$properties['alt']};
- }
- return $image;
- }
-
- /**
- * @see $emailIconVisible
- */
- public function emailIcon()
- {
- return JHtml::_('icon.email', $this->_article, $this->_articleParams);
- }
-
- /**
- * @see $editIconVisible
- */
- public function editIcon()
- {
- return JHtml::_('icon.edit', $this->_article, $this->_articleParams);
- }
-
- /**
- * @see $printIconVisible
- */
- public function printIcon()
- {
- return JHtml::_('icon.print_popup', $this->_article, $this->_articleParams);
- }
-
- /**
- * Returns decoration for unpublished articles.
- *
- * Together with endUnpublishedArticle() this function decorates
- * the unpublished article with <div class="system-unpublished">...</div>.
- * By default, this decoration is applied only to articles in lists.
- */
- public function beginUnpublishedArticle() { return '<div class="system-unpublished">'; }
-
- public function endUnpublishedArticle() { return '</div>'; }
-
- public function readmore($readmore, $readmoreLink)
- {
- return '<p class="readmore">' . artxLinkButton(array(
- 'classes' => array('a' => 'readon'),
- 'link' => $readmoreLink,
- 'content' => str_replace(' ', ' ', $readmore))) . '</p>';
- }
-
- public function image($image) {
- $imgTagAttrs = array('src' => $image['image'], 'alt' => $image['alt']);
- if ($image['caption']) {
- $imgTagAttrs['class'] = 'caption';
- $imgTagAttrs['title'] = $image['caption'];
- }
- return artxTagBuilder('div', array('class' => $image['class']),
- artxTagBuilder('img', array('src' => $image['image'], 'alt' => $image['alt'])
- + ($image['caption'] ? array('class' => 'caption', 'title' => $image['caption']) : array())));
- }
-}
+++ /dev/null
-<?php
-defined('_JEXEC') or die;
-
-Artx::load("Artx_Content_Item");
-
-abstract class ArtxContentListItem extends ArtxContentItem
-{
- public $intro;
-
- protected function __construct($component, $componentParams, $article, $articleParams)
- {
- parent::__construct($component, $componentParams, $article, $articleParams);
- $this->isPublished = 0 != $this->_article->state;
- $this->titleLink = $this->_articleParams->get('link_titles') && $this->_articleParams->get('access-view')
- ? JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid))
- : '';
- $this->intro = $this->_article->introtext;
- if ($this->_articleParams->get('show_readmore') && $this->_article->readmore) {
- if (!$this->_articleParams->get('access-view'))
- $this->readmore = JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
- elseif ($this->readmore = $this->_article->alternative_readmore) {
- if ($this->_articleParams->get('show_readmore_title', 0) != 0)
- $this->readmore .= JHtml::_('string.truncate', ($this->_article->title), $this->_articleParams->get('readmore_limit'));
- } elseif ($this->_articleParams->get('show_readmore_title', 0) == 0)
- $this->readmore = JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
- else
- $this->readmore = JText::_('COM_CONTENT_READ_MORE')
- . JHtml::_('string.truncate', $this->_article->title,
- $this->_articleParams->get('readmore_limit'));
- if ($this->_articleParams->get('access-view')){
- $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
- $this->readmoreLink = $link;
- } else {
- $menu = JFactory::getApplication()->getMenu();
- $active = $menu->getActive();
- $itemId = $active->id;
- $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
- $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
- $link = new JURI($link1);
- $link->setVar('return', base64_encode($returnURL));
- $this->readmoreLink = $link->__toString();
- }
- } else {
- $this->readmore = '';
- $this->readmoreLink = '';
- }
- }
-
- public function intro($intro)
- {
- return "<div class=\"art-article\">" . $intro . "</div>";
- }
-}
+++ /dev/null
-<?php
-defined('_JEXEC') or die;
-
-Artx::load("Artx_Content_Item");
-
-class ArtxContentSingleArticle extends ArtxContentItem
-{
- public $print;
-
- public $toc;
-
- public $intro;
-
- public $text;
-
- public function __construct($component, $componentParams, $article, $articleParams, $properties)
- {
- parent::__construct($component, $componentParams, $article, $articleParams);
- $this->print = isset($properties['print']) ? $properties['print'] : '';
- $this->pageHeading = $this->_componentParams->get('show_page_heading', 1)
- ? $this->_componentParams->get('page_heading') : '';
- $this->titleLink = $this->_articleParams->get('link_titles') && !empty($this->_article->readmore_link)
- ? $this->_article->readmore_link : '';
- $this->emailIconVisible = $this->emailIconVisible && !$this->print;
- $this->editIconVisible = $this->editIconVisible && !$this->print;
- $this->categoryLink = $this->_articleParams->get('link_category') && $this->_article->catslug
- ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug))
- : '';
- $this->category = $this->_articleParams->get('show_category') ? $this->_article->category_title : '';
- $this->categoryLink = $this->_articleParams->get('link_category') && $this->_article->catslug
- ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug))
- : '';
- $this->parentCategory = $this->_articleParams->get('show_parent_category') && $this->_article->parent_slug != '1:root'
- ? $this->_article->parent_title : '';
- $this->parentCategoryLink = $this->_articleParams->get('link_parent_category') && $this->_article->parent_slug
- ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->parent_slug))
- : '';
- $this->author = $this->_articleParams->get('show_author') && !empty($this->_article->author)
- ? ($this->_article->created_by_alias ? $this->_article->created_by_alias : $this->_article->author)
- : '';
- if (strlen($this->author) && $this->_articleParams->get('link_author')) {
- $needle = 'index.php?option=com_contact&view=contact&id=' . $this->_article->contactid;
- $menu = JFactory::getApplication()->getMenu();
- $item = $menu->getItems('link', $needle, true);
- $this->authorLink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
- } else
- $this->authorLink = '';
- $this->toc = isset($this->_article->toc) ? $this->_article->toc : '';
- $this->text = $this->_articleParams->get('access-view') ? $this->_article->text : '';
- $user = JFactory::getUser();
- $this->introVisible = !$this->_articleParams->get('access-view') && $params->get('show_noauth') && $user->get('guest');
- $this->intro = $this->_article->introtext;
- if (!$this->_articleParams->get('access-view') && $this->_articleParams->get('show_noauth') && $user->get('guest')
- && $this->_articleParams->get('show_readmore') && $this->_article->fulltext != null)
- {
- $attribs = json_decode($this->_article->attribs);
- if ($attribs->alternative_readmore == null)
- $this->readmore = JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
- elseif ($this->readmore = $this->_article->alternative_readmore) {
- if ($this->_articleParams->get('show_readmore_title', 0) != 0)
- $this->readmore .= JHtml::_('string.truncate', ($this->_article->title), $this->_articleParams->get('readmore_limit'));
- } elseif ($this->_articleParams->get('show_readmore_title', 0) == 0)
- $this->readmore = JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
- else
- $this->readmore = JText::_('COM_CONTENT_READ_MORE')
- . JHtml::_('string.truncate', $this->_article->title,
- $this->_articleParams->get('readmore_limit'));
- $link = new JURI(JRoute::_('index.php?option=com_users&view=login'));
- $this->readmoreLink = $link->__toString();
- } else {
- $this->readmore = '';
- $this->readmoreLink = '';
- }
- $this->paginationPosition = (isset($this->_article->pagination) && $this->_article->pagination && isset($this->_article->paginationposition))
- ? (($this->_article->paginationposition ? 'below' : 'above') . ' ' . ($this->_article->paginationrelative ? 'full article' : 'text'))
- : '';
- $this->showLinks = isset($this->_article->urls) && is_string($this->_article->urls) && !empty($this->_article->urls);
- }
-
- public function printIcon()
- {
- return JHTML::_($this->print ? 'icon.print_screen' : 'icon.print_popup', $this->_article, $this->_articleParams);
- }
-
- public function toc($toc)
- {
- return '<div class="art-article">' . $toc . '</div>';
- }
-
- public function intro($intro)
- {
- return '<div class="art-article">' . $intro . '</div>';
- }
-
- public function text($text)
- {
- return '<div class="art-article">' . $text . '</div>';
- }
-
- public function pagination() {
- return $this->_article->pagination;
- }
-}
+++ /dev/null
-<?php
-
-class Artx_Log
-{
- function info($msg)
- {
- $bt = debug_backtrace();
- $caller = $bt[1];
- $prefix = '';
- if (isset($caller['class']))
- $prefix .= $caller['class'] . '::';
- $prefix .= $caller['function'] . '(...) - ';
- $writer = & Artx_Log::_getWriter();
- $writer->write($prefix . $msg);
- }
-
- function trace()
- {
- $formatter = & Artx_Log::_getFormatter();
- $bt = debug_backtrace();
- $caller = $bt[1];
- $msg = '';
- if (isset($caller['class']))
- $msg .= $caller['class'] . '::';
- $msg .= $caller['function'] . '(' . $formatter->args($caller['args']) . ')';
- $writer = & Artx_Log::_getWriter();
- $writer->write($msg);
- }
-
- function & _getWriter()
- {
- if (!isset($GLOBALS['artx_log_default_writer'])) {
- Artx::load('Artx_Log_ErrorLogWriter');
- $GLOBALS['artx_log_default_writer'] = new Artx_Log_ErrorLogWriter();
- }
- return $GLOBALS['artx_log_default_writer'];
- }
-
- function & _getFormatter()
- {
- if (!isset($GLOBALS['artx_log_default_formatter'])) {
- Artx::load('Artx_Log_Formatter');
- $GLOBALS['artx_log_default_formatter'] = new Artx_Log_Formatter();
- }
- return $GLOBALS['artx_log_default_formatter'];
- }
-}
+++ /dev/null
-<?php
-
-class Artx_Log_ErrorLogWriter
-{
- function write($msg)
- {
- error_log($msg);
- }
-}
\ No newline at end of file
+++ /dev/null
-<?php
-
-class Artx_Log_Formatter
-{
- function args($args)
- {
- $result = array();
- foreach ($args as $index => $value)
- $result[] = Artx_Log_Formatter::_formatVar($value);
- return implode(', ', $result);
- }
-
- function _formatVar(&$value)
- {
- if (is_null($value))
- return Artx_Log_Formatter::_formatNull($value);
- if (is_bool($value))
- return Artx_Log_Formatter::_formatBool($value);
- if (is_int($value) || is_float($value))
- return $value;
- if (is_object($value))
- return Artx_Log_Formatter::_formatObject($value);
- // is_callable should be placed before is_string and is_array:
- if (is_callable($value))
- return Artx_Log_Formatter::_formatCallback($value);
- if (is_string($value))
- return Artx_Log_Formatter::_formatString($value);
- if (is_array($value))
- return Artx_Log_Formatter::_formatArray($value);
- return gettype($value) . ' { ... }';
- }
-
- function _formatNull()
- {
- return 'NULL';
- }
-
- function _formatString(&$value)
- {
- $text = $value;
- if (strlen($text) > 10)
- $text = substr($text, 0, 10) . '...';
- $text = str_replace('\\', '\\\\', $text);
- $text = str_replace('\'', '\\\'', $text);
- return '\'' . $text . '\'';
- }
-
- function _formatArray(&$value)
- {
- return 'array(' . count($value) . ') { ... }';
- }
-
- function _formatObject(&$value)
- {
- return get_class($value) . '(...) { ... }';
- }
-
- function _formatBool(&$value)
- {
- return $value ? 'true' : 'false';
- }
-
- function _formatCallback(&$value)
- {
- if (is_string($value))
- return $value . '(...)';
- if (is_array($value))
- return (is_string($value[0]) ? ($value[0] . '::') : (get_class($value[0]) . '->')) . $value[1];
- return '#internal error';
- }
-}
+++ /dev/null
-<?php
-defined('_JEXEC') or die;
-
-/**
- * Contains page rendering helpers.
- */
-class ArtxPage
-{
-
- public $page;
- public static $inlineScripts = array();
-
- public function __construct($page)
- {
- $this->page = $page;
- }
-
- /**
- * Checks whether Joomla! has system messages to display.
- */
- public function hasMessages()
- {
- $app = JFactory::getApplication();
- $messages = $app->getMessageQueue();
- if (is_array($messages) && count($messages))
- foreach ($messages as $msg)
- if (isset($msg['type']) && isset($msg['message']))
- return true;
- return false;
- }
-
- /**
- * Returns true when any of the positions contains at least one module.
- * Example:
- * if ($obj->containsModules('top1', 'top2', 'top3')) {
- * // the following code will be executed when one of the positions contains modules:
- * ...
- * }
- */
- public function containsModules()
- {
- foreach (func_get_args() as $position)
- if (0 != $this->page->countModules($position))
- return true;
- return false;
- }
-
- /**
- * Builds the list of positions, collapsing the empty ones.
- *
- * Samples:
- * Four positions:
- * No empty positions: 25%:25%:25%:25%
- * With one empty position: -:50%:25%:25%, 50%:-:25%:25%, 25%:50%:-:25%, 25%:25%:50%:-
- * With two empty positions: -:-:75%:25%, -:50%:-:50%, -:50%:50%:-, -:50%:50%:-, 75%:-:-:25%, 50%:-:50%:-, 25%:75%:-:-
- * One non-empty position: 100%
- * Three positions:
- * No empty positions: 33%:33%:34%
- * With one empty position: -:66%:34%, 50%:-:50%, 33%:67%:-
- * One non-empty position: 100%
- */
- public function positions($positions, $style)
- {
- // Build $cells by collapsing empty positions:
- $cells = array();
- $buffer = 0;
- $cell = null;
- foreach ($positions as $name => $width) {
- if ($this->containsModules($name)) {
- $cells[$name] = $buffer + $width;
- $buffer = 0;
- $cell = $name;
- } else if (null == $cell)
- $buffer += $width;
- else
- $cells[$cell] += $width;
- }
-
- // Backward compatibility: for three equal width columns with empty center position the result should be 50%/50%:
- if (3 == count($positions) && 2 == count($cells)) {
- $columns1 = array_keys($positions);
- $columns2 = array_keys($cells);
- if (33 == $positions[$columns1[0]] && 33 == $positions[$columns1[1]] && 34 == $positions[$columns1[2]]
- && $columns2[0] == $columns1[0] && $columns2[1] == $columns1[2])
- {
- $cells[$columns2[0]] = 50;
- $cells[$columns2[1]] = 50;
- }
- }
-
- // Render $cells:
- if (count($cells) == 0)
- return '';
- $result = '<div class="art-content-layout">';
- $result .= '<div class="art-content-layout-row">';
- foreach ($cells as $name => $width)
- $result .='<div class="art-layout-cell' . ('art-block' == $style ? ' art-layout-sidebar-bg' : '')
- . '" style="width: ' . $width. '%;">' . $this->position($name, $style) . '</div>';
- $result .= '</div>';
- $result .= '</div>';
- return $result;
- }
-
- public function position($position, $style = null)
- {
- return '<jdoc:include type="modules" name="' . $position . '"' . (null != $style ? ' style="artstyle" artstyle="' . $style . '"' : '') . ' />';
- }
-
- private function parseInlineScripts($matches) {
- ArtxPage::$inlineScripts[] = $matches[0];
- return "";
- }
-
- public function includeInlineScripts() {
- foreach(ArtxPage::$inlineScripts as $script)
- echo $script;
- }
-
- /**
- * Wraps component content into article style unless it is not already wrapped.
- *
- * The componentWrapper method gets the content of the 'component' buffer and searches for the '<div class="art-post">' string in it.
- * Then it wraps the content of the buffer with the art-post.
- */
- public function componentWrapper()
- {
- if ($this->page->getType() != 'html')
- return;
- $option = JRequest::getCmd('option');
- $view = JRequest::getCmd('view');
- $layout = JRequest::getCmd('layout');
- $content = $this->page->getBuffer('component');
- // Workarounds for Joomla bugs and inconsistencies:
- switch ($option) {
- case "com_content":
- switch ($view) {
- case "form":
- if ("edit" == $layout)
- $content = str_replace('<button type="button" onclick="', '<button type="button" class="button" onclick="', $content);
- break;
- case "article":
- $content = preg_replace_callback('/<script[^>]*>([\s\S]+?)<\/script>/', array( &$this, 'parseInlineScripts'), $content);
- break;
- }
- break;
- case "com_users":
- switch ($view) {
- case "remind":
- if ("" == $layout) {
- $content = str_replace('<button type="submit">', '<button type="submit" class="button">', $content);
- $content = str_replace('<button type="submit" class="validate">', '<button type="submit" class="button">', $content);
- }
- break;
- case "reset":
- if ("" == $layout) {
- $content = str_replace('<button type="submit">', '<button type="submit" class="button">', $content);
- $content = str_replace('<button type="submit" class="validate">', '<button type="submit" class="button">', $content);
- }
- break;
- case "registration":
- if ("" == $layout)
- $content = str_replace('<button type="submit" class="validate">', '<button type="submit" class="button validate">', $content);
- break;
- }
- break;
- }
- // Code injections:
- switch ($option) {
- case "com_content":
- switch ($view) {
- case "form":
- if ("edit" == $layout)
- $this->page->addScriptDeclaration($this->getWysiwygBackgroundImprovement());
- break;
- }
- break;
- }
-
- if ('com_content' == $option && ('featured' == $view || 'article' == $view || ('category' == $view && 'blog' == $layout))){
- $this->page->setBuffer($content, 'component');
- }
-
- if (false === strpos($content, '<div class="art-post'))
- $this->page->setBuffer(artxPost(array('header-text' => null, 'content' => $content)), 'component');
- }
-
- public function getWysiwygBackgroundImprovement()
- {
- ob_start();
-?>
-window.addEvent('domready', function() {
- var waitFor = function (interval, criteria, callback) {
- var interval = setInterval(function () {
- if (!criteria())
- return;
- clearInterval(interval);
- callback();
- }, interval);
- };
- var editor = ('undefined' != typeof tinyMCE)
- ? tinyMCE
- : (('undefined' != typeof JContentEditor)
- ? JContentEditor : null);
- if (null != editor) {
- // fix for TinyMCE editor
- waitFor(75,
- function () {
- if (editor.editors)
- for (var key in editor.editors)
- if (editor.editors.hasOwnProperty(key))
- return editor.editors[key].initialized;
- return false;
- },
- function () {
- var ifr = jQuery('#jform_articletext_ifr');
- var ifrdoc = ifr[0] && ifr[0].contentDocument;
- ifrdoc && jQuery('link[href*="/css/editor.css"]', ifrdoc).ready(function () {
- jQuery('link[href$="content.css"]', ifrdoc).remove();
- ifr.css('background', 'transparent').attr('allowtransparency', 'true');
- var ifrBodyNode = jQuery('body', ifrdoc);
- var layout = jQuery('table.mceLayout');
- var toolbar = layout.find('.mceToolbar');
- var toolbarBg = toolbar.css('background-color');
- var statusbar = layout.find('.mceStatusbar');
- var statusbarBg = statusbar.css('background-color');
- layout.css('background', 'transparent');
- toolbar.css('background', toolbarBg);
- toolbar.css('direction', 'ltr');
- statusbar.css('background', statusbarBg);
- ifrBodyNode.css('background', 'transparent');
- ifrBodyNode.attr('dir', 'ltr');
- });
- });
- } else if ('undefined' != typeof CKEDITOR) {
- CKEDITOR.on('instanceReady', function (evt) {
- var includesTemplateStyle = 0 != jQuery('link[href*="/css/template.css"]', evt.editor.document.$).length;
- var includesEditorStyle = 0 != jQuery('link[href*="/css/editor.css"]', evt.editor.document.$).length;
- if (includesTemplateStyle || includesEditorStyle) {
- jQuery('#cke_ui_color').remove();
- var ifr = jQuery('.cke_editor iframe');
- ifr.parent().css('background', 'transparent')
- .parent().parent().parent().parent()
- .css('background', 'transparent');
- console.log(jQuery('.cke_wrapper'));
- ifr.attr('allowtransparency', 'true');
- ifr.css('background', 'transparent');
- var ifrdoc = ifr.get(0).contentDocument;
- jQuery('body', ifrdoc).css({'background' : 'transparent', 'overflow' : 'scroll'});
- if (includesTemplateStyle)
- jQuery('body', ifrdoc).attr('id', 'art-main').addClass('art-postcontent');
- }
- });
- }
-});
-<?php
- return ob_get_clean();
- }
-}