Major code formate to try and set a standared. Added four new fields for JavaScript files

This commit is contained in:
2017-12-15 01:10:47 +02:00
parent c9cad158e6
commit d3cbea5c82
172 changed files with 14538 additions and 14358 deletions

View File

@@ -39,18 +39,18 @@ class ComponentbuilderController extends JControllerLegacy
*
* @return void
*/
function display($cachable = false, $urlparams = false)
function display($cachable = false, $urlparams = false)
{
// set default view if not set
$view = $this->input->getCmd('view', '');
$isEdit = $this->checkEditView($view);
$layout = $this->input->get('layout', null, 'WORD');
$id = $this->input->getInt('id');
$id = $this->input->getInt('id');
$cachable = true;
// Check for edit form.
if($isEdit)
{
if($isEdit)
{
if ($layout == 'edit' && !$this->checkEditId('com_componentbuilder.edit.'.$view, $id))
{
// Somehow the person just went to the form - we don't allow that.
@@ -67,7 +67,6 @@ class ComponentbuilderController extends JControllerLegacy
}
elseif (ComponentbuilderHelper::checkString($ref))
{
// redirect to ref
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref, false));
}
@@ -78,24 +77,24 @@ class ComponentbuilderController extends JControllerLegacy
}
return false;
}
}
}
return parent::display($cachable, $urlparams);
}
protected function checkEditView($view)
{
if (ComponentbuilderHelper::checkString($view))
{
$views = array(
if (ComponentbuilderHelper::checkString($view))
{
$views = array(
);
// check if this is a edit view
if (in_array($view,$views))
{
return true;
}
}
);
// check if this is a edit view
if (in_array($view,$views))
{
return true;
}
}
return false;
}
}

View File

@@ -48,7 +48,8 @@ class ComponentbuilderControllerHelp extends JControllerLegacy
// Check Token!
$token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM');
if($token == $call_token){
if($token == $call_token)
{
$task = $this->getTask();
switch($task){
case 'getText':
@@ -64,25 +65,25 @@ class ComponentbuilderControllerHelp extends JControllerLegacy
$result = '';
}
echo $result;
// stop execution gracefully
jexit();
// stop execution gracefully
jexit();
}
catch(Exception $e)
{
// stop execution gracefully
// stop execution gracefully
jexit();
}
break;
}
}
else
{
// stop execution gracefully
else
{
// stop execution gracefully
jexit();
}
}
protected function getHelpDocumentText($id)
protected function getHelpDocumentText($id)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);

View File

@@ -61,7 +61,7 @@ class ComponentbuilderViewApi extends JViewLegacy
parent::display($tpl);
}
/**
/**
* Prepares the document
*/
protected function _prepareDocument()
@@ -93,7 +93,7 @@ class ComponentbuilderViewApi extends JViewLegacy
}
// add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/components/com_componentbuilder/assets/css/api.css');
}
}
/**
* Setting the toolbar
@@ -102,7 +102,7 @@ class ComponentbuilderViewApi extends JViewLegacy
{
// adding the joomla toolbar to the front
JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php');
// set help url for this view if found
$help_url = ComponentbuilderHelper::getHelpUrl('api');
if (ComponentbuilderHelper::checkString($help_url))
@@ -113,7 +113,7 @@ class ComponentbuilderViewApi extends JViewLegacy
$this->toolbar = JToolbar::getInstance();
}
/**
/**
* Escapes a value for output in a view script.
*
* @param mixed $var The output to escape.
@@ -122,7 +122,7 @@ class ComponentbuilderViewApi extends JViewLegacy
*/
public function escape($var, $sorten = false, $length = 40)
{
// use the helper htmlEscape method instead.
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, $sorten, $length);
}
}