Continued formatting of JCB code

This commit is contained in:
Llewellyn van der Merwe 2017-12-15 03:10:10 +02:00
parent 8ac350e62b
commit e44b6bc272
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
91 changed files with 1516 additions and 1518 deletions

View File

@ -115,7 +115,7 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.6.7 + *Version*: 2.6.7
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **178243** + *Line count*: **178242**
+ *File count*: **1145** + *File count*: **1145**
+ *Folder count*: **184** + *Folder count*: **184**

View File

@ -115,7 +115,7 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.6.7 + *Version*: 2.6.7
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **178243** + *Line count*: **178242**
+ *File count*: **1145** + *File count*: **1145**
+ *Folder count*: **184** + *Folder count*: **184**

View File

@ -40,101 +40,101 @@ class ###Component###Model###Component### extends JModelList
{ {
public function getIcons() public function getIcons()
{ {
// load user for access menus // load user for access menus
$user = JFactory::getUser(); $user = JFactory::getUser();
// reset icon array // reset icon array
$icons = array(); $icons = array();
// view groups array // view groups array
$viewGroups = array( $viewGroups = array(
'main' => array(###DASHBOARDICONS###) 'main' => array(###DASHBOARDICONS###)
);###DASHBOARDICONACCESS### );###DASHBOARDICONACCESS###
foreach($viewGroups as $group => $views) foreach($viewGroups as $group => $views)
{ {
$i = 0; $i = 0;
if (###Component###Helper::checkArray($views)) if (###Component###Helper::checkArray($views))
{ {
foreach($views as $view) foreach($views as $view)
{ {
$add = false; $add = false;
if (strpos($view,'.') !== false) if (strpos($view,'.') !== false)
{ {
$dwd = explode('.', $view); $dwd = explode('.', $view);
if (count($dwd) == 3) if (count($dwd) == 3)
{ {
list($type, $name, $action) = $dwd; list($type, $name, $action) = $dwd;
} }
elseif (count($dwd) == 2) elseif (count($dwd) == 2)
{ {
list($type, $name) = $dwd; list($type, $name) = $dwd;
$action = false; $action = false;
} }
if ($action) if ($action)
{ {
$viewName = $name; $viewName = $name;
switch($action) switch($action)
{ {
case 'add': case 'add':
$url ='index.php?option=com_###component###&view='.$name.'&layout=edit'; $url ='index.php?option=com_###component###&view='.$name.'&layout=edit';
$image = $name.'_'.$action.'.'.$type; $image = $name.'_'.$action.'.'.$type;
$alt = $name.' '.$action; $alt = $name.' '.$action;
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_ADD'; $name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_ADD';
$add = true; $add = true;
break; break;
default: default:
$url = 'index.php?option=com_categories&view=categories&extension=com_###component###.'.$name; $url = 'index.php?option=com_categories&view=categories&extension=com_###component###.'.$name;
$image = $name.'_'.$action.'.'.$type; $image = $name.'_'.$action.'.'.$type;
$alt = $name.' '.$action; $alt = $name.' '.$action;
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_'.###Component###Helper::safeString($action,'U'); $name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_'.###Component###Helper::safeString($action,'U');
break; break;
} }
} }
else else
{ {
$viewName = $name; $viewName = $name;
$alt = $name; $alt = $name;
$url = 'index.php?option=com_###component###&view='.$name; $url = 'index.php?option=com_###component###&view='.$name;
$image = $name.'.'.$type; $image = $name.'.'.$type;
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U'); $name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U');
$hover = false; $hover = false;
} }
} }
else else
{ {
$viewName = $view; $viewName = $view;
$alt = $view; $alt = $view;
$url = 'index.php?option=com_###component###&view='.$view; $url = 'index.php?option=com_###component###&view='.$view;
$image = $view.'.png'; $image = $view.'.png';
$name = ucwords($view).'<br /><br />'; $name = ucwords($view).'<br /><br />';
$hover = false; $hover = false;
} }
// first make sure the view access is set // first make sure the view access is set
if (###Component###Helper::checkArray($viewAccess)) if (###Component###Helper::checkArray($viewAccess))
{ {
// setup some defaults // setup some defaults
$dashboard_add = false; $dashboard_add = false;
$dashboard_list = false; $dashboard_list = false;
$accessTo = ''; $accessTo = '';
$accessAdd = ''; $accessAdd = '';
// acces checking start // acces checking start
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.create']):false; $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.create']):false;
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.access']):false; $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.access']):false;
// set main controllers // set main controllers
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_add']):false; $accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_list']):false; $accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_list']):false;
// check for adding access // check for adding access
if ($add && $accessCreate) if ($add && $accessCreate)
{ {
$accessAdd = $viewAccess[$viewName.'.create']; $accessAdd = $viewAccess[$viewName.'.create'];
} }
elseif ($add) elseif ($add)
{ {
$accessAdd = 'core.create'; $accessAdd = 'core.create';
} }
// check if acces to view is set // check if acces to view is set
if ($accessAccess) if ($accessAccess)
{ {
$accessTo = $viewAccess[$viewName.'.access']; $accessTo = $viewAccess[$viewName.'.access'];
} }
// set main access controllers // set main access controllers
if ($accessDashboard_add) if ($accessDashboard_add)
{ {
@ -144,65 +144,65 @@ class ###Component###Model###Component### extends JModelList
{ {
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###'); $dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###');
} }
if (###Component###Helper::checkString($accessAdd) && ###Component###Helper::checkString($accessTo)) if (###Component###Helper::checkString($accessAdd) && ###Component###Helper::checkString($accessTo))
{ {
// check access // check access
if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add) if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add)
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
elseif (###Component###Helper::checkString($accessTo)) elseif (###Component###Helper::checkString($accessTo))
{ {
// check access // check access
if($user->authorise($accessTo, 'com_###component###') && $dashboard_list) if($user->authorise($accessTo, 'com_###component###') && $dashboard_list)
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
elseif (###Component###Helper::checkString($accessAdd)) elseif (###Component###Helper::checkString($accessAdd))
{ {
// check access // check access
if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add) if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add)
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
else else
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
else else
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
$i++; $i++;
} }
} }
else else
{ {
$icons[$group][$i] = false; $icons[$group][$i] = false;
} }
} }
return $icons; return $icons;

View File

@ -74,15 +74,15 @@ class ###Component###View###Component### extends JViewLegacy
$canDo = ###Component###Helper::getActions('###component###'); $canDo = ###Component###Helper::getActions('###component###');
JToolBarHelper::title(JText::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2'); JToolBarHelper::title(JText::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2');
// set help url for this view if found // set help url for this view if found
$help_url = ###Component###Helper::getHelpUrl('###component###'); $help_url = ###Component###Helper::getHelpUrl('###component###');
if (###Component###Helper::checkString($help_url)) if (###Component###Helper::checkString($help_url))
{ {
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
} }
if ($canDo->get('core.admin') || $canDo->get('core.options')) if ($canDo->get('core.admin') || $canDo->get('core.options'))
{ {
JToolBarHelper::preferences('com_###component###'); JToolBarHelper::preferences('com_###component###');
} }
} }

View File

@ -37,10 +37,10 @@ abstract class ###Component###Helper
/** /**
* Load the Component xml manifest. * Load the Component xml manifest.
**/ **/
public static function manifest() public static function manifest()
{ {
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml"; $manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
return simplexml_load_file($manifestUrl); return simplexml_load_file($manifestUrl);
} }
/** /**
@ -55,22 +55,22 @@ abstract class ###Component###Helper
// get all Contributors (max 20) // get all Contributors (max 20)
$searchArray = range('0','20'); $searchArray = range('0','20');
foreach($searchArray as $nr) foreach($searchArray as $nr)
{ {
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3)) if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3))
{ {
// set link based of selected option // set link based of selected option
if($params->get("useContributor".$nr) == 1) if($params->get("useContributor".$nr) == 1)
{ {
$link_front = '<a href="mailto:'.$params->get("emailContributor".$nr).'" target="_blank">'; $link_front = '<a href="mailto:'.$params->get("emailContributor".$nr).'" target="_blank">';
$link_back = '</a>'; $link_back = '</a>';
} }
elseif($params->get("useContributor".$nr) == 2) elseif($params->get("useContributor".$nr) == 2)
{ {
$link_front = '<a href="'.$params->get("linkContributor".$nr).'" target="_blank">'; $link_front = '<a href="'.$params->get("linkContributor".$nr).'" target="_blank">';
$link_back = '</a>'; $link_back = '</a>';
} }
else else
{ {
$link_front = ''; $link_front = '';
$link_back = ''; $link_back = '';
} }
@ -86,10 +86,10 @@ abstract class ###Component###Helper
**/ **/
public static function addSubmenu($submenu) public static function addSubmenu($submenu)
{ {
// load user for access menus // load user for access menus
$user = JFactory::getUser(); $user = JFactory::getUser();
// load the submenus to sidebar // load the submenus to sidebar
###SUBMENU### ###SUBMENU###
}###HELPER_CREATEUSER### ###HELPER_UIKIT### ###HELPER_EXEL### }###HELPER_CREATEUSER### ###HELPER_UIKIT### ###HELPER_EXEL###
public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###') public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###')
@ -182,9 +182,9 @@ abstract class ###Component###Helper
public static function jsonToString($value, $sperator = ", ", $table = null) public static function jsonToString($value, $sperator = ", ", $table = null)
{ {
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) if (json_last_error() === JSON_ERROR_NONE)
{ {
// is JSON // is JSON
if (self::checkArray($result)) if (self::checkArray($result))
@ -206,15 +206,15 @@ abstract class ###Component###Helper
} }
return (string) implode($sperator,$result); return (string) implode($sperator,$result);
} }
return (string) json_decode($value); return (string) json_decode($value);
} }
return $value; return $value;
} }
public static function isPublished($id,$type) public static function isPublished($id,$type)
{ {
if ($type == 'raw') if ($type == 'raw')
{ {
$type = 'item'; $type = 'item';
} }
$db = JFactory::getDbo(); $db = JFactory::getDbo();
@ -227,7 +227,7 @@ abstract class ###Component###Helper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return true; return true;
} }
return false; return false;
@ -244,33 +244,33 @@ abstract class ###Component###Helper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return $db->loadResult(); return $db->loadResult();
} }
return $id; return $id;
} }
/** /**
* Get the actions permissions * Get the actions permissions
**/ **/
public static function getActions($view,&$record = null,$views = null) public static function getActions($view,&$record = null,$views = null)
{ {
jimport('joomla.access.access'); jimport('joomla.access.access');
$user = JFactory::getUser(); $user = JFactory::getUser();
$result = new JObject; $result = new JObject;
$view = self::safeString($view); $view = self::safeString($view);
if (self::checkString($views)) if (self::checkString($views))
{ {
$views = self::safeString($views); $views = self::safeString($views);
} }
// get all actions from component // get all actions from component
$actions = JAccess::getActions('com_###component###', 'component'); $actions = JAccess::getActions('com_###component###', 'component');
// set acctions only set in component settiongs // set acctions only set in component settiongs
$componentActions = array('core.admin','core.manage','core.options','core.export'); $componentActions = array('core.admin','core.manage','core.options','core.export');
// loop the actions and set the permissions // loop the actions and set the permissions
foreach ($actions as $action) foreach ($actions as $action)
{ {
// set to use component default // set to use component default
$fallback= true; $fallback= true;
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions)) if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
@ -349,17 +349,17 @@ abstract class ###Component###Helper
} }
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
{ {
// make sure we use the core. action check for the categories // make sure we use the core. action check for the categories
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) { if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
$coreCheck = explode('.',$action->name); $coreCheck = explode('.',$action->name);
$coreCheck[0] = 'core'; $coreCheck[0] = 'core';
$categoryCheck = implode('.',$coreCheck); $categoryCheck = implode('.',$coreCheck);
} }
else else
{ {
$categoryCheck = $action->name; $categoryCheck = $action->name;
} }
// The record has a category. Check the category permissions. // The record has a category. Check the category permissions.
$catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid); $catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid);
if (!$catpermission && !is_null($catpermission)) if (!$catpermission && !is_null($catpermission))
{ {
@ -740,8 +740,8 @@ abstract class ###Component###Helper
$string = self::replaceNumbers($string); $string = self::replaceNumbers($string);
} }
// 0nly continue if we have a string // 0nly continue if we have a string
if (self::checkString($string)) if (self::checkString($string))
{ {
// create file name without the extention that is safe // create file name without the extention that is safe
if ($type === 'filename') if ($type === 'filename')
{ {
@ -764,12 +764,12 @@ abstract class ###Component###Helper
$string = preg_replace("/[^A-Za-z ]/", '', $string); $string = preg_replace("/[^A-Za-z ]/", '', $string);
// select final adaptations // select final adaptations
if ($type === 'L' || $type === 'strtolower') if ($type === 'L' || $type === 'strtolower')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower // default is to return lower
return strtolower($string); return strtolower($string);
} }
elseif ($type === 'W') elseif ($type === 'W')
{ {
// return a string with all first letter of each word uppercase(no undersocre) // return a string with all first letter of each word uppercase(no undersocre)
@ -790,21 +790,21 @@ abstract class ###Component###Helper
// return a string with all the uppercase(no undersocre) // return a string with all the uppercase(no undersocre)
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'U' || $type === 'strtoupper') elseif ($type === 'U' || $type === 'strtoupper')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return all upper // return all upper
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'F' || $type === 'ucfirst') elseif ($type === 'F' || $type === 'ucfirst')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper // return with first caracter to upper
return ucfirst(strtolower($string)); return ucfirst(strtolower($string));
} }
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase') elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{ {
// convert all words to first letter uppercase // convert all words to first letter uppercase
$string = ucwords(strtolower($string)); $string = ucwords(strtolower($string));
@ -813,14 +813,14 @@ abstract class ###Component###Helper
// now return first letter lowercase // now return first letter lowercase
return lcfirst($string); return lcfirst($string);
} }
// return string // return string
return $string; return $string;
} }
// not a string // not a string
return ''; return '';
} }
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
{ {
if (self::checkString($var)) if (self::checkString($var))
{ {
@ -831,11 +831,11 @@ abstract class ###Component###Helper
return self::shorten($string,$length); return self::shorten($string,$length);
} }
return $string; return $string;
} }
else else
{ {
return ''; return '';
} }
}###HELPER_LICENSE_LOCK### }###HELPER_LICENSE_LOCK###
public static function replaceNumbers($string) public static function replaceNumbers($string)

View File

@ -191,7 +191,6 @@ abstract class ###Component###Email
// load the bounce email as sender if set // load the bounce email as sender if set
if (!is_null($bounce_email)) if (!is_null($bounce_email))
{ {
$mail->Sender = $bounce_email; $mail->Sender = $bounce_email;
} }

View File

@ -37,9 +37,9 @@ abstract class ###Component###Helper
public static function jsonToString($value, $sperator = ", ", $table = null) public static function jsonToString($value, $sperator = ", ", $table = null)
{ {
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) if (json_last_error() === JSON_ERROR_NONE)
{ {
// is JSON // is JSON
if (self::checkArray($result)) if (self::checkArray($result))
@ -69,10 +69,10 @@ abstract class ###Component###Helper
/** /**
* Load the Component xml manifest. * Load the Component xml manifest.
**/ **/
public static function manifest() public static function manifest()
{ {
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml"; $manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
return simplexml_load_file($manifestUrl); return simplexml_load_file($manifestUrl);
} }
/** /**
@ -87,9 +87,9 @@ abstract class ###Component###Helper
// get all Contributors (max 20) // get all Contributors (max 20)
$searchArray = range('0','20'); $searchArray = range('0','20');
foreach($searchArray as $nr) foreach($searchArray as $nr)
{ {
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 2 || $params->get("showContributor".$nr) == 3)) if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 2 || $params->get("showContributor".$nr) == 3))
{ {
// set link based of selected option // set link based of selected option
if($params->get("useContributor".$nr) == 1) if($params->get("useContributor".$nr) == 1)
{ {
@ -368,7 +368,7 @@ abstract class ###Component###Helper
public static function isPublished($id,$type) public static function isPublished($id,$type)
{ {
if ($type == 'raw') if ($type == 'raw')
{ {
$type = 'item'; $type = 'item';
} }
$db = JFactory::getDbo(); $db = JFactory::getDbo();
@ -381,7 +381,7 @@ abstract class ###Component###Helper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return true; return true;
} }
return false; return false;
@ -398,7 +398,7 @@ abstract class ###Component###Helper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return $db->loadResult(); return $db->loadResult();
} }
return $id; return $id;
@ -407,24 +407,24 @@ abstract class ###Component###Helper
/** /**
* Get the actions permissions * Get the actions permissions
**/ **/
public static function getActions($view,&$record = null,$views = null) public static function getActions($view,&$record = null,$views = null)
{ {
jimport('joomla.access.access'); jimport('joomla.access.access');
$user = JFactory::getUser(); $user = JFactory::getUser();
$result = new JObject; $result = new JObject;
$view = self::safeString($view); $view = self::safeString($view);
if (self::checkString($views)) if (self::checkString($views))
{ {
$views = self::safeString($views); $views = self::safeString($views);
} }
// get all actions from component // get all actions from component
$actions = JAccess::getActions('com_###component###', 'component'); $actions = JAccess::getActions('com_###component###', 'component');
// set acctions only set in component settiongs // set acctions only set in component settiongs
$componentActions = array('core.admin','core.manage','core.options','core.export'); $componentActions = array('core.admin','core.manage','core.options','core.export');
// loop the actions and set the permissions // loop the actions and set the permissions
foreach ($actions as $action) foreach ($actions as $action)
{ {
// set to use component default // set to use component default
$fallback = true; $fallback = true;
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions)) if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
@ -503,17 +503,17 @@ abstract class ###Component###Helper
} }
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
{ {
// make sure we use the core. action check for the categories // make sure we use the core. action check for the categories
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) { if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
$coreCheck = explode('.',$action->name); $coreCheck = explode('.',$action->name);
$coreCheck[0] = 'core'; $coreCheck[0] = 'core';
$categoryCheck = implode('.',$coreCheck); $categoryCheck = implode('.',$coreCheck);
} }
else else
{ {
$categoryCheck = $action->name; $categoryCheck = $action->name;
} }
// The record has a category. Check the category permissions. // The record has a category. Check the category permissions.
$catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid); $catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid);
if (!$catpermission && !is_null($catpermission)) if (!$catpermission && !is_null($catpermission))
{ {
@ -655,7 +655,7 @@ abstract class ###Component###Helper
{ {
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
$connected = @fsockopen("www.example.com", 80); $connected = @fsockopen("www.example.com", 80);
// website, port (try 80 or 443) // website, port (try 80 or 443)
if ($connected) if ($connected)
{ {
//action when connected //action when connected
@ -735,8 +735,8 @@ abstract class ###Component###Helper
$string = self::replaceNumbers($string); $string = self::replaceNumbers($string);
} }
// 0nly continue if we have a string // 0nly continue if we have a string
if (self::checkString($string)) if (self::checkString($string))
{ {
// create file name without the extention that is safe // create file name without the extention that is safe
if ($type === 'filename') if ($type === 'filename')
{ {
@ -759,12 +759,12 @@ abstract class ###Component###Helper
$string = preg_replace("/[^A-Za-z ]/", '', $string); $string = preg_replace("/[^A-Za-z ]/", '', $string);
// select final adaptations // select final adaptations
if ($type === 'L' || $type === 'strtolower') if ($type === 'L' || $type === 'strtolower')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower // default is to return lower
return strtolower($string); return strtolower($string);
} }
elseif ($type === 'W') elseif ($type === 'W')
{ {
// return a string with all first letter of each word uppercase(no undersocre) // return a string with all first letter of each word uppercase(no undersocre)
@ -785,21 +785,21 @@ abstract class ###Component###Helper
// return a string with all the uppercase(no undersocre) // return a string with all the uppercase(no undersocre)
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'U' || $type === 'strtoupper') elseif ($type === 'U' || $type === 'strtoupper')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return all upper // return all upper
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'F' || $type === 'ucfirst') elseif ($type === 'F' || $type === 'ucfirst')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper // return with first caracter to upper
return ucfirst(strtolower($string)); return ucfirst(strtolower($string));
} }
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase') elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{ {
// convert all words to first letter uppercase // convert all words to first letter uppercase
$string = ucwords(strtolower($string)); $string = ucwords(strtolower($string));
@ -808,11 +808,11 @@ abstract class ###Component###Helper
// now return first letter lowercase // now return first letter lowercase
return lcfirst($string); return lcfirst($string);
} }
// return string // return string
return $string; return $string;
} }
// not a string // not a string
return ''; return '';
} }
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)

View File

@ -49,11 +49,11 @@ class ###Component###Model###SView### extends JModelItem
* *
* @var strings * @var strings
*/ */
protected $user; protected $user;
protected $userId; protected $userId;
protected $guest; protected $guest;
protected $groups; protected $groups;
protected $levels; protected $levels;
protected $app; protected $app;
protected $input; protected $input;
protected $uikitComp; protected $uikitComp;
@ -74,10 +74,10 @@ class ###Component###Model###SView### extends JModelItem
*/ */
protected function populateState() protected function populateState()
{ {
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
// Get the item main id // Get the item main id
$id = $this->input->getInt('id', null); $id = $this->input->getInt('id', null);
$this->setState('###sview###.id', $id); $this->setState('###sview###.id', $id);
// Load the parameters. // Load the parameters.
@ -94,21 +94,21 @@ class ###Component###Model###SView### extends JModelItem
public function getItem($pk = null) public function getItem($pk = null)
{ {
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
// check if this user has permission to access item // check if this user has permission to access item
if (!$this->user->authorise('###sview###.access', 'com_###component###')) if (!$this->user->authorise('###sview###.access', 'com_###component###'))
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$app->enqueueMessage(JText::_('Not authorised!'), 'error'); $app->enqueueMessage(JText::_('Not authorised!'), 'error');
// redirect away if not a correct to cPanel/default view // redirect away if not a correct to cPanel/default view
$app->redirect('index.php?option=com_###component###'); $app->redirect('index.php?option=com_###component###');
return false; return false;
} }
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest'); $this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups'); $this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->initSet = true; $this->initSet = true;
$pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###CUSTOM_ADMIN_BEFORE_GET_ITEM### $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###CUSTOM_ADMIN_BEFORE_GET_ITEM###

View File

@ -74,10 +74,10 @@ class ###Component###Model###SView### extends JModelItem
*/ */
protected function populateState() protected function populateState()
{ {
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
// Get the itme main id // Get the itme main id
$id = $this->input->getInt('id', null); $id = $this->input->getInt('id', null);
$this->setState('###sview###.id', $id); $this->setState('###sview###.id', $id);
// Load the parameters. // Load the parameters.
@ -95,13 +95,13 @@ class ###Component###Model###SView### extends JModelItem
*/ */
public function getItem($pk = null) public function getItem($pk = null)
{ {
$this->user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS### $this->user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS###
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest'); $this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups'); $this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->initSet = true; $this->initSet = true;
$pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###SITE_BEFORE_GET_ITEM### $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###SITE_BEFORE_GET_ITEM###

View File

@ -92,10 +92,10 @@ class ###Component###ModelImport extends JModelLegacy
public function import() public function import()
{ {
$this->setState('action', 'import'); $this->setState('action', 'import');
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$session = JFactory::getSession(); $session = JFactory::getSession();
$package = null; $package = null;
$continue = false; $continue = false;
// get import type // get import type
$this->getType = $app->input->getString('gettype', NULL); $this->getType = $app->input->getString('gettype', NULL);
// get import type // get import type
@ -150,7 +150,7 @@ class ###Component###ModelImport extends JModelLegacy
// first link data to table headers // first link data to table headers
if(!$continue){ if(!$continue){
$package = json_encode($package); $package = json_encode($package);
$session->set('package', $package); $session->set('package', $package);
$session->set('dataType', $this->dataType); $session->set('dataType', $this->dataType);
$session->set('hasPackage', true); $session->set('hasPackage', true);
@ -202,8 +202,8 @@ class ###Component###ModelImport extends JModelLegacy
protected function _getPackageFromUpload() protected function _getPackageFromUpload()
{ {
// Get the uploaded file information // Get the uploaded file information
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw'); $userfile = $input->files->get('import_package', null, 'raw');
@ -230,9 +230,9 @@ class ###Component###ModelImport extends JModelLegacy
} }
// Build the appropriate paths // Build the appropriate paths
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
$tmp_src = $userfile['tmp_name']; $tmp_src = $userfile['tmp_name'];
// Move uploaded file // Move uploaded file
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
@ -263,8 +263,8 @@ class ###Component###ModelImport extends JModelLegacy
*/ */
protected function _getPackageFromFolder() protected function _getPackageFromFolder()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the path to the package to import // Get the path to the package to import
$p_dir = $input->getString('import_directory'); $p_dir = $input->getString('import_directory');
@ -294,8 +294,8 @@ class ###Component###ModelImport extends JModelLegacy
} }
$package['packagename'] = null; $package['packagename'] = null;
$package['dir'] = $p_dir; $package['dir'] = $p_dir;
$package['type'] = $type; $package['type'] = $type;
return $package; return $package;
} }
@ -308,8 +308,8 @@ class ###Component###ModelImport extends JModelLegacy
*/ */
protected function _getPackageFromUrl() protected function _getPackageFromUrl()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the URL of the package to import // Get the URL of the package to import
$url = $input->getString('import_url'); $url = $input->getString('import_url');
@ -348,7 +348,7 @@ class ###Component###ModelImport extends JModelLegacy
*/ */
protected function check($archivename) protected function check($archivename)
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
// Clean the name // Clean the name
$archivename = JPath::clean($archivename); $archivename = JPath::clean($archivename);
@ -361,15 +361,15 @@ class ###Component###ModelImport extends JModelLegacy
return false; return false;
} }
$config = JFactory::getConfig(); $config = JFactory::getConfig();
// set Package Name // set Package Name
$check['packagename'] = $archivename; $check['packagename'] = $archivename;
// set directory // set directory
$check['dir'] = $config->get('tmp_path'). '/' .$archivename; $check['dir'] = $config->get('tmp_path'). '/' .$archivename;
// set type // set type
$check['type'] = $this->getType; $check['type'] = $this->getType;
return $check; return $check;
} }
@ -408,8 +408,8 @@ class ###Component###ModelImport extends JModelLegacy
{ {
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$package = $config->get('tmp_path'). '/' .$package; $package = $config->get('tmp_path'). '/' .$package;
// Is the package file a valid file? // Is the package file a valid file?
if (is_file($package)) if (is_file($package))
@ -472,11 +472,11 @@ class ###Component###ModelImport extends JModelLegacy
if(###Component###Helper::checkArray($data['array'])) if(###Component###Helper::checkArray($data['array']))
{ {
// get user object // get user object
$user = JFactory::getUser(); $user = JFactory::getUser();
// remove header if it has headers // remove header if it has headers
$id_key = $data['target_headers']['id']; $id_key = $data['target_headers']['id'];
$published_key = $data['target_headers']['published']; $published_key = $data['target_headers']['published'];
$ordering_key = $data['target_headers']['ordering']; $ordering_key = $data['target_headers']['ordering'];
// get the first array set // get the first array set
$firstSet = reset($data['array']); $firstSet = reset($data['array']);
@ -494,13 +494,13 @@ class ###Component###ModelImport extends JModelLegacy
// Get a db connection. // Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// set some defaults // set some defaults
$todayDate = JFactory::getDate()->toSql(); $todayDate = JFactory::getDate()->toSql();
// get global action permissions // get global action permissions
$canDo = ###Component###Helper::getActions($table); $canDo = ###Component###Helper::getActions($table);
$canEdit = $canDo->get('core.edit'); $canEdit = $canDo->get('core.edit');
$canState = $canDo->get('core.edit.state'); $canState = $canDo->get('core.edit.state');
$canCreate = $canDo->get('core.create'); $canCreate = $canDo->get('core.create');
$hasAlias = $this->getAliasesUsed($table); $hasAlias = $this->getAliasesUsed($table);
// prosses the data // prosses the data
foreach($data['array'] as $row) foreach($data['array'] as $row)
{ {
@ -522,11 +522,11 @@ class ###Component###ModelImport extends JModelLegacy
if($found && $canEdit) if($found && $canEdit)
{ {
// update item // update item
$id = $row[$id_key]; $id = $row[$id_key];
$version = $db->loadResult(); $version = $db->loadResult();
// reset all buckets // reset all buckets
$query = $db->getQuery(true); $query = $db->getQuery(true);
$fields = array(); $fields = array();
// Fields to update. // Fields to update.
foreach($row as $key => $cell) foreach($row as $key => $cell)
{ {
@ -571,8 +571,8 @@ class ###Component###ModelImport extends JModelLegacy
} }
} }
// load the defaults // load the defaults
$fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id); $fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id);
$fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate); $fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate);
// Conditions for which records should be updated. // Conditions for which records should be updated.
$conditions = array( $conditions = array(
$db->quoteName('id') . ' = ' . $id $db->quoteName('id') . ' = ' . $id
@ -587,9 +587,9 @@ class ###Component###ModelImport extends JModelLegacy
// insert item // insert item
$query = $db->getQuery(true); $query = $db->getQuery(true);
// reset all buckets // reset all buckets
$columns = array(); $columns = array();
$values = array(); $values = array();
$version = false; $version = false;
// Insert columns. Insert values. // Insert columns. Insert values.
foreach($row as $key => $cell) foreach($row as $key => $cell)
{ {
@ -627,30 +627,30 @@ class ###Component###ModelImport extends JModelLegacy
// set to insert array // set to insert array
if(in_array($key, $data['target_headers']) && is_numeric($cell)) if(in_array($key, $data['target_headers']) && is_numeric($cell))
{ {
$columns[] = $target[$key]; $columns[] = $target[$key];
$values[] = $cell; $values[] = $cell;
} }
elseif(in_array($key, $data['target_headers']) && is_string($cell)) elseif(in_array($key, $data['target_headers']) && is_string($cell))
{ {
$columns[] = $target[$key]; $columns[] = $target[$key];
$values[] = $db->quote($cell); $values[] = $db->quote($cell);
} }
elseif(in_array($key, $data['target_headers']) && is_null($cell)) elseif(in_array($key, $data['target_headers']) && is_null($cell))
{ {
// if import data is null then set empty // if import data is null then set empty
$columns[] = $target[$key]; $columns[] = $target[$key];
$values[] = "''"; $values[] = "''";
} }
} }
// load the defaults // load the defaults
$columns[] = 'created_by'; $columns[] = 'created_by';
$values[] = $db->quote($user->id); $values[] = $db->quote($user->id);
$columns[] = 'created'; $columns[] = 'created';
$values[] = $db->quote($todayDate); $values[] = $db->quote($todayDate);
if (!$version) if (!$version)
{ {
$columns[] = 'version'; $columns[] = 'version';
$values[] = 1; $values[] = 1;
} }
// Prepare the insert query. // Prepare the insert query.
$query $query

View File

@ -59,8 +59,8 @@ class ###Component###Model###View### extends JModelLegacy
/** /**
* Import Settings * Import Settings
*/ */
protected $getType = NULL; protected $getType = NULL;
protected $dataType = NULL; protected $dataType = NULL;
/** /**
* Method to auto-populate the model state. * Method to auto-populate the model state.
@ -92,8 +92,8 @@ class ###Component###Model###View### extends JModelLegacy
protected function _getPackageFromUpload() protected function _getPackageFromUpload()
{ {
// Get the uploaded file information // Get the uploaded file information
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw'); $userfile = $input->files->get('import_package', null, 'raw');
@ -120,9 +120,9 @@ class ###Component###Model###View### extends JModelLegacy
} }
// Build the appropriate paths // Build the appropriate paths
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
$tmp_src = $userfile['tmp_name']; $tmp_src = $userfile['tmp_name'];
// Move uploaded file // Move uploaded file
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
@ -153,8 +153,8 @@ class ###Component###Model###View### extends JModelLegacy
*/ */
protected function _getPackageFromFolder() protected function _getPackageFromFolder()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the path to the package to import // Get the path to the package to import
$p_dir = $input->getString('import_directory'); $p_dir = $input->getString('import_directory');
@ -184,8 +184,8 @@ class ###Component###Model###View### extends JModelLegacy
} }
$package['packagename'] = null; $package['packagename'] = null;
$package['dir'] = $p_dir; $package['dir'] = $p_dir;
$package['type'] = $type; $package['type'] = $type;
return $package; return $package;
} }
@ -198,8 +198,8 @@ class ###Component###Model###View### extends JModelLegacy
*/ */
protected function _getPackageFromUrl() protected function _getPackageFromUrl()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the URL of the package to import // Get the URL of the package to import
$url = $input->getString('import_url'); $url = $input->getString('import_url');
@ -238,7 +238,7 @@ class ###Component###Model###View### extends JModelLegacy
*/ */
protected function check($archivename) protected function check($archivename)
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
// Clean the name // Clean the name
$archivename = JPath::clean($archivename); $archivename = JPath::clean($archivename);
@ -251,15 +251,15 @@ class ###Component###Model###View### extends JModelLegacy
return false; return false;
} }
$config = JFactory::getConfig(); $config = JFactory::getConfig();
// set Package Name // set Package Name
$check['packagename'] = $archivename; $check['packagename'] = $archivename;
// set directory // set directory
$check['dir'] = $config->get('tmp_path'). '/' .$archivename; $check['dir'] = $config->get('tmp_path'). '/' .$archivename;
// set type // set type
$check['type'] = $this->getType; $check['type'] = $this->getType;
return $check; return $check;
} }
@ -277,8 +277,8 @@ class ###Component###Model###View### extends JModelLegacy
{ {
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$package = $config->get('tmp_path'). '/' .$package; $package = $config->get('tmp_path'). '/' .$package;
// Is the package file a valid file? // Is the package file a valid file?
if (is_file($package)) if (is_file($package))

View File

@ -59,15 +59,15 @@ class ###Component###Model###SViews### extends JModelList
protected function getListQuery() protected function getListQuery()
{ {
// Get the current user for authorisation checks // Get the current user for authorisation checks
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest'); $this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups'); $this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
$this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY### $this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY###
} }
/** /**

View File

@ -59,15 +59,15 @@ class ###Component###Model###SViews### extends JModelList
protected function getListQuery() protected function getListQuery()
{ {
// Get the current user for authorisation checks // Get the current user for authorisation checks
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest'); $this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups'); $this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
$this->initSet = true; ###SITE_GET_LIST_QUERY### $this->initSet = true; ###SITE_GET_LIST_QUERY###
} }
/** /**

View File

@ -41,13 +41,13 @@ class ###Component###View###SView### extends JViewLegacy
function display($tpl = null) function display($tpl = null)
{ {
// get component params // get component params
$this->params = JComponentHelper::getParams('com_###component###'); $this->params = JComponentHelper::getParams('com_###component###');
// get the application // get the application
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
// get the user object // get the user object
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
// get global action permissions // get global action permissions
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD### $this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
/** /**

View File

@ -44,17 +44,17 @@ class ###Component###View###View### extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ###Component###Helper::getActions('###view###',$this->item); $this->canDo = ###Component###Helper::getActions('###view###',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -50,15 +50,15 @@ class ###Component###View###Views### extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO### $this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO###
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -153,7 +153,7 @@ class ###Component###View###Views### extends JViewLegacy
// add the options comp button // add the options comp button
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{ {
JToolBarHelper::preferences('com_###component###'); JToolBarHelper::preferences('com_###component###');
} }
if ($this->canState) if ($this->canState)

View File

@ -41,13 +41,13 @@ class ###Component###View###SViews### extends JViewLegacy
function display($tpl = null) function display($tpl = null)
{ {
// get component params // get component params
$this->params = JComponentHelper::getParams('com_###component###'); $this->params = JComponentHelper::getParams('com_###component###');
// get the application // get the application
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
// get the user object // get the user object
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
// get global action permissions // get global action permissions
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD### $this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
/** /**

View File

@ -2897,17 +2897,17 @@ class Interpretation extends Fields
{ {
// for single views // for single views
$method .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Initialise variables."; $method .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Initialise variables.";
$method .= PHP_EOL . "\t\t\$this->item\t= \$this->get('Item');"; $method .= PHP_EOL . "\t\t\$this->item = \$this->get('Item');";
} }
elseif ($view['settings']->main_get->gettype == 2) elseif ($view['settings']->main_get->gettype == 2)
{ {
// for list views // for list views
$method .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Initialise variables."; $method .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Initialise variables.";
$method .= PHP_EOL . "\t\t\$this->items\t= \$this->get('Items');"; $method .= PHP_EOL . "\t\t\$this->items = \$this->get('Items');";
// only add if pagination is requered // only add if pagination is requered
if ($view['settings']->main_get->pagination == 1) if ($view['settings']->main_get->pagination == 1)
{ {
$method .= PHP_EOL . "\t\t\$this->pagination\t= \$this->get('Pagination');"; $method .= PHP_EOL . "\t\t\$this->pagination = \$this->get('Pagination');";
} }
// add id to list view // add id to list view
if (isset($this->customAdminViewListId[$view['settings']->code])) if (isset($this->customAdminViewListId[$view['settings']->code]))
@ -2927,7 +2927,7 @@ class Interpretation extends Fields
foreach ($view['settings']->custom_get as $custom_get) foreach ($view['settings']->custom_get as $custom_get)
{ {
$custom_get_name = str_replace('get', '', $custom_get->getcustom); $custom_get_name = str_replace('get', '', $custom_get->getcustom);
$method .= PHP_EOL . "\t\t\$this->" . ComponentbuilderHelper::safeString($custom_get_name) . "\t= \$this->get('" . $custom_get_name . "');"; $method .= PHP_EOL . "\t\t\$this->" . ComponentbuilderHelper::safeString($custom_get_name) . " = \$this->get('" . $custom_get_name . "');";
} }
} }
// add custom script // add custom script
@ -7111,7 +7111,7 @@ class Interpretation extends Fields
} }
$this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName]['###LAYOUTITEMSHEADER###'] = $headerscript; $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName]['###LAYOUTITEMSHEADER###'] = $headerscript;
// ###LINKEDVIEWITEMS### <<<DYNAMIC>>> // ###LINKEDVIEWITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###LINKEDVIEWITEMS###'] .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get Linked view data" . PHP_EOL . "\t\t\$this->" . $codeName . "\t\t= \$this->get('" . $functionName . "');"; $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWITEMS###'] .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get Linked view data" . PHP_EOL . "\t\t\$this->" . $codeName . " = \$this->get('" . $functionName . "');";
// ###LINKEDVIEWTABLESCRIPTS### <<<DYNAMIC>>> // ###LINKEDVIEWTABLESCRIPTS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###LINKEDVIEWTABLESCRIPTS###'] = $this->setFootableScripts(); $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWTABLESCRIPTS###'] = $this->setFootableScripts();
if (strpos($parentKey, '-R>') !== false || strpos($parentKey, '-A>') !== false) if (strpos($parentKey, '-R>') !== false || strpos($parentKey, '-A>') !== false)
@ -10898,47 +10898,47 @@ class Interpretation extends Fields
// check if the item has permissions for edit. // check if the item has permissions for edit.
if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']]))
{ {
$allow[] = PHP_EOL . "\t\t\$this->canEdit\t\t= \$this->canDo->get('" . $core['core.edit'] . "');"; $allow[] = PHP_EOL . "\t\t\$this->canEdit = \$this->canDo->get('" . $core['core.edit'] . "');";
} }
else else
{ {
$allow[] = PHP_EOL . "\t\t\$this->canEdit\t\t= \$this->canDo->get('core.edit');"; $allow[] = PHP_EOL . "\t\t\$this->canEdit = \$this->canDo->get('core.edit');";
} }
// check if the item has permissions for edit state. // check if the item has permissions for edit state.
if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']]))
{ {
$allow[] = "\t\t\$this->canState\t\t= \$this->canDo->get('" . $core['core.edit.state'] . "');"; $allow[] = "\t\t\$this->canState = \$this->canDo->get('" . $core['core.edit.state'] . "');";
} }
else else
{ {
$allow[] = "\t\t\$this->canState\t\t= \$this->canDo->get('core.edit.state');"; $allow[] = "\t\t\$this->canState = \$this->canDo->get('core.edit.state');";
} }
// check if the item has permissions for create. // check if the item has permissions for create.
if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']]))
{ {
$allow[] = "\t\t\$this->canCreate\t= \$this->canDo->get('" . $core['core.create'] . "');"; $allow[] = "\t\t\$this->canCreate = \$this->canDo->get('" . $core['core.create'] . "');";
} }
else else
{ {
$allow[] = "\t\t\$this->canCreate\t= \$this->canDo->get('core.create');"; $allow[] = "\t\t\$this->canCreate = \$this->canDo->get('core.create');";
} }
// check if the item has permissions for delete. // check if the item has permissions for delete.
if ($coreLoad && isset($core['core.delete']) && isset($this->permissionBuilder['global'][$core['core.delete']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.delete']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.delete']])) if ($coreLoad && isset($core['core.delete']) && isset($this->permissionBuilder['global'][$core['core.delete']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.delete']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.delete']]))
{ {
$allow[] = "\t\t\$this->canDelete\t= \$this->canDo->get('" . $core['core.delete'] . "');"; $allow[] = "\t\t\$this->canDelete = \$this->canDo->get('" . $core['core.delete'] . "');";
} }
else else
{ {
$allow[] = "\t\t\$this->canDelete\t= \$this->canDo->get('core.delete');"; $allow[] = "\t\t\$this->canDelete = \$this->canDo->get('core.delete');";
} }
// check if the item has permissions for batch. // check if the item has permissions for batch.
if ($coreLoad && isset($core['core.batch']) && isset($this->permissionBuilder['global']['global'][$core['core.batch']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global']['global'][$core['core.batch']]) && in_array($viewName_single, $this->permissionBuilder['global']['global'][$core['core.delete']])) if ($coreLoad && isset($core['core.batch']) && isset($this->permissionBuilder['global']['global'][$core['core.batch']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global']['global'][$core['core.batch']]) && in_array($viewName_single, $this->permissionBuilder['global']['global'][$core['core.delete']]))
{ {
$allow[] = "\t\t\$this->canBatch\t= (\$this->canDo->get('" . $core['core.batch'] . "') && \$this->canDo->get('core.batch'));"; $allow[] = "\t\t\$this->canBatch = (\$this->canDo->get('" . $core['core.batch'] . "') && \$this->canDo->get('core.batch'));";
} }
else else
{ {
$allow[] = "\t\t\$this->canBatch\t= \$this->canDo->get('core.batch');"; $allow[] = "\t\t\$this->canBatch = \$this->canDo->get('core.batch');";
} }
return implode(PHP_EOL, $allow); return implode(PHP_EOL, $allow);

View File

@ -1842,10 +1842,10 @@ abstract class ComponentbuilderHelper
/** /**
* Load the Component xml manifest. * Load the Component xml manifest.
**/ **/
public static function manifest() public static function manifest()
{ {
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_componentbuilder/componentbuilder.xml"; $manifestUrl = JPATH_ADMINISTRATOR."/components/com_componentbuilder/componentbuilder.xml";
return simplexml_load_file($manifestUrl); return simplexml_load_file($manifestUrl);
} }
/** /**
@ -1860,22 +1860,22 @@ abstract class ComponentbuilderHelper
// get all Contributors (max 20) // get all Contributors (max 20)
$searchArray = range('0','20'); $searchArray = range('0','20');
foreach($searchArray as $nr) foreach($searchArray as $nr)
{ {
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3)) if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3))
{ {
// set link based of selected option // set link based of selected option
if($params->get("useContributor".$nr) == 1) if($params->get("useContributor".$nr) == 1)
{ {
$link_front = '<a href="mailto:'.$params->get("emailContributor".$nr).'" target="_blank">'; $link_front = '<a href="mailto:'.$params->get("emailContributor".$nr).'" target="_blank">';
$link_back = '</a>'; $link_back = '</a>';
} }
elseif($params->get("useContributor".$nr) == 2) elseif($params->get("useContributor".$nr) == 2)
{ {
$link_front = '<a href="'.$params->get("linkContributor".$nr).'" target="_blank">'; $link_front = '<a href="'.$params->get("linkContributor".$nr).'" target="_blank">';
$link_back = '</a>'; $link_back = '</a>';
} }
else else
{ {
$link_front = ''; $link_front = '';
$link_back = ''; $link_back = '';
} }
@ -1963,10 +1963,10 @@ abstract class ComponentbuilderHelper
**/ **/
public static function addSubmenu($submenu) public static function addSubmenu($submenu)
{ {
// load user for access menus // load user for access menus
$user = JFactory::getUser(); $user = JFactory::getUser();
// load the submenus to sidebar // load the submenus to sidebar
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_DASHBOARD'), 'index.php?option=com_componentbuilder&view=componentbuilder', $submenu === 'componentbuilder'); JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_DASHBOARD'), 'index.php?option=com_componentbuilder&view=componentbuilder', $submenu === 'componentbuilder');
// Access control (compiler.submenu). // Access control (compiler.submenu).
if ($user->authorise('compiler.submenu', 'com_componentbuilder')) if ($user->authorise('compiler.submenu', 'com_componentbuilder'))
{ {
@ -2410,9 +2410,9 @@ abstract class ComponentbuilderHelper
public static function jsonToString($value, $sperator = ", ", $table = null) public static function jsonToString($value, $sperator = ", ", $table = null)
{ {
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) if (json_last_error() === JSON_ERROR_NONE)
{ {
// is JSON // is JSON
if (self::checkArray($result)) if (self::checkArray($result))
@ -2434,15 +2434,15 @@ abstract class ComponentbuilderHelper
} }
return (string) implode($sperator,$result); return (string) implode($sperator,$result);
} }
return (string) json_decode($value); return (string) json_decode($value);
} }
return $value; return $value;
} }
public static function isPublished($id,$type) public static function isPublished($id,$type)
{ {
if ($type == 'raw') if ($type == 'raw')
{ {
$type = 'item'; $type = 'item';
} }
$db = JFactory::getDbo(); $db = JFactory::getDbo();
@ -2455,7 +2455,7 @@ abstract class ComponentbuilderHelper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return true; return true;
} }
return false; return false;
@ -2472,33 +2472,33 @@ abstract class ComponentbuilderHelper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return $db->loadResult(); return $db->loadResult();
} }
return $id; return $id;
} }
/** /**
* Get the actions permissions * Get the actions permissions
**/ **/
public static function getActions($view,&$record = null,$views = null) public static function getActions($view,&$record = null,$views = null)
{ {
jimport('joomla.access.access'); jimport('joomla.access.access');
$user = JFactory::getUser(); $user = JFactory::getUser();
$result = new JObject; $result = new JObject;
$view = self::safeString($view); $view = self::safeString($view);
if (self::checkString($views)) if (self::checkString($views))
{ {
$views = self::safeString($views); $views = self::safeString($views);
} }
// get all actions from component // get all actions from component
$actions = JAccess::getActions('com_componentbuilder', 'component'); $actions = JAccess::getActions('com_componentbuilder', 'component');
// set acctions only set in component settiongs // set acctions only set in component settiongs
$componentActions = array('core.admin','core.manage','core.options','core.export'); $componentActions = array('core.admin','core.manage','core.options','core.export');
// loop the actions and set the permissions // loop the actions and set the permissions
foreach ($actions as $action) foreach ($actions as $action)
{ {
// set to use component default // set to use component default
$fallback= true; $fallback= true;
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions)) if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
@ -2577,17 +2577,17 @@ abstract class ComponentbuilderHelper
} }
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
{ {
// make sure we use the core. action check for the categories // make sure we use the core. action check for the categories
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) { if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
$coreCheck = explode('.',$action->name); $coreCheck = explode('.',$action->name);
$coreCheck[0] = 'core'; $coreCheck[0] = 'core';
$categoryCheck = implode('.',$coreCheck); $categoryCheck = implode('.',$coreCheck);
} }
else else
{ {
$categoryCheck = $action->name; $categoryCheck = $action->name;
} }
// The record has a category. Check the category permissions. // The record has a category. Check the category permissions.
$catpermission = $user->authorise($categoryCheck, 'com_componentbuilder.'.$views.'.category.' . (int) $record->catid); $catpermission = $user->authorise($categoryCheck, 'com_componentbuilder.'.$views.'.category.' . (int) $record->catid);
if (!$catpermission && !is_null($catpermission)) if (!$catpermission && !is_null($catpermission))
{ {
@ -2968,8 +2968,8 @@ abstract class ComponentbuilderHelper
$string = self::replaceNumbers($string); $string = self::replaceNumbers($string);
} }
// 0nly continue if we have a string // 0nly continue if we have a string
if (self::checkString($string)) if (self::checkString($string))
{ {
// create file name without the extention that is safe // create file name without the extention that is safe
if ($type === 'filename') if ($type === 'filename')
{ {
@ -2992,12 +2992,12 @@ abstract class ComponentbuilderHelper
$string = preg_replace("/[^A-Za-z ]/", '', $string); $string = preg_replace("/[^A-Za-z ]/", '', $string);
// select final adaptations // select final adaptations
if ($type === 'L' || $type === 'strtolower') if ($type === 'L' || $type === 'strtolower')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower // default is to return lower
return strtolower($string); return strtolower($string);
} }
elseif ($type === 'W') elseif ($type === 'W')
{ {
// return a string with all first letter of each word uppercase(no undersocre) // return a string with all first letter of each word uppercase(no undersocre)
@ -3018,21 +3018,21 @@ abstract class ComponentbuilderHelper
// return a string with all the uppercase(no undersocre) // return a string with all the uppercase(no undersocre)
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'U' || $type === 'strtoupper') elseif ($type === 'U' || $type === 'strtoupper')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return all upper // return all upper
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'F' || $type === 'ucfirst') elseif ($type === 'F' || $type === 'ucfirst')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper // return with first caracter to upper
return ucfirst(strtolower($string)); return ucfirst(strtolower($string));
} }
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase') elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{ {
// convert all words to first letter uppercase // convert all words to first letter uppercase
$string = ucwords(strtolower($string)); $string = ucwords(strtolower($string));
@ -3041,14 +3041,14 @@ abstract class ComponentbuilderHelper
// now return first letter lowercase // now return first letter lowercase
return lcfirst($string); return lcfirst($string);
} }
// return string // return string
return $string; return $string;
} }
// not a string // not a string
return ''; return '';
} }
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
{ {
if (self::checkString($var)) if (self::checkString($var))
{ {
@ -3059,11 +3059,11 @@ abstract class ComponentbuilderHelper
return self::shorten($string,$length); return self::shorten($string,$length);
} }
return $string; return $string;
} }
else else
{ {
return ''; return '';
} }
} }
public static function replaceNumbers($string) public static function replaceNumbers($string)

View File

@ -188,7 +188,6 @@ abstract class ComponentbuilderEmail
// load the bounce email as sender if set // load the bounce email as sender if set
if (!is_null($bounce_email)) if (!is_null($bounce_email))
{ {
$mail->Sender = $bounce_email; $mail->Sender = $bounce_email;
} }

View File

@ -56,15 +56,15 @@ class ComponentbuilderModelCompiler extends JModelList
protected function getListQuery() protected function getListQuery()
{ {
// Get the current user for authorisation checks // Get the current user for authorisation checks
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest'); $this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups'); $this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
$this->initSet = true; $this->initSet = true;
// Make sure all records load, since no pagination allowed. // Make sure all records load, since no pagination allowed.
$this->setState('list.limit', 0); $this->setState('list.limit', 0);
// Get a db connection. // Get a db connection.

View File

@ -37,11 +37,11 @@ class ComponentbuilderModelComponentbuilder extends JModelList
{ {
public function getIcons() public function getIcons()
{ {
// load user for access menus // load user for access menus
$user = JFactory::getUser(); $user = JFactory::getUser();
// reset icon array // reset icon array
$icons = array(); $icons = array();
// view groups array // view groups array
$viewGroups = array( $viewGroups = array(
'main' => array('png.compiler', 'png.joomla_component.add', 'png.joomla_components', 'png.admin_view.add', 'png.admin_views', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.libraries', 'png.snippet.add', 'png.snippets', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtype.add', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.language_translations', 'png.ftps', 'png.help_document.add', 'png.help_documents') 'main' => array('png.compiler', 'png.joomla_component.add', 'png.joomla_components', 'png.admin_view.add', 'png.admin_views', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.libraries', 'png.snippet.add', 'png.snippets', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtype.add', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.language_translations', 'png.ftps', 'png.help_document.add', 'png.help_documents')
); );
@ -177,92 +177,92 @@ class ComponentbuilderModelComponentbuilder extends JModelList
'libraries_files_folders_urls.access' => 'library_files_folders_urls.access', 'libraries_files_folders_urls.access' => 'library_files_folders_urls.access',
'library_files_folders_urls.access' => 'library_files_folders_urls.access'); 'library_files_folders_urls.access' => 'library_files_folders_urls.access');
foreach($viewGroups as $group => $views) foreach($viewGroups as $group => $views)
{ {
$i = 0; $i = 0;
if (ComponentbuilderHelper::checkArray($views)) if (ComponentbuilderHelper::checkArray($views))
{ {
foreach($views as $view) foreach($views as $view)
{ {
$add = false; $add = false;
if (strpos($view,'.') !== false) if (strpos($view,'.') !== false)
{ {
$dwd = explode('.', $view); $dwd = explode('.', $view);
if (count($dwd) == 3) if (count($dwd) == 3)
{ {
list($type, $name, $action) = $dwd; list($type, $name, $action) = $dwd;
} }
elseif (count($dwd) == 2) elseif (count($dwd) == 2)
{ {
list($type, $name) = $dwd; list($type, $name) = $dwd;
$action = false; $action = false;
} }
if ($action) if ($action)
{ {
$viewName = $name; $viewName = $name;
switch($action) switch($action)
{ {
case 'add': case 'add':
$url ='index.php?option=com_componentbuilder&view='.$name.'&layout=edit'; $url ='index.php?option=com_componentbuilder&view='.$name.'&layout=edit';
$image = $name.'_'.$action.'.'.$type; $image = $name.'_'.$action.'.'.$type;
$alt = $name.'&nbsp;'.$action; $alt = $name.'&nbsp;'.$action;
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_ADD'; $name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_ADD';
$add = true; $add = true;
break; break;
default: default:
$url = 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.'.$name; $url = 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.'.$name;
$image = $name.'_'.$action.'.'.$type; $image = $name.'_'.$action.'.'.$type;
$alt = $name.'&nbsp;'.$action; $alt = $name.'&nbsp;'.$action;
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_'.ComponentbuilderHelper::safeString($action,'U'); $name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_'.ComponentbuilderHelper::safeString($action,'U');
break; break;
} }
} }
else else
{ {
$viewName = $name; $viewName = $name;
$alt = $name; $alt = $name;
$url = 'index.php?option=com_componentbuilder&view='.$name; $url = 'index.php?option=com_componentbuilder&view='.$name;
$image = $name.'.'.$type; $image = $name.'.'.$type;
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U'); $name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U');
$hover = false; $hover = false;
} }
} }
else else
{ {
$viewName = $view; $viewName = $view;
$alt = $view; $alt = $view;
$url = 'index.php?option=com_componentbuilder&view='.$view; $url = 'index.php?option=com_componentbuilder&view='.$view;
$image = $view.'.png'; $image = $view.'.png';
$name = ucwords($view).'<br /><br />'; $name = ucwords($view).'<br /><br />';
$hover = false; $hover = false;
} }
// first make sure the view access is set // first make sure the view access is set
if (ComponentbuilderHelper::checkArray($viewAccess)) if (ComponentbuilderHelper::checkArray($viewAccess))
{ {
// setup some defaults // setup some defaults
$dashboard_add = false; $dashboard_add = false;
$dashboard_list = false; $dashboard_list = false;
$accessTo = ''; $accessTo = '';
$accessAdd = ''; $accessAdd = '';
// acces checking start // acces checking start
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.create']):false; $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.create']):false;
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.access']):false; $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.access']):false;
// set main controllers // set main controllers
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.dashboard_add']):false; $accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.dashboard_list']):false; $accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.dashboard_list']):false;
// check for adding access // check for adding access
if ($add && $accessCreate) if ($add && $accessCreate)
{ {
$accessAdd = $viewAccess[$viewName.'.create']; $accessAdd = $viewAccess[$viewName.'.create'];
} }
elseif ($add) elseif ($add)
{ {
$accessAdd = 'core.create'; $accessAdd = 'core.create';
} }
// check if acces to view is set // check if acces to view is set
if ($accessAccess) if ($accessAccess)
{ {
$accessTo = $viewAccess[$viewName.'.access']; $accessTo = $viewAccess[$viewName.'.access'];
} }
// set main access controllers // set main access controllers
if ($accessDashboard_add) if ($accessDashboard_add)
{ {
@ -272,65 +272,65 @@ class ComponentbuilderModelComponentbuilder extends JModelList
{ {
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_componentbuilder'); $dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_componentbuilder');
} }
if (ComponentbuilderHelper::checkString($accessAdd) && ComponentbuilderHelper::checkString($accessTo)) if (ComponentbuilderHelper::checkString($accessAdd) && ComponentbuilderHelper::checkString($accessTo))
{ {
// check access // check access
if($user->authorise($accessAdd, 'com_componentbuilder') && $user->authorise($accessTo, 'com_componentbuilder') && $dashboard_add) if($user->authorise($accessAdd, 'com_componentbuilder') && $user->authorise($accessTo, 'com_componentbuilder') && $dashboard_add)
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
elseif (ComponentbuilderHelper::checkString($accessTo)) elseif (ComponentbuilderHelper::checkString($accessTo))
{ {
// check access // check access
if($user->authorise($accessTo, 'com_componentbuilder') && $dashboard_list) if($user->authorise($accessTo, 'com_componentbuilder') && $dashboard_list)
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
elseif (ComponentbuilderHelper::checkString($accessAdd)) elseif (ComponentbuilderHelper::checkString($accessAdd))
{ {
// check access // check access
if($user->authorise($accessAdd, 'com_componentbuilder') && $dashboard_add) if($user->authorise($accessAdd, 'com_componentbuilder') && $dashboard_add)
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
else else
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
} }
else else
{ {
$icons[$group][$i] = new StdClass; $icons[$group][$i] = new StdClass;
$icons[$group][$i]->url = $url; $icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name; $icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image; $icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt; $icons[$group][$i]->alt = $alt;
} }
$i++; $i++;
} }
} }
else else
{ {
$icons[$group][$i] = false; $icons[$group][$i] = false;
} }
} }
return $icons; return $icons;

View File

@ -56,15 +56,15 @@ class ComponentbuilderModelGet_snippets extends JModelList
protected function getListQuery() protected function getListQuery()
{ {
// Get the current user for authorisation checks // Get the current user for authorisation checks
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest'); $this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups'); $this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
$this->initSet = true; $this->initSet = true;
// Make sure all records load, since no pagination allowed. // Make sure all records load, since no pagination allowed.
$this->setState('list.limit', 0); $this->setState('list.limit', 0);
// Get a db connection. // Get a db connection.

View File

@ -89,10 +89,10 @@ class ComponentbuilderModelImport extends JModelLegacy
public function import() public function import()
{ {
$this->setState('action', 'import'); $this->setState('action', 'import');
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$session = JFactory::getSession(); $session = JFactory::getSession();
$package = null; $package = null;
$continue = false; $continue = false;
// get import type // get import type
$this->getType = $app->input->getString('gettype', NULL); $this->getType = $app->input->getString('gettype', NULL);
// get import type // get import type
@ -147,7 +147,7 @@ class ComponentbuilderModelImport extends JModelLegacy
// first link data to table headers // first link data to table headers
if(!$continue){ if(!$continue){
$package = json_encode($package); $package = json_encode($package);
$session->set('package', $package); $session->set('package', $package);
$session->set('dataType', $this->dataType); $session->set('dataType', $this->dataType);
$session->set('hasPackage', true); $session->set('hasPackage', true);
@ -199,8 +199,8 @@ class ComponentbuilderModelImport extends JModelLegacy
protected function _getPackageFromUpload() protected function _getPackageFromUpload()
{ {
// Get the uploaded file information // Get the uploaded file information
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw'); $userfile = $input->files->get('import_package', null, 'raw');
@ -227,9 +227,9 @@ class ComponentbuilderModelImport extends JModelLegacy
} }
// Build the appropriate paths // Build the appropriate paths
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
$tmp_src = $userfile['tmp_name']; $tmp_src = $userfile['tmp_name'];
// Move uploaded file // Move uploaded file
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
@ -260,8 +260,8 @@ class ComponentbuilderModelImport extends JModelLegacy
*/ */
protected function _getPackageFromFolder() protected function _getPackageFromFolder()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the path to the package to import // Get the path to the package to import
$p_dir = $input->getString('import_directory'); $p_dir = $input->getString('import_directory');
@ -291,8 +291,8 @@ class ComponentbuilderModelImport extends JModelLegacy
} }
$package['packagename'] = null; $package['packagename'] = null;
$package['dir'] = $p_dir; $package['dir'] = $p_dir;
$package['type'] = $type; $package['type'] = $type;
return $package; return $package;
} }
@ -305,8 +305,8 @@ class ComponentbuilderModelImport extends JModelLegacy
*/ */
protected function _getPackageFromUrl() protected function _getPackageFromUrl()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the URL of the package to import // Get the URL of the package to import
$url = $input->getString('import_url'); $url = $input->getString('import_url');
@ -345,7 +345,7 @@ class ComponentbuilderModelImport extends JModelLegacy
*/ */
protected function check($archivename) protected function check($archivename)
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
// Clean the name // Clean the name
$archivename = JPath::clean($archivename); $archivename = JPath::clean($archivename);
@ -358,15 +358,15 @@ class ComponentbuilderModelImport extends JModelLegacy
return false; return false;
} }
$config = JFactory::getConfig(); $config = JFactory::getConfig();
// set Package Name // set Package Name
$check['packagename'] = $archivename; $check['packagename'] = $archivename;
// set directory // set directory
$check['dir'] = $config->get('tmp_path'). '/' .$archivename; $check['dir'] = $config->get('tmp_path'). '/' .$archivename;
// set type // set type
$check['type'] = $this->getType; $check['type'] = $this->getType;
return $check; return $check;
} }
@ -405,8 +405,8 @@ class ComponentbuilderModelImport extends JModelLegacy
{ {
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$package = $config->get('tmp_path'). '/' .$package; $package = $config->get('tmp_path'). '/' .$package;
// Is the package file a valid file? // Is the package file a valid file?
if (is_file($package)) if (is_file($package))
@ -469,11 +469,11 @@ class ComponentbuilderModelImport extends JModelLegacy
if(ComponentbuilderHelper::checkArray($data['array'])) if(ComponentbuilderHelper::checkArray($data['array']))
{ {
// get user object // get user object
$user = JFactory::getUser(); $user = JFactory::getUser();
// remove header if it has headers // remove header if it has headers
$id_key = $data['target_headers']['id']; $id_key = $data['target_headers']['id'];
$published_key = $data['target_headers']['published']; $published_key = $data['target_headers']['published'];
$ordering_key = $data['target_headers']['ordering']; $ordering_key = $data['target_headers']['ordering'];
// get the first array set // get the first array set
$firstSet = reset($data['array']); $firstSet = reset($data['array']);
@ -491,13 +491,13 @@ class ComponentbuilderModelImport extends JModelLegacy
// Get a db connection. // Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// set some defaults // set some defaults
$todayDate = JFactory::getDate()->toSql(); $todayDate = JFactory::getDate()->toSql();
// get global action permissions // get global action permissions
$canDo = ComponentbuilderHelper::getActions($table); $canDo = ComponentbuilderHelper::getActions($table);
$canEdit = $canDo->get('core.edit'); $canEdit = $canDo->get('core.edit');
$canState = $canDo->get('core.edit.state'); $canState = $canDo->get('core.edit.state');
$canCreate = $canDo->get('core.create'); $canCreate = $canDo->get('core.create');
$hasAlias = $this->getAliasesUsed($table); $hasAlias = $this->getAliasesUsed($table);
// prosses the data // prosses the data
foreach($data['array'] as $row) foreach($data['array'] as $row)
{ {
@ -519,11 +519,11 @@ class ComponentbuilderModelImport extends JModelLegacy
if($found && $canEdit) if($found && $canEdit)
{ {
// update item // update item
$id = $row[$id_key]; $id = $row[$id_key];
$version = $db->loadResult(); $version = $db->loadResult();
// reset all buckets // reset all buckets
$query = $db->getQuery(true); $query = $db->getQuery(true);
$fields = array(); $fields = array();
// Fields to update. // Fields to update.
foreach($row as $key => $cell) foreach($row as $key => $cell)
{ {
@ -568,8 +568,8 @@ class ComponentbuilderModelImport extends JModelLegacy
} }
} }
// load the defaults // load the defaults
$fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id); $fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id);
$fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate); $fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate);
// Conditions for which records should be updated. // Conditions for which records should be updated.
$conditions = array( $conditions = array(
$db->quoteName('id') . ' = ' . $id $db->quoteName('id') . ' = ' . $id
@ -584,9 +584,9 @@ class ComponentbuilderModelImport extends JModelLegacy
// insert item // insert item
$query = $db->getQuery(true); $query = $db->getQuery(true);
// reset all buckets // reset all buckets
$columns = array(); $columns = array();
$values = array(); $values = array();
$version = false; $version = false;
// Insert columns. Insert values. // Insert columns. Insert values.
foreach($row as $key => $cell) foreach($row as $key => $cell)
{ {
@ -624,30 +624,30 @@ class ComponentbuilderModelImport extends JModelLegacy
// set to insert array // set to insert array
if(in_array($key, $data['target_headers']) && is_numeric($cell)) if(in_array($key, $data['target_headers']) && is_numeric($cell))
{ {
$columns[] = $target[$key]; $columns[] = $target[$key];
$values[] = $cell; $values[] = $cell;
} }
elseif(in_array($key, $data['target_headers']) && is_string($cell)) elseif(in_array($key, $data['target_headers']) && is_string($cell))
{ {
$columns[] = $target[$key]; $columns[] = $target[$key];
$values[] = $db->quote($cell); $values[] = $db->quote($cell);
} }
elseif(in_array($key, $data['target_headers']) && is_null($cell)) elseif(in_array($key, $data['target_headers']) && is_null($cell))
{ {
// if import data is null then set empty // if import data is null then set empty
$columns[] = $target[$key]; $columns[] = $target[$key];
$values[] = "''"; $values[] = "''";
} }
} }
// load the defaults // load the defaults
$columns[] = 'created_by'; $columns[] = 'created_by';
$values[] = $db->quote($user->id); $values[] = $db->quote($user->id);
$columns[] = 'created'; $columns[] = 'created';
$values[] = $db->quote($todayDate); $values[] = $db->quote($todayDate);
if (!$version) if (!$version)
{ {
$columns[] = 'version'; $columns[] = 'version';
$values[] = 1; $values[] = 1;
} }
// Prepare the insert query. // Prepare the insert query.
$query $query

View File

@ -56,8 +56,8 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
/** /**
* Import Settings * Import Settings
*/ */
protected $getType = NULL; protected $getType = NULL;
protected $dataType = NULL; protected $dataType = NULL;
/** /**
* Method to auto-populate the model state. * Method to auto-populate the model state.
@ -280,8 +280,8 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
protected function _getPackageFromUpload() protected function _getPackageFromUpload()
{ {
// Get the uploaded file information // Get the uploaded file information
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw'); $userfile = $input->files->get('import_package', null, 'raw');
@ -308,9 +308,9 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
} }
// Build the appropriate paths // Build the appropriate paths
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
$tmp_src = $userfile['tmp_name']; $tmp_src = $userfile['tmp_name'];
// Move uploaded file // Move uploaded file
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
@ -341,8 +341,8 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
*/ */
protected function _getPackageFromFolder() protected function _getPackageFromFolder()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the path to the package to import // Get the path to the package to import
$p_dir = $input->getString('import_directory'); $p_dir = $input->getString('import_directory');
@ -372,8 +372,8 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
} }
$package['packagename'] = null; $package['packagename'] = null;
$package['dir'] = $p_dir; $package['dir'] = $p_dir;
$package['type'] = $type; $package['type'] = $type;
return $package; return $package;
} }
@ -386,8 +386,8 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
*/ */
protected function _getPackageFromUrl() protected function _getPackageFromUrl()
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
// Get the URL of the package to import // Get the URL of the package to import
$url = $input->getString('import_url'); $url = $input->getString('import_url');
@ -426,7 +426,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
*/ */
protected function check($archivename) protected function check($archivename)
{ {
$app = JFactory::getApplication(); $app = JFactory::getApplication();
// Clean the name // Clean the name
$archivename = JPath::clean($archivename); $archivename = JPath::clean($archivename);
@ -439,15 +439,15 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
return false; return false;
} }
$config = JFactory::getConfig(); $config = JFactory::getConfig();
// set Package Name // set Package Name
$check['packagename'] = $archivename; $check['packagename'] = $archivename;
// set directory // set directory
$check['dir'] = $config->get('tmp_path'). '/' .$archivename; $check['dir'] = $config->get('tmp_path'). '/' .$archivename;
// set type // set type
$check['type'] = $this->getType; $check['type'] = $this->getType;
return $check; return $check;
} }
@ -492,8 +492,8 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
{ {
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
$config = JFactory::getConfig(); $config = JFactory::getConfig();
$package = $config->get('tmp_path'). '/' .$package; $package = $config->get('tmp_path'). '/' .$package;
// Is the package file a valid file? // Is the package file a valid file?
if (is_file($package)) if (is_file($package))

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewAdmin_fields extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields',$this->item); $this->canDo = ComponentbuilderHelper::getActions('admin_fields',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewAdmin_fields_conditions extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions',$this->item); $this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewAdmin_view extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_view',$this->item); $this->canDo = ComponentbuilderHelper::getActions('admin_view',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_view'); $this->canDo = ComponentbuilderHelper::getActions('admin_view');
$this->canEdit = $this->canDo->get('admin_view.edit'); $this->canEdit = $this->canDo->get('admin_view.edit');
$this->canState = $this->canDo->get('admin_view.edit.state'); $this->canState = $this->canDo->get('admin_view.edit.state');
$this->canCreate = $this->canDo->get('admin_view.create'); $this->canCreate = $this->canDo->get('admin_view.create');
$this->canDelete = $this->canDo->get('admin_view.delete'); $this->canDelete = $this->canDo->get('admin_view.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -159,7 +159,7 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('admin_views'); $help_url = ComponentbuilderHelper::getHelpUrl('admin_views');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields'); $this->canDo = ComponentbuilderHelper::getActions('admin_fields');
$this->canEdit = $this->canDo->get('admin_fields.edit'); $this->canEdit = $this->canDo->get('admin_fields.edit');
$this->canState = $this->canDo->get('admin_fields.edit.state'); $this->canState = $this->canDo->get('admin_fields.edit.state');
$this->canCreate = $this->canDo->get('admin_fields.create'); $this->canCreate = $this->canDo->get('admin_fields.create');
$this->canDelete = $this->canDo->get('admin_fields.delete'); $this->canDelete = $this->canDo->get('admin_fields.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('admins_fields'); $help_url = ComponentbuilderHelper::getHelpUrl('admins_fields');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions'); $this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
$this->canEdit = $this->canDo->get('admin_fields_conditions.edit'); $this->canEdit = $this->canDo->get('admin_fields_conditions.edit');
$this->canState = $this->canDo->get('admin_fields_conditions.edit.state'); $this->canState = $this->canDo->get('admin_fields_conditions.edit.state');
$this->canCreate = $this->canDo->get('admin_fields_conditions.create'); $this->canCreate = $this->canDo->get('admin_fields_conditions.create');
$this->canDelete = $this->canDo->get('admin_fields_conditions.delete'); $this->canDelete = $this->canDo->get('admin_fields_conditions.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_conditions'); $help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_conditions');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -38,15 +38,15 @@ class ComponentbuilderViewCompiler extends JViewLegacy
function display($tpl = null) function display($tpl = null)
{ {
// get component params // get component params
$this->params = JComponentHelper::getParams('com_componentbuilder'); $this->params = JComponentHelper::getParams('com_componentbuilder');
// get the application // get the application
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
// get the user object // get the user object
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('compiler'); $this->canDo = ComponentbuilderHelper::getActions('compiler');
// Initialise variables. // Initialise variables.
$this->items = $this->get('Items'); $this->items = $this->get('Items');
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
{ {
// Include helper submenu // Include helper submenu

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewComponent_admin_views extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_admin_views',$this->item); $this->canDo = ComponentbuilderHelper::getActions('component_admin_views',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewComponent_config extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_config',$this->item); $this->canDo = ComponentbuilderHelper::getActions('component_config',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewComponent_custom_admin_menus extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus',$this->item); $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewComponent_custom_admin_views extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views',$this->item); $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewComponent_dashboard extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_dashboard',$this->item); $this->canDo = ComponentbuilderHelper::getActions('component_dashboard',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewComponent_files_folders extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_files_folders',$this->item); $this->canDo = ComponentbuilderHelper::getActions('component_files_folders',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewComponent_mysql_tweaks extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks',$this->item); $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewComponent_site_views extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_site_views',$this->item); $this->canDo = ComponentbuilderHelper::getActions('component_site_views',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewComponent_updates extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_updates',$this->item); $this->canDo = ComponentbuilderHelper::getActions('component_updates',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -75,15 +75,15 @@ class ComponentbuilderViewComponentbuilder extends JViewLegacy
$canDo = ComponentbuilderHelper::getActions('componentbuilder'); $canDo = ComponentbuilderHelper::getActions('componentbuilder');
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_DASHBOARD'), 'grid-2'); JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_DASHBOARD'), 'grid-2');
// set help url for this view if found // set help url for this view if found
$help_url = ComponentbuilderHelper::getHelpUrl('componentbuilder'); $help_url = ComponentbuilderHelper::getHelpUrl('componentbuilder');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
if ($canDo->get('core.admin') || $canDo->get('core.options')) if ($canDo->get('core.admin') || $canDo->get('core.options'))
{ {
JToolBarHelper::preferences('com_componentbuilder'); JToolBarHelper::preferences('com_componentbuilder');
} }
} }

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_admin_views'); $this->canDo = ComponentbuilderHelper::getActions('component_admin_views');
$this->canEdit = $this->canDo->get('component_admin_views.edit'); $this->canEdit = $this->canDo->get('component_admin_views.edit');
$this->canState = $this->canDo->get('component_admin_views.edit.state'); $this->canState = $this->canDo->get('component_admin_views.edit.state');
$this->canCreate = $this->canDo->get('component_admin_views.create'); $this->canCreate = $this->canDo->get('component_admin_views.create');
$this->canDelete = $this->canDo->get('component_admin_views.delete'); $this->canDelete = $this->canDo->get('component_admin_views.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('components_admin_views'); $help_url = ComponentbuilderHelper::getHelpUrl('components_admin_views');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewComponents_config extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_config'); $this->canDo = ComponentbuilderHelper::getActions('component_config');
$this->canEdit = $this->canDo->get('component_config.edit'); $this->canEdit = $this->canDo->get('component_config.edit');
$this->canState = $this->canDo->get('component_config.edit.state'); $this->canState = $this->canDo->get('component_config.edit.state');
$this->canCreate = $this->canDo->get('component_config.create'); $this->canCreate = $this->canDo->get('component_config.create');
$this->canDelete = $this->canDo->get('component_config.delete'); $this->canDelete = $this->canDo->get('component_config.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewComponents_config extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('components_config'); $help_url = ComponentbuilderHelper::getHelpUrl('components_config');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus'); $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus');
$this->canEdit = $this->canDo->get('component_custom_admin_menus.edit'); $this->canEdit = $this->canDo->get('component_custom_admin_menus.edit');
$this->canState = $this->canDo->get('component_custom_admin_menus.edit.state'); $this->canState = $this->canDo->get('component_custom_admin_menus.edit.state');
$this->canCreate = $this->canDo->get('component_custom_admin_menus.create'); $this->canCreate = $this->canDo->get('component_custom_admin_menus.create');
$this->canDelete = $this->canDo->get('component_custom_admin_menus.delete'); $this->canDelete = $this->canDo->get('component_custom_admin_menus.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_menus'); $help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_menus');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views'); $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views');
$this->canEdit = $this->canDo->get('component_custom_admin_views.edit'); $this->canEdit = $this->canDo->get('component_custom_admin_views.edit');
$this->canState = $this->canDo->get('component_custom_admin_views.edit.state'); $this->canState = $this->canDo->get('component_custom_admin_views.edit.state');
$this->canCreate = $this->canDo->get('component_custom_admin_views.create'); $this->canCreate = $this->canDo->get('component_custom_admin_views.create');
$this->canDelete = $this->canDo->get('component_custom_admin_views.delete'); $this->canDelete = $this->canDo->get('component_custom_admin_views.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_views'); $help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_views');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_dashboard'); $this->canDo = ComponentbuilderHelper::getActions('component_dashboard');
$this->canEdit = $this->canDo->get('component_dashboard.edit'); $this->canEdit = $this->canDo->get('component_dashboard.edit');
$this->canState = $this->canDo->get('component_dashboard.edit.state'); $this->canState = $this->canDo->get('component_dashboard.edit.state');
$this->canCreate = $this->canDo->get('component_dashboard.create'); $this->canCreate = $this->canDo->get('component_dashboard.create');
$this->canDelete = $this->canDo->get('component_dashboard.delete'); $this->canDelete = $this->canDo->get('component_dashboard.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('components_dashboard'); $help_url = ComponentbuilderHelper::getHelpUrl('components_dashboard');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_files_folders'); $this->canDo = ComponentbuilderHelper::getActions('component_files_folders');
$this->canEdit = $this->canDo->get('component_files_folders.edit'); $this->canEdit = $this->canDo->get('component_files_folders.edit');
$this->canState = $this->canDo->get('component_files_folders.edit.state'); $this->canState = $this->canDo->get('component_files_folders.edit.state');
$this->canCreate = $this->canDo->get('component_files_folders.create'); $this->canCreate = $this->canDo->get('component_files_folders.create');
$this->canDelete = $this->canDo->get('component_files_folders.delete'); $this->canDelete = $this->canDo->get('component_files_folders.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('components_files_folders'); $help_url = ComponentbuilderHelper::getHelpUrl('components_files_folders');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks'); $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks');
$this->canEdit = $this->canDo->get('component_mysql_tweaks.edit'); $this->canEdit = $this->canDo->get('component_mysql_tweaks.edit');
$this->canState = $this->canDo->get('component_mysql_tweaks.edit.state'); $this->canState = $this->canDo->get('component_mysql_tweaks.edit.state');
$this->canCreate = $this->canDo->get('component_mysql_tweaks.create'); $this->canCreate = $this->canDo->get('component_mysql_tweaks.create');
$this->canDelete = $this->canDo->get('component_mysql_tweaks.delete'); $this->canDelete = $this->canDo->get('component_mysql_tweaks.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('components_mysql_tweaks'); $help_url = ComponentbuilderHelper::getHelpUrl('components_mysql_tweaks');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_site_views'); $this->canDo = ComponentbuilderHelper::getActions('component_site_views');
$this->canEdit = $this->canDo->get('component_site_views.edit'); $this->canEdit = $this->canDo->get('component_site_views.edit');
$this->canState = $this->canDo->get('component_site_views.edit.state'); $this->canState = $this->canDo->get('component_site_views.edit.state');
$this->canCreate = $this->canDo->get('component_site_views.create'); $this->canCreate = $this->canDo->get('component_site_views.create');
$this->canDelete = $this->canDo->get('component_site_views.delete'); $this->canDelete = $this->canDo->get('component_site_views.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('components_site_views'); $help_url = ComponentbuilderHelper::getHelpUrl('components_site_views');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_updates'); $this->canDo = ComponentbuilderHelper::getActions('component_updates');
$this->canEdit = $this->canDo->get('component_updates.edit'); $this->canEdit = $this->canDo->get('component_updates.edit');
$this->canState = $this->canDo->get('component_updates.edit.state'); $this->canState = $this->canDo->get('component_updates.edit.state');
$this->canCreate = $this->canDo->get('component_updates.create'); $this->canCreate = $this->canDo->get('component_updates.create');
$this->canDelete = $this->canDo->get('component_updates.delete'); $this->canDelete = $this->canDo->get('component_updates.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('components_updates'); $help_url = ComponentbuilderHelper::getHelpUrl('components_updates');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewCustom_admin_view extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('custom_admin_view',$this->item); $this->canDo = ComponentbuilderHelper::getActions('custom_admin_view',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('custom_admin_view'); $this->canDo = ComponentbuilderHelper::getActions('custom_admin_view');
$this->canEdit = $this->canDo->get('core.edit'); $this->canEdit = $this->canDo->get('core.edit');
$this->canState = $this->canDo->get('core.edit.state'); $this->canState = $this->canDo->get('core.edit.state');
$this->canCreate = $this->canDo->get('core.create'); $this->canCreate = $this->canDo->get('core.create');
$this->canDelete = $this->canDo->get('core.delete'); $this->canDelete = $this->canDo->get('core.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -164,7 +164,7 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('custom_admin_views'); $help_url = ComponentbuilderHelper::getHelpUrl('custom_admin_views');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewCustom_code extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('custom_code',$this->item); $this->canDo = ComponentbuilderHelper::getActions('custom_code',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('custom_code'); $this->canDo = ComponentbuilderHelper::getActions('custom_code');
$this->canEdit = $this->canDo->get('custom_code.edit'); $this->canEdit = $this->canDo->get('custom_code.edit');
$this->canState = $this->canDo->get('custom_code.edit.state'); $this->canState = $this->canDo->get('custom_code.edit.state');
$this->canCreate = $this->canDo->get('custom_code.create'); $this->canCreate = $this->canDo->get('custom_code.create');
$this->canDelete = $this->canDo->get('custom_code.delete'); $this->canDelete = $this->canDo->get('custom_code.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -159,7 +159,7 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('custom_codes'); $help_url = ComponentbuilderHelper::getHelpUrl('custom_codes');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewDynamic_get extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('dynamic_get',$this->item); $this->canDo = ComponentbuilderHelper::getActions('dynamic_get',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewDynamic_gets extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('dynamic_get'); $this->canDo = ComponentbuilderHelper::getActions('dynamic_get');
$this->canEdit = $this->canDo->get('dynamic_get.edit'); $this->canEdit = $this->canDo->get('dynamic_get.edit');
$this->canState = $this->canDo->get('dynamic_get.edit.state'); $this->canState = $this->canDo->get('dynamic_get.edit.state');
$this->canCreate = $this->canDo->get('dynamic_get.create'); $this->canCreate = $this->canDo->get('dynamic_get.create');
$this->canDelete = $this->canDo->get('dynamic_get.delete'); $this->canDelete = $this->canDo->get('dynamic_get.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -159,7 +159,7 @@ class ComponentbuilderViewDynamic_gets extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('dynamic_gets'); $help_url = ComponentbuilderHelper::getHelpUrl('dynamic_gets');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewField extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('field',$this->item); $this->canDo = ComponentbuilderHelper::getActions('field',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewFields extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('field'); $this->canDo = ComponentbuilderHelper::getActions('field');
$this->canEdit = $this->canDo->get('field.edit'); $this->canEdit = $this->canDo->get('field.edit');
$this->canState = $this->canDo->get('field.edit.state'); $this->canState = $this->canDo->get('field.edit.state');
$this->canCreate = $this->canDo->get('field.create'); $this->canCreate = $this->canDo->get('field.create');
$this->canDelete = $this->canDo->get('field.delete'); $this->canDelete = $this->canDo->get('field.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -159,7 +159,7 @@ class ComponentbuilderViewFields extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('fields'); $help_url = ComponentbuilderHelper::getHelpUrl('fields');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewFieldtype extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('fieldtype',$this->item); $this->canDo = ComponentbuilderHelper::getActions('fieldtype',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item
@ -64,7 +64,7 @@ class ComponentbuilderViewFieldtype extends JViewLegacy
} }
// Get Linked view data // Get Linked view data
$this->vzyfields = $this->get('Vzyfields'); $this->vzyfields = $this->get('Vzyfields');
// Set the toolbar // Set the toolbar
$this->addToolBar(); $this->addToolBar();

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewFieldtypes extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('fieldtype'); $this->canDo = ComponentbuilderHelper::getActions('fieldtype');
$this->canEdit = $this->canDo->get('fieldtype.edit'); $this->canEdit = $this->canDo->get('fieldtype.edit');
$this->canState = $this->canDo->get('fieldtype.edit.state'); $this->canState = $this->canDo->get('fieldtype.edit.state');
$this->canCreate = $this->canDo->get('fieldtype.create'); $this->canCreate = $this->canDo->get('fieldtype.create');
$this->canDelete = $this->canDo->get('fieldtype.delete'); $this->canDelete = $this->canDo->get('fieldtype.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -159,7 +159,7 @@ class ComponentbuilderViewFieldtypes extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('fieldtypes'); $help_url = ComponentbuilderHelper::getHelpUrl('fieldtypes');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewFtp extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('ftp',$this->item); $this->canDo = ComponentbuilderHelper::getActions('ftp',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item
@ -64,7 +64,7 @@ class ComponentbuilderViewFtp extends JViewLegacy
} }
// Get Linked view data // Get Linked view data
$this->vzzlinked_components = $this->get('Vzzlinked_components'); $this->vzzlinked_components = $this->get('Vzzlinked_components');
// Set the toolbar // Set the toolbar
$this->addToolBar(); $this->addToolBar();

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewFtps extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('ftp'); $this->canDo = ComponentbuilderHelper::getActions('ftp');
$this->canEdit = $this->canDo->get('ftp.edit'); $this->canEdit = $this->canDo->get('ftp.edit');
$this->canState = $this->canDo->get('ftp.edit.state'); $this->canState = $this->canDo->get('ftp.edit.state');
$this->canCreate = $this->canDo->get('ftp.create'); $this->canCreate = $this->canDo->get('ftp.create');
$this->canDelete = $this->canDo->get('ftp.delete'); $this->canDelete = $this->canDo->get('ftp.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -159,7 +159,7 @@ class ComponentbuilderViewFtps extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('ftps'); $help_url = ComponentbuilderHelper::getHelpUrl('ftps');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -38,15 +38,15 @@ class ComponentbuilderViewGet_snippets extends JViewLegacy
function display($tpl = null) function display($tpl = null)
{ {
// get component params // get component params
$this->params = JComponentHelper::getParams('com_componentbuilder'); $this->params = JComponentHelper::getParams('com_componentbuilder');
// get the application // get the application
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
// get the user object // get the user object
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('get_snippets'); $this->canDo = ComponentbuilderHelper::getActions('get_snippets');
// Initialise variables. // Initialise variables.
$this->items = $this->get('Items'); $this->items = $this->get('Items');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewHelp_document extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('help_document',$this->item); $this->canDo = ComponentbuilderHelper::getActions('help_document',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('help_document'); $this->canDo = ComponentbuilderHelper::getActions('help_document');
$this->canEdit = $this->canDo->get('help_document.edit'); $this->canEdit = $this->canDo->get('help_document.edit');
$this->canState = $this->canDo->get('help_document.edit.state'); $this->canState = $this->canDo->get('help_document.edit.state');
$this->canCreate = $this->canDo->get('help_document.create'); $this->canCreate = $this->canDo->get('help_document.create');
$this->canDelete = $this->canDo->get('help_document.delete'); $this->canDelete = $this->canDo->get('help_document.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -159,7 +159,7 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('help_documents'); $help_url = ComponentbuilderHelper::getHelpUrl('help_documents');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewJoomla_component extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_component',$this->item); $this->canDo = ComponentbuilderHelper::getActions('joomla_component',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item
@ -64,7 +64,7 @@ class ComponentbuilderViewJoomla_component extends JViewLegacy
} }
// Get Linked view data // Get Linked view data
$this->vwmtranslation = $this->get('Vwmtranslation'); $this->vwmtranslation = $this->get('Vwmtranslation');
// Set the toolbar // Set the toolbar
$this->addToolBar(); $this->addToolBar();

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_component'); $this->canDo = ComponentbuilderHelper::getActions('joomla_component');
$this->canEdit = $this->canDo->get('joomla_component.edit'); $this->canEdit = $this->canDo->get('joomla_component.edit');
$this->canState = $this->canDo->get('joomla_component.edit.state'); $this->canState = $this->canDo->get('joomla_component.edit.state');
$this->canCreate = $this->canDo->get('joomla_component.create'); $this->canCreate = $this->canDo->get('joomla_component.create');
$this->canDelete = $this->canDo->get('joomla_component.delete'); $this->canDelete = $this->canDo->get('joomla_component.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -174,7 +174,7 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('joomla_components'); $help_url = ComponentbuilderHelper::getHelpUrl('joomla_components');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewLanguage extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('language',$this->item); $this->canDo = ComponentbuilderHelper::getActions('language',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewLanguage_translation extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('language_translation',$this->item); $this->canDo = ComponentbuilderHelper::getActions('language_translation',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewLanguage_translations extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('language_translation'); $this->canDo = ComponentbuilderHelper::getActions('language_translation');
$this->canEdit = $this->canDo->get('language_translation.edit'); $this->canEdit = $this->canDo->get('language_translation.edit');
$this->canState = $this->canDo->get('language_translation.edit.state'); $this->canState = $this->canDo->get('language_translation.edit.state');
$this->canCreate = $this->canDo->get('language_translation.create'); $this->canCreate = $this->canDo->get('language_translation.create');
$this->canDelete = $this->canDo->get('language_translation.delete'); $this->canDelete = $this->canDo->get('language_translation.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -159,7 +159,7 @@ class ComponentbuilderViewLanguage_translations extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('language_translations'); $help_url = ComponentbuilderHelper::getHelpUrl('language_translations');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewLanguages extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('language'); $this->canDo = ComponentbuilderHelper::getActions('language');
$this->canEdit = $this->canDo->get('language.edit'); $this->canEdit = $this->canDo->get('language.edit');
$this->canState = $this->canDo->get('language.edit.state'); $this->canState = $this->canDo->get('language.edit.state');
$this->canCreate = $this->canDo->get('language.create'); $this->canCreate = $this->canDo->get('language.create');
$this->canDelete = $this->canDo->get('language.delete'); $this->canDelete = $this->canDo->get('language.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -159,7 +159,7 @@ class ComponentbuilderViewLanguages extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('languages'); $help_url = ComponentbuilderHelper::getHelpUrl('languages');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewLayout extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('layout',$this->item); $this->canDo = ComponentbuilderHelper::getActions('layout',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewLayouts extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('layout'); $this->canDo = ComponentbuilderHelper::getActions('layout');
$this->canEdit = $this->canDo->get('core.edit'); $this->canEdit = $this->canDo->get('core.edit');
$this->canState = $this->canDo->get('core.edit.state'); $this->canState = $this->canDo->get('core.edit.state');
$this->canCreate = $this->canDo->get('core.create'); $this->canCreate = $this->canDo->get('core.create');
$this->canDelete = $this->canDo->get('core.delete'); $this->canDelete = $this->canDo->get('core.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -164,7 +164,7 @@ class ComponentbuilderViewLayouts extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('layouts'); $help_url = ComponentbuilderHelper::getHelpUrl('layouts');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewLibraries extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('library'); $this->canDo = ComponentbuilderHelper::getActions('library');
$this->canEdit = $this->canDo->get('library.edit'); $this->canEdit = $this->canDo->get('library.edit');
$this->canState = $this->canDo->get('library.edit.state'); $this->canState = $this->canDo->get('library.edit.state');
$this->canCreate = $this->canDo->get('library.create'); $this->canCreate = $this->canDo->get('library.create');
$this->canDelete = $this->canDo->get('library.delete'); $this->canDelete = $this->canDo->get('library.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -154,7 +154,7 @@ class ComponentbuilderViewLibraries extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('libraries'); $help_url = ComponentbuilderHelper::getHelpUrl('libraries');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewLibraries_config extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('library_config'); $this->canDo = ComponentbuilderHelper::getActions('library_config');
$this->canEdit = $this->canDo->get('library_config.edit'); $this->canEdit = $this->canDo->get('library_config.edit');
$this->canState = $this->canDo->get('library_config.edit.state'); $this->canState = $this->canDo->get('library_config.edit.state');
$this->canCreate = $this->canDo->get('library_config.create'); $this->canCreate = $this->canDo->get('library_config.create');
$this->canDelete = $this->canDo->get('library_config.delete'); $this->canDelete = $this->canDo->get('library_config.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewLibraries_config extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('libraries_config'); $help_url = ComponentbuilderHelper::getHelpUrl('libraries_config');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewLibraries_files_folders_urls extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls'); $this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls');
$this->canEdit = $this->canDo->get('library_files_folders_urls.edit'); $this->canEdit = $this->canDo->get('library_files_folders_urls.edit');
$this->canState = $this->canDo->get('library_files_folders_urls.edit.state'); $this->canState = $this->canDo->get('library_files_folders_urls.edit.state');
$this->canCreate = $this->canDo->get('library_files_folders_urls.create'); $this->canCreate = $this->canDo->get('library_files_folders_urls.create');
$this->canDelete = $this->canDo->get('library_files_folders_urls.delete'); $this->canDelete = $this->canDo->get('library_files_folders_urls.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewLibraries_files_folders_urls extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('libraries_files_folders_urls'); $help_url = ComponentbuilderHelper::getHelpUrl('libraries_files_folders_urls');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewLibrary extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('library',$this->item); $this->canDo = ComponentbuilderHelper::getActions('library',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewLibrary_config extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('library_config',$this->item); $this->canDo = ComponentbuilderHelper::getActions('library_config',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewLibrary_files_folders_urls extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls',$this->item); $this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewSite_view extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('site_view',$this->item); $this->canDo = ComponentbuilderHelper::getActions('site_view',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewSite_views extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('site_view'); $this->canDo = ComponentbuilderHelper::getActions('site_view');
$this->canEdit = $this->canDo->get('core.edit'); $this->canEdit = $this->canDo->get('core.edit');
$this->canState = $this->canDo->get('core.edit.state'); $this->canState = $this->canDo->get('core.edit.state');
$this->canCreate = $this->canDo->get('core.create'); $this->canCreate = $this->canDo->get('core.create');
$this->canDelete = $this->canDo->get('core.delete'); $this->canDelete = $this->canDo->get('core.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -164,7 +164,7 @@ class ComponentbuilderViewSite_views extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('site_views'); $help_url = ComponentbuilderHelper::getHelpUrl('site_views');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewSnippet extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('snippet',$this->item); $this->canDo = ComponentbuilderHelper::getActions('snippet',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewSnippet_type extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('snippet_type',$this->item); $this->canDo = ComponentbuilderHelper::getActions('snippet_type',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewSnippet_types extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('snippet_type'); $this->canDo = ComponentbuilderHelper::getActions('snippet_type');
$this->canEdit = $this->canDo->get('snippet_type.edit'); $this->canEdit = $this->canDo->get('snippet_type.edit');
$this->canState = $this->canDo->get('snippet_type.edit.state'); $this->canState = $this->canDo->get('snippet_type.edit.state');
$this->canCreate = $this->canDo->get('snippet_type.create'); $this->canCreate = $this->canDo->get('snippet_type.create');
$this->canDelete = $this->canDo->get('snippet_type.delete'); $this->canDelete = $this->canDo->get('snippet_type.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -149,7 +149,7 @@ class ComponentbuilderViewSnippet_types extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('snippet_types'); $help_url = ComponentbuilderHelper::getHelpUrl('snippet_types');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewSnippets extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('snippet'); $this->canDo = ComponentbuilderHelper::getActions('snippet');
$this->canEdit = $this->canDo->get('core.edit'); $this->canEdit = $this->canDo->get('core.edit');
$this->canState = $this->canDo->get('core.edit.state'); $this->canState = $this->canDo->get('core.edit.state');
$this->canCreate = $this->canDo->get('core.create'); $this->canCreate = $this->canDo->get('core.create');
$this->canDelete = $this->canDo->get('core.delete'); $this->canDelete = $this->canDo->get('core.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -169,7 +169,7 @@ class ComponentbuilderViewSnippets extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('snippets'); $help_url = ComponentbuilderHelper::getHelpUrl('snippets');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -41,17 +41,17 @@ class ComponentbuilderViewTemplate extends JViewLegacy
public function display($tpl = null) public function display($tpl = null)
{ {
// Assign the variables // Assign the variables
$this->form = $this->get('Form'); $this->form = $this->get('Form');
$this->item = $this->get('Item'); $this->item = $this->get('Item');
$this->script = $this->get('Script'); $this->script = $this->get('Script');
$this->state = $this->get('State'); $this->state = $this->get('State');
// get action permissions // get action permissions
$this->canDo = ComponentbuilderHelper::getActions('template',$this->item); $this->canDo = ComponentbuilderHelper::getActions('template',$this->item);
// get input // get input
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word'); $this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int'); $this->refid = $jinput->get('refid', 0, 'int');
$this->referral = ''; $this->referral = '';
if ($this->refid) if ($this->refid)
{ {
// return to the item that refered to this item // return to the item that refered to this item

View File

@ -47,20 +47,20 @@ class ComponentbuilderViewTemplates extends JViewLegacy
} }
// Assign data to the view // Assign data to the view
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->pagination = $this->get('Pagination'); $this->pagination = $this->get('Pagination');
$this->state = $this->get('State'); $this->state = $this->get('State');
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction')); $this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions // get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('template'); $this->canDo = ComponentbuilderHelper::getActions('template');
$this->canEdit = $this->canDo->get('core.edit'); $this->canEdit = $this->canDo->get('core.edit');
$this->canState = $this->canDo->get('core.edit.state'); $this->canState = $this->canDo->get('core.edit.state');
$this->canCreate = $this->canDo->get('core.create'); $this->canCreate = $this->canDo->get('core.create');
$this->canDelete = $this->canDo->get('core.delete'); $this->canDelete = $this->canDo->get('core.delete');
$this->canBatch = $this->canDo->get('core.batch'); $this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window. // We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') if ($this->getLayout() !== 'modal')
@ -164,7 +164,7 @@ class ComponentbuilderViewTemplates extends JViewLegacy
$help_url = ComponentbuilderHelper::getHelpUrl('templates'); $help_url = ComponentbuilderHelper::getHelpUrl('templates');
if (ComponentbuilderHelper::checkString($help_url)) if (ComponentbuilderHelper::checkString($help_url))
{ {
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
} }
// add the options comp button // add the options comp button

View File

@ -1629,9 +1629,9 @@ abstract class ComponentbuilderHelper
public static function jsonToString($value, $sperator = ", ", $table = null) public static function jsonToString($value, $sperator = ", ", $table = null)
{ {
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) if (json_last_error() === JSON_ERROR_NONE)
{ {
// is JSON // is JSON
if (self::checkArray($result)) if (self::checkArray($result))
@ -1661,10 +1661,10 @@ abstract class ComponentbuilderHelper
/** /**
* Load the Component xml manifest. * Load the Component xml manifest.
**/ **/
public static function manifest() public static function manifest()
{ {
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_componentbuilder/componentbuilder.xml"; $manifestUrl = JPATH_ADMINISTRATOR."/components/com_componentbuilder/componentbuilder.xml";
return simplexml_load_file($manifestUrl); return simplexml_load_file($manifestUrl);
} }
/** /**
@ -1679,9 +1679,9 @@ abstract class ComponentbuilderHelper
// get all Contributors (max 20) // get all Contributors (max 20)
$searchArray = range('0','20'); $searchArray = range('0','20');
foreach($searchArray as $nr) foreach($searchArray as $nr)
{ {
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 2 || $params->get("showContributor".$nr) == 3)) if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 2 || $params->get("showContributor".$nr) == 3))
{ {
// set link based of selected option // set link based of selected option
if($params->get("useContributor".$nr) == 1) if($params->get("useContributor".$nr) == 1)
{ {
@ -2134,7 +2134,7 @@ abstract class ComponentbuilderHelper
public static function isPublished($id,$type) public static function isPublished($id,$type)
{ {
if ($type == 'raw') if ($type == 'raw')
{ {
$type = 'item'; $type = 'item';
} }
$db = JFactory::getDbo(); $db = JFactory::getDbo();
@ -2147,7 +2147,7 @@ abstract class ComponentbuilderHelper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return true; return true;
} }
return false; return false;
@ -2164,7 +2164,7 @@ abstract class ComponentbuilderHelper
$db->execute(); $db->execute();
$found = $db->getNumRows(); $found = $db->getNumRows();
if($found) if($found)
{ {
return $db->loadResult(); return $db->loadResult();
} }
return $id; return $id;
@ -2173,24 +2173,24 @@ abstract class ComponentbuilderHelper
/** /**
* Get the actions permissions * Get the actions permissions
**/ **/
public static function getActions($view,&$record = null,$views = null) public static function getActions($view,&$record = null,$views = null)
{ {
jimport('joomla.access.access'); jimport('joomla.access.access');
$user = JFactory::getUser(); $user = JFactory::getUser();
$result = new JObject; $result = new JObject;
$view = self::safeString($view); $view = self::safeString($view);
if (self::checkString($views)) if (self::checkString($views))
{ {
$views = self::safeString($views); $views = self::safeString($views);
} }
// get all actions from component // get all actions from component
$actions = JAccess::getActions('com_componentbuilder', 'component'); $actions = JAccess::getActions('com_componentbuilder', 'component');
// set acctions only set in component settiongs // set acctions only set in component settiongs
$componentActions = array('core.admin','core.manage','core.options','core.export'); $componentActions = array('core.admin','core.manage','core.options','core.export');
// loop the actions and set the permissions // loop the actions and set the permissions
foreach ($actions as $action) foreach ($actions as $action)
{ {
// set to use component default // set to use component default
$fallback = true; $fallback = true;
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions)) if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
@ -2269,17 +2269,17 @@ abstract class ComponentbuilderHelper
} }
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
{ {
// make sure we use the core. action check for the categories // make sure we use the core. action check for the categories
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) { if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
$coreCheck = explode('.',$action->name); $coreCheck = explode('.',$action->name);
$coreCheck[0] = 'core'; $coreCheck[0] = 'core';
$categoryCheck = implode('.',$coreCheck); $categoryCheck = implode('.',$coreCheck);
} }
else else
{ {
$categoryCheck = $action->name; $categoryCheck = $action->name;
} }
// The record has a category. Check the category permissions. // The record has a category. Check the category permissions.
$catpermission = $user->authorise($categoryCheck, 'com_componentbuilder.'.$views.'.category.' . (int) $record->catid); $catpermission = $user->authorise($categoryCheck, 'com_componentbuilder.'.$views.'.category.' . (int) $record->catid);
if (!$catpermission && !is_null($catpermission)) if (!$catpermission && !is_null($catpermission))
{ {
@ -2421,7 +2421,7 @@ abstract class ComponentbuilderHelper
{ {
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
$connected = @fsockopen("www.example.com", 80); $connected = @fsockopen("www.example.com", 80);
// website, port (try 80 or 443) // website, port (try 80 or 443)
if ($connected) if ($connected)
{ {
//action when connected //action when connected
@ -2501,8 +2501,8 @@ abstract class ComponentbuilderHelper
$string = self::replaceNumbers($string); $string = self::replaceNumbers($string);
} }
// 0nly continue if we have a string // 0nly continue if we have a string
if (self::checkString($string)) if (self::checkString($string))
{ {
// create file name without the extention that is safe // create file name without the extention that is safe
if ($type === 'filename') if ($type === 'filename')
{ {
@ -2525,12 +2525,12 @@ abstract class ComponentbuilderHelper
$string = preg_replace("/[^A-Za-z ]/", '', $string); $string = preg_replace("/[^A-Za-z ]/", '', $string);
// select final adaptations // select final adaptations
if ($type === 'L' || $type === 'strtolower') if ($type === 'L' || $type === 'strtolower')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower // default is to return lower
return strtolower($string); return strtolower($string);
} }
elseif ($type === 'W') elseif ($type === 'W')
{ {
// return a string with all first letter of each word uppercase(no undersocre) // return a string with all first letter of each word uppercase(no undersocre)
@ -2551,21 +2551,21 @@ abstract class ComponentbuilderHelper
// return a string with all the uppercase(no undersocre) // return a string with all the uppercase(no undersocre)
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'U' || $type === 'strtoupper') elseif ($type === 'U' || $type === 'strtoupper')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return all upper // return all upper
return strtoupper($string); return strtoupper($string);
} }
elseif ($type === 'F' || $type === 'ucfirst') elseif ($type === 'F' || $type === 'ucfirst')
{ {
// replace white space with underscore // replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string); $string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper // return with first caracter to upper
return ucfirst(strtolower($string)); return ucfirst(strtolower($string));
} }
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase') elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{ {
// convert all words to first letter uppercase // convert all words to first letter uppercase
$string = ucwords(strtolower($string)); $string = ucwords(strtolower($string));
@ -2574,11 +2574,11 @@ abstract class ComponentbuilderHelper
// now return first letter lowercase // now return first letter lowercase
return lcfirst($string); return lcfirst($string);
} }
// return string // return string
return $string; return $string;
} }
// not a string // not a string
return ''; return '';
} }
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)

View File

@ -71,10 +71,10 @@ class ComponentbuilderModelApi extends JModelItem
*/ */
protected function populateState() protected function populateState()
{ {
$this->app = JFactory::getApplication(); $this->app = JFactory::getApplication();
$this->input = $this->app->input; $this->input = $this->app->input;
// Get the itme main id // Get the itme main id
$id = $this->input->getInt('id', null); $id = $this->input->getInt('id', null);
$this->setState('api.id', $id); $this->setState('api.id', $id);
// Load the parameters. // Load the parameters.
@ -92,13 +92,13 @@ class ComponentbuilderModelApi extends JModelItem
*/ */
public function getItem($pk = null) public function getItem($pk = null)
{ {
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->userId = $this->user->get('id'); $this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest'); $this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups'); $this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels(); $this->levels = $this->user->getAuthorisedViewLevels();
$this->initSet = true; $this->initSet = true;
$pk = (!empty($pk)) ? $pk : (int) $this->getState('api.id'); $pk = (!empty($pk)) ? $pk : (int) $this->getState('api.id');

View File

@ -44,7 +44,7 @@ class ComponentbuilderViewApi extends JViewLegacy
// get the user object // get the user object
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
// Initialise variables. // Initialise variables.
$this->item = $this->get('Item'); $this->item = $this->get('Item');
// Set the toolbar // Set the toolbar
$this->addToolBar(); $this->addToolBar();