From 4f3e874a32c6e396f04a320903aa34f65565e326 Mon Sep 17 00:00:00 2001 From: naoki hirata Date: Sun, 12 Jan 2014 19:37:20 +0900 Subject: [PATCH] =?utf8?q?=E3=80=8C=5Fadmin4=E3=80=8D=E3=83=86=E3=83=B3?= =?utf8?q?=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88=E3=81=AE=E4=B8=8D=E8=A6=81?= =?utf8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E5=89=8A=E9=99=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- templates/_admin4/css/iestyles.css | 4 - templates/_admin4/css/style.css | 81 --- templates/_admin4/functions.php | 541 --------------------- .../_admin4/html/com_content/article/default.php | 75 --- .../_admin4/html/com_content/article/index.html | 1 - templates/_admin4/html/com_content/index.html | 1 - templates/_admin4/html/index.html | 1 - templates/_admin4/html/modules.php | 82 ---- templates/_admin4/index.php | 4 +- templates/_admin4/library/Artx.php | 27 - templates/_admin4/library/Artx/Content.php | 63 --- .../library/Artx/Content/ArchivedArticle.php | 33 -- .../_admin4/library/Artx/Content/ArticleBase.php | 149 ------ .../library/Artx/Content/CategoryArticle.php | 21 - .../library/Artx/Content/FeaturedArticle.php | 21 - templates/_admin4/library/Artx/Content/Item.php | 116 ----- .../_admin4/library/Artx/Content/ListItem.php | 53 -- .../_admin4/library/Artx/Content/SingleArticle.php | 103 ---- templates/_admin4/library/Artx/Log.php | 47 -- .../_admin4/library/Artx/Log/ErrorLogWriter.php | 9 - templates/_admin4/library/Artx/Log/Formatter.php | 71 --- templates/_admin4/library/Artx/Page.php | 258 ---------- 22 files changed, 2 insertions(+), 1759 deletions(-) delete mode 100644 templates/_admin4/functions.php delete mode 100644 templates/_admin4/html/com_content/article/default.php delete mode 100644 templates/_admin4/html/com_content/article/index.html delete mode 100644 templates/_admin4/html/com_content/index.html delete mode 100644 templates/_admin4/html/index.html delete mode 100644 templates/_admin4/html/modules.php delete mode 100644 templates/_admin4/library/Artx.php delete mode 100644 templates/_admin4/library/Artx/Content.php delete mode 100644 templates/_admin4/library/Artx/Content/ArchivedArticle.php delete mode 100644 templates/_admin4/library/Artx/Content/ArticleBase.php delete mode 100644 templates/_admin4/library/Artx/Content/CategoryArticle.php delete mode 100644 templates/_admin4/library/Artx/Content/FeaturedArticle.php delete mode 100644 templates/_admin4/library/Artx/Content/Item.php delete mode 100644 templates/_admin4/library/Artx/Content/ListItem.php delete mode 100644 templates/_admin4/library/Artx/Content/SingleArticle.php delete mode 100644 templates/_admin4/library/Artx/Log.php delete mode 100644 templates/_admin4/library/Artx/Log/ErrorLogWriter.php delete mode 100644 templates/_admin4/library/Artx/Log/Formatter.php delete mode 100644 templates/_admin4/library/Artx/Page.php diff --git a/templates/_admin4/css/iestyles.css b/templates/_admin4/css/iestyles.css index fc3a2561..cb9b3f0f 100644 --- a/templates/_admin4/css/iestyles.css +++ b/templates/_admin4/css/iestyles.css @@ -8,10 +8,6 @@ fieldset { 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 { diff --git a/templates/_admin4/css/style.css b/templates/_admin4/css/style.css index 9422d9d2..7207d8f1 100644 --- a/templates/_admin4/css/style.css +++ b/templates/_admin4/css/style.css @@ -96,87 +96,6 @@ a:hover { 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 { diff --git a/templates/_admin4/functions.php b/templates/_admin4/functions.php deleted file mode 100644 index f00afe07..00000000 --- a/templates/_admin4/functions.php +++ /dev/null @@ -1,541 +0,0 @@ - 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("
"); - artxFragmentBegin("

"); - if (isset($data['header-text']) && strlen($data['header-text'])) { - if (isset($data['header-link']) && strlen($data['header-link'])) - artxFragmentContent('' . $data['header-text'] . ''); - else - artxFragmentContent($data['header-text']); - } - artxFragmentEnd("

"); - artxFragmentBegin("
"); - if (isset($data['metadata-header-icons']) && count($data['metadata-header-icons'])) - foreach ($data['metadata-header-icons'] as $icon) - artxFragment('', $icon, '', ' | '); - artxFragmentEnd("
"); - artxFragmentBegin("
"); - if (isset($data['content']) && strlen($data['content'])) - artxFragmentContent(artxPostprocessPostContent($data['content'])); - artxFragmentEnd("
"); - artxFragmentBegin(""); - - return artxFragmentEnd("
", '', 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("
"); - artxFragmentBegin("

"); - artxFragmentContent($caption); - artxFragmentEnd("

"); - artxFragmentBegin("
"); - artxFragmentContent(artxPostprocessBlockContent($content)); - artxFragmentEnd("
");*/ - - artxFragmentBegin('
'); - artxFragmentBegin('
'); - artxFragmentContent($caption); - artxFragmentEnd('
'); - artxFragmentBegin('
'); - artxFragmentContent(artxPostprocessBlockContent($content)); - artxFragmentEnd('
'); - return artxFragmentEnd("
", '', 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 - * 123 will return 12 and - * 2. - * - * 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 = ''; - $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 .= ''; - } 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 '' . $data['content'] . ''; - } - - 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 . ''; - 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 = ''; - array_pop($stack); - $size--; - } else { - for ($j = $size-1; $j >= 0; $j--) { - if ($stack[$j] == $tag) { - for ($k = $size-1; $k >= $j; $k--) { - $queue .= ''; - $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)) . "> 0 && !in_array($tag, $nestedTags) && $stack[$size - 1] == $tag) { - $queue = ''; - $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 .= ''; - - return $output; - } -} diff --git a/templates/_admin4/html/com_content/article/default.php b/templates/_admin4/html/com_content/article/default.php deleted file mode 100644 index 129b53a4..00000000 --- a/templates/_admin4/html/com_content/article/default.php +++ /dev/null @@ -1,75 +0,0 @@ -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'][] = ""; -if (strlen($article->modified)) - $params['metadata-header-icons'][] = ""; -if (strlen($article->published)) - $params['metadata-header-icons'][] = ""; -if (strlen($article->author)) - $params['metadata-header-icons'][] = ""; -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'][] = ""; - -// Render article -echo $article->article($params); -echo $component->endPageContainer(); diff --git a/templates/_admin4/html/com_content/article/index.html b/templates/_admin4/html/com_content/article/index.html deleted file mode 100644 index fa6d84e8..00000000 --- a/templates/_admin4/html/com_content/article/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/templates/_admin4/html/com_content/index.html b/templates/_admin4/html/com_content/index.html deleted file mode 100644 index 94906bce..00000000 --- a/templates/_admin4/html/com_content/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/templates/_admin4/html/index.html b/templates/_admin4/html/index.html deleted file mode 100644 index 94906bce..00000000 --- a/templates/_admin4/html/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/templates/_admin4/html/modules.php b/templates/_admin4/html/modules.php deleted file mode 100644 index c01c2921..00000000 --- a/templates/_admin4/html/modules.php +++ /dev/null @@ -1,82 +0,0 @@ - '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)) : ?> - -
-showtitle != 0) : ?> -

title; ?>

- - -content; ?> - -
- -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); - } -} diff --git a/templates/_admin4/index.php b/templates/_admin4/index.php index 004e5239..8b34adfb 100644 --- a/templates/_admin4/index.php +++ b/templates/_admin4/index.php @@ -6,7 +6,7 @@ defined('_JEXEC') or die; * 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; @@ -25,7 +25,6 @@ $templateUrl = $document->baseurl . '/templates/' . $document->template; -
@@ -45,6 +44,7 @@ $templateUrl = $document->baseurl . '/templates/' . $document->template;
+
\ No newline at end of file diff --git a/templates/_admin4/library/Artx.php b/templates/_admin4/library/Artx.php deleted file mode 100644 index 7b7f8fa6..00000000 --- a/templates/_admin4/library/Artx.php +++ /dev/null @@ -1,27 +0,0 @@ - $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 diff --git a/templates/_admin4/library/Artx/Content.php b/templates/_admin4/library/Artx/Content.php deleted file mode 100644 index 0e2a6846..00000000 --- a/templates/_admin4/library/Artx/Content.php +++ /dev/null @@ -1,63 +0,0 @@ -_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 '
'; - } - - public function endPageContainer() - { - return '
'; - } -} diff --git a/templates/_admin4/library/Artx/Content/ArchivedArticle.php b/templates/_admin4/library/Artx/Content/ArchivedArticle.php deleted file mode 100644 index 45d9acd2..00000000 --- a/templates/_admin4/library/Artx/Content/ArchivedArticle.php +++ /dev/null @@ -1,33 +0,0 @@ -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 '
' - . JHtml::_('string.truncate', $intro, - $this->_articleParams->get('introtext_limit')) - . '
'; - } -} diff --git a/templates/_admin4/library/Artx/Content/ArticleBase.php b/templates/_admin4/library/Artx/Content/ArticleBase.php deleted file mode 100644 index 76b4608f..00000000 --- a/templates/_admin4/library/Artx/Content/ArticleBase.php +++ /dev/null @@ -1,149 +0,0 @@ -_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 '
 
'; } - - /** - * @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 ''; - if (strlen($parentCategoryLink)) - echo '' . $this->_component->escape($parentCategory) . ''; - else - echo $this->_component->escape($parentCategory); - echo ''; - if (strlen($category)) - echo ' / '; - } - if (strlen($category)) { - echo ''; - if (strlen($categoryLink)) - echo '' . $this->_component->escape($category) . ''; - else - echo $this->_component->escape($category); - echo ''; - } - 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); - } -} diff --git a/templates/_admin4/library/Artx/Content/CategoryArticle.php b/templates/_admin4/library/Artx/Content/CategoryArticle.php deleted file mode 100644 index fa08a5f3..00000000 --- a/templates/_admin4/library/Artx/Content/CategoryArticle.php +++ /dev/null @@ -1,21 +0,0 @@ -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)) - : ''; - } -} diff --git a/templates/_admin4/library/Artx/Content/FeaturedArticle.php b/templates/_admin4/library/Artx/Content/FeaturedArticle.php deleted file mode 100644 index 57b5f26d..00000000 --- a/templates/_admin4/library/Artx/Content/FeaturedArticle.php +++ /dev/null @@ -1,21 +0,0 @@ -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)) - : ''; - } -} diff --git a/templates/_admin4/library/Artx/Content/Item.php b/templates/_admin4/library/Artx/Content/Item.php deleted file mode 100644 index ba046932..00000000 --- a/templates/_admin4/library/Artx/Content/Item.php +++ /dev/null @@ -1,116 +0,0 @@ -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
...
. - * By default, this decoration is applied only to articles in lists. - */ - public function beginUnpublishedArticle() { return '
'; } - - public function endUnpublishedArticle() { return '
'; } - - public function readmore($readmore, $readmoreLink) - { - return '

' . artxLinkButton(array( - 'classes' => array('a' => 'readon'), - 'link' => $readmoreLink, - 'content' => str_replace(' ', ' ', $readmore))) . '

'; - } - - 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()))); - } -} diff --git a/templates/_admin4/library/Artx/Content/ListItem.php b/templates/_admin4/library/Artx/Content/ListItem.php deleted file mode 100644 index d085b243..00000000 --- a/templates/_admin4/library/Artx/Content/ListItem.php +++ /dev/null @@ -1,53 +0,0 @@ -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 "
" . $intro . "
"; - } -} diff --git a/templates/_admin4/library/Artx/Content/SingleArticle.php b/templates/_admin4/library/Artx/Content/SingleArticle.php deleted file mode 100644 index 3f793f59..00000000 --- a/templates/_admin4/library/Artx/Content/SingleArticle.php +++ /dev/null @@ -1,103 +0,0 @@ -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 '
' . $toc . '
'; - } - - public function intro($intro) - { - return '
' . $intro . '
'; - } - - public function text($text) - { - return '
' . $text . '
'; - } - - public function pagination() { - return $this->_article->pagination; - } -} diff --git a/templates/_admin4/library/Artx/Log.php b/templates/_admin4/library/Artx/Log.php deleted file mode 100644 index 86ce8bee..00000000 --- a/templates/_admin4/library/Artx/Log.php +++ /dev/null @@ -1,47 +0,0 @@ -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']; - } -} diff --git a/templates/_admin4/library/Artx/Log/ErrorLogWriter.php b/templates/_admin4/library/Artx/Log/ErrorLogWriter.php deleted file mode 100644 index a5ab2548..00000000 --- a/templates/_admin4/library/Artx/Log/ErrorLogWriter.php +++ /dev/null @@ -1,9 +0,0 @@ - $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'; - } -} diff --git a/templates/_admin4/library/Artx/Page.php b/templates/_admin4/library/Artx/Page.php deleted file mode 100644 index ac211a63..00000000 --- a/templates/_admin4/library/Artx/Page.php +++ /dev/null @@ -1,258 +0,0 @@ -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 = '
'; - $result .= '
'; - foreach ($cells as $name => $width) - $result .='
' . $this->position($name, $style) . '
'; - $result .= '
'; - $result .= '
'; - return $result; - } - - public function position($position, $style = null) - { - return ''; - } - - 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 '
' 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('