Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Commit

Permalink
Update to 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
denysdesign committed Mar 18, 2019
1 parent 9bb9132 commit d4eb8bf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<project name="juarticlesave" default="dist" basedir=".">

<property name="VERSION" value="1.0.2"/>
<property name="VERSION" value="1.0.3"/>

<tstamp>
<format property="DATE" pattern="%d.%m.%Y" />
Expand Down
22 changes: 12 additions & 10 deletions juarticlesave.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ public function __construct(&$subject, $config)
*/
public function onContentBeforeSave($context, $article, $isNew)
{
if( $context !== 'com_content.article' )
if($context !== 'com_content.article')
{
return true;
}

if( $this->params->def('fix_date', 0) == 1 )
if($this->params->def('fix_date', 0) == 1)
{
date_default_timezone_set('UTC');

$datenow = date('Y-m-d H:i:s');

if( $article->publish_up === '0000-00-00 00:00:00' || $article->publish_up === null || $article->publish_up == '' )
if($article->publish_up === '0000-00-00 00:00:00' || $article->publish_up === null || $article->publish_up == '')
{
$article->publish_up = $datenow;
$article->created = $datenow;
Expand All @@ -82,7 +82,7 @@ public function onContentBeforeSave($context, $article, $isNew)
$this->app->enqueueMessage($msg_publis_up . $msg_created, 'notice');
}

if( $this->params->def('typo', 0) == 1 )
if($this->params->def('typo', 0) == 1)
{
$article->title = $this->_typo($article->title, 0);
$article->introtext = $this->_typo($article->introtext);
Expand Down Expand Up @@ -111,12 +111,14 @@ public function _typo($text, $tags = 1)

$typograf->set_text($text);
$typograf->setup([
'Text.paragraphs' => 'off',
'Text.breakline' => 'off',
'OptAlign.all' => 'off',
'Text.paragraphs' => 'off',
'Text.breakline' => 'off',
'OptAlign.all' => 'off',
'Nobr.spaces_nobr_in_surname_abbr' => 'off',
'Etc.split_number_to_triads' => 'off'
]);

if( $tags == 0 )
if($tags == 0)
{
$result = html_entity_decode(strip_tags($typograf->apply()));
}
Expand All @@ -125,9 +127,9 @@ public function _typo($text, $tags = 1)
$result = $typograf->apply();
$result = str_replace('<p></p>', '', $result);

if( !empty($pre[ 0 ]) )
if(!empty($pre[ 0 ]))
{
foreach( $pre[ 0 ] as $tag )
foreach($pre[ 0 ] as $tag)
{
$result = preg_replace('!#pre#!', $tag, $result, 1);
}
Expand Down
Binary file added phing-latest.phar
Binary file not shown.

0 comments on commit d4eb8bf

Please sign in to comment.