Skip to content

Commit

Permalink
Merge remote-tracking branch 'joomla-cms/staging' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
johanjanssens committed May 3, 2015
2 parents e63a9f4 + df5c484 commit 0527776
Show file tree
Hide file tree
Showing 850 changed files with 31,129 additions and 20,971 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
/phpunit.xml
/tests/system/webdriver/tests/logs/
/tests/system/servers/configdef.php
codecept.phar
tests/codeception/_output/*
tests/codeception/vendor/*
tests/codeception/testingsite*
tests/codeception/tests/acceptance.suite.yml
tests/codeception/tests/acceptance/*Tester.php
tests/codeception/tests/functional/*Tester.php
tests/codeception/tests/unit/*Tester.php

# phpDocumentor Logs #
phpdoc-*
Expand Down
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ services:
- redis-server

before_script:
# - composer self-update
# - composer update
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then pyrus install -f pear/PHP_CodeSniffer-1.5.5; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then pyrus install -f pear/Cache_Lite; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then phpenv rehash; fi"
# Install PHPCS to validate code standards
- composer require squizlabs/php_codesniffer 1.5.6
# Install Cache_Lite for testing
- composer require pear/cache_lite 1.7.16
# Set up databases for testing
- mysql -e 'create database joomla_ut;'
- mysql joomla_ut < tests/unit/schema/mysql.sql
Expand All @@ -35,7 +35,7 @@ before_script:

script:
- phpunit --configuration travisci-phpunit.xml
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then phpcs --report=full --extensions=php -p --standard=build/phpcs/Joomla .; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then libraries/vendor/bin/phpcs --report=full --extensions=php -p --standard=build/phpcs/Joomla .; fi"

branches:
except:
Expand Down
21 changes: 5 additions & 16 deletions administrator/components/com_admin/helpers/html/directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ public static function writable($writable)
{
return '<span class="badge badge-success">' . JText::_('COM_ADMIN_WRITABLE') . '</span>';
}
else
{
return '<span class="badge badge-important">' . JText::_('COM_ADMIN_UNWRITABLE') . '</span>';
}

return '<span class="badge badge-important">' . JText::_('COM_ADMIN_UNWRITABLE') . '</span>';
}

/**
Expand All @@ -46,22 +44,13 @@ public static function writable($writable)
*/
public static function message($dir, $message, $visible = true)
{
if ($visible)
{
$output = $dir;
}
else
{
$output = '';
}
$output = $visible ? $dir : '';

if (empty($message))
{
return $output;
}
else
{
return $output . ' <strong>' . JText::_($message) . '</strong>';
}

return $output . ' <strong>' . JText::_($message) . '</strong>';
}
}
27 changes: 3 additions & 24 deletions administrator/components/com_admin/helpers/html/phpsetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@ abstract class JHtmlPhpSetting
*/
public static function boolean($val)
{
if ($val)
{
return JText::_('JON');
}
else
{
return JText::_('JOFF');
}
return JText::_($val ? 'JON' : 'JOFF');
}

/**
Expand All @@ -44,14 +37,7 @@ public static function boolean($val)
*/
public static function set($val)
{
if ($val)
{
return JText::_('JYES');
}
else
{
return JText::_('JNO');
}
return JText::_($val ? 'JYES' : 'JNO');
}

/**
Expand All @@ -63,14 +49,7 @@ public static function set($val)
*/
public static function string($val)
{
if (empty($val))
{
return JText::_('JNONE');
}
else
{
return $val;
}
return !empty($val) ? $val : JText::_('JNONE');
}

/**
Expand Down
9 changes: 1 addition & 8 deletions administrator/components/com_admin/helpers/html/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ abstract class JHtmlSystem
*/
public static function server($val)
{
if (empty($val))
{
return JText::_('COM_ADMIN_NA');
}
else
{
return $val;
}
return !empty($val) ? $val : JText::_('COM_ADMIN_NA');
}
}
108 changes: 56 additions & 52 deletions administrator/components/com_admin/models/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,68 +127,72 @@ public function getLangTag()
*/
public function &getToc()
{
if (is_null($this->toc))
if (!is_null($this->toc))
{
// Get vars
$lang_tag = $this->getLangTag();
$help_search = $this->getHelpSearch();
return $this->toc;
}

// New style - Check for a TOC JSON file
if (file_exists(JPATH_BASE . '/help/' . $lang_tag . '/toc.json'))
{
$data = json_decode(file_get_contents(JPATH_BASE . '/help/' . $lang_tag . '/toc.json'));
// Get vars
$lang_tag = $this->getLangTag();
$help_search = $this->getHelpSearch();

// Loop through the data array
foreach ($data as $key => $value)
{
$this->toc[$key] = JText::_('COM_ADMIN_HELP_' . $value);
}
}
else
// New style - Check for a TOC JSON file
if (file_exists(JPATH_BASE . '/help/' . $lang_tag . '/toc.json'))
{
$data = json_decode(file_get_contents(JPATH_BASE . '/help/' . $lang_tag . '/toc.json'));

// Loop through the data array
foreach ($data as $key => $value)
{
// Get Help files
jimport('joomla.filesystem.folder');
$files = JFolder::files(JPATH_BASE . '/help/' . $lang_tag, '\.xml$|\.html$');
$this->toc = array();

foreach ($files as $file)
{
$buffer = file_get_contents(JPATH_BASE . '/help/' . $lang_tag . '/' . $file);

if (preg_match('#<title>(.*?)</title>#', $buffer, $m))
{
$title = trim($m[1]);

if ($title)
{
// Translate the page title
$title = JText::_($title);

// Strip the extension
$file = preg_replace('#\.xml$|\.html$#', '', $file);

if ($help_search)
{
if (JString::strpos(JString::strtolower(strip_tags($buffer)), JString::strtolower($help_search)) !== false)
{
// Add an item in the Table of Contents
$this->toc[$file] = $title;
}
}
else
{
// Add an item in the Table of Contents
$this->toc[$file] = $title;
}
}
}
}
$this->toc[$key] = JText::_('COM_ADMIN_HELP_' . $value);
}

// Sort the Table of Contents
asort($this->toc);

return $this->toc;
}

// Get Help files
jimport('joomla.filesystem.folder');
$files = JFolder::files(JPATH_BASE . '/help/' . $lang_tag, '\.xml$|\.html$');
$this->toc = array();

foreach ($files as $file)
{
$buffer = file_get_contents(JPATH_BASE . '/help/' . $lang_tag . '/' . $file);

if (!preg_match('#<title>(.*?)</title>#', $buffer, $m))
{
continue;
}

$title = trim($m[1]);

if (!$title)
{
continue;
}

// Translate the page title
$title = JText::_($title);

// Strip the extension
$file = preg_replace('#\.xml$|\.html$#', '', $file);

if ($help_search
&& JString::strpos(JString::strtolower(strip_tags($buffer)), JString::strtolower($help_search)) === false)
{
continue;
}

// Add an item in the Table of Contents
$this->toc[$file] = $title;
}

// Sort the Table of Contents
asort($this->toc);

return $this->toc;
}

Expand Down

0 comments on commit 0527776

Please sign in to comment.