Skip to content

Commit

Permalink
Update version 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
trinhvanduong committed Apr 11, 2023
1 parent 5291a59 commit a584bb9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# Changelog
# Changelog

## 1.0.1 (2023-04-11)

**Implemented enhancements:**

- Compatible with Joomla 4
44 changes: 25 additions & 19 deletions password.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct($subject, array $config = array())
'com_tz_portfolio_plus.search');
}

public function onUserBeforeDataValidation($form, &$data){
public function onUserBeforeDataValidation($form, $data){
$app = JFactory::getApplication();
$name = $form -> getName();
$contexts = array('com_tz_portfolio_plus.category', 'com_tz_portfolio_plus.article');
Expand Down Expand Up @@ -312,27 +312,33 @@ public function onTPContentAfterPrepare($context, &$item, &$params, $page = 0, $
}
}

foreach($protectItems as $pitem){
if($extension == 'module' || $extension == 'modules'){
$params->set('show_' .$pitem, 0);
}else{
if($pitem == 'project_link') {
$params -> set('project_link', '');
}elseif($pitem == 'introtext') {
$item -> introtext = '';
$params->set('show_' . $p_prefix . 'intro', 0);

if($context == 'com_tz_portfolio_plus.portfolio' && $params -> exists('show_search_intro')) {
$params->set('show_search_intro', 0);
}
}elseif($pitem != 'fulltext') {
$params->set('show_' . $p_prefix . $pitem, 0);
if(is_string($protectItems)){
$protectItems = json_decode($protectItems, true);
}

if($context == 'com_tz_portfolio_plus.portfolio' && $params -> exists('show_search_'.$pitem)) {
$params->set('show_search_'.$pitem, 0);
if(is_array($protectItems) && !empty($protectItems)){
foreach($protectItems as $pitem){
if($extension == 'module' || $extension == 'modules'){
$params->set('show_' .$pitem, 0);
}else{
if($pitem == 'project_link') {
$params -> set('project_link', '');
}elseif($pitem == 'introtext') {
$item -> introtext = '';
$params->set('show_' . $p_prefix . 'intro', 0);

if($context == 'com_tz_portfolio_plus.portfolio' && $params -> exists('show_search_intro')) {
$params->set('show_search_intro', 0);
}
}elseif($pitem != 'fulltext') {
$params->set('show_' . $p_prefix . $pitem, 0);

if($context == 'com_tz_portfolio_plus.portfolio' && $params -> exists('show_search_'.$pitem)) {
$params->set('show_search_'.$pitem, 0);
}
}
}

}
}
}

Expand Down
2 changes: 1 addition & 1 deletion password.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>support@templaza.com</authorEmail>
<authorUrl>www.tzportfolio.com</authorUrl>
<version>1.0.0</version>
<version>1.0.1</version>
<description>TP_ADDON_CONTENT_PASSWORD_XML_DESCRIPTION</description>

<files>
Expand Down

0 comments on commit a584bb9

Please sign in to comment.