Skip to content

Commit

Permalink
Dev: PHPDoc; initialise aData array
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Dec 20, 2016
1 parent 3e9afbd commit 99ca6e1
Showing 1 changed file with 35 additions and 17 deletions.
52 changes: 35 additions & 17 deletions application/controllers/admin/tokens.php
Expand Up @@ -24,8 +24,10 @@ class tokens extends Survey_Common_Action
{

/**
* Show token index page, handle token database
*/
* Show token index page, handle token database
* @param int $iSurveyId
* @return void
*/
public function index($iSurveyId)
{
$this->registerScriptFile( 'ADMIN_SCRIPT_PATH', 'tokens.js');
Expand All @@ -35,7 +37,7 @@ public function index($iSurveyId)
if (!Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'read') && !Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'create') && !Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'update')
&& !Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'export') && !Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'import')
&& !Permission::model()->hasSurveyPermission($iSurveyId, 'surveysettings', 'update')
)
)
{
Yii::app()->session['flashmessage'] = gT("You do not have permission to access this page.");
$this->getController()->redirect(array("/admin/survey/sa/view/surveyid/{$iSurveyId}"));
Expand Down Expand Up @@ -67,10 +69,10 @@ public function index($iSurveyId)
}

/**
* tokens::bounceprocessing()
*
* @return void
*/
* tokens::bounceprocessing()
* @param int $iSurveyId
* @return void
*/
public function bounceprocessing($iSurveyId)
{
$iSurveyId = sanitize_int($iSurveyId);
Expand Down Expand Up @@ -265,6 +267,9 @@ public function bounceprocessing($iSurveyId)
}
}

/**
* @return boolean
*/
public function deleteMultiple()
{
// TODO: permission checks
Expand All @@ -273,6 +278,10 @@ public function deleteMultiple()
TokenDynamic::model($iSid)->deleteRecords($aTokenIds);
return true;
}

/**
* @return boolean
*/
public function deleteToken()
{
// TODO: permission checks
Expand All @@ -283,8 +292,8 @@ public function deleteToken()
}

/**
* Browse Tokens
*/
* Browse Tokens
*/
public function browse($iSurveyId, $limit = 50, $start = 0, $order = false, $searchstring = false)
{
$iSurveyId = sanitize_int($iSurveyId);
Expand Down Expand Up @@ -808,6 +817,7 @@ public function addDummies($iSurveyId, $subaction = '')


$surveyinfo = Survey::model()->findByPk($iSurveyId)->surveyinfo;
$aData = array();
$aData['sidemenu']['state'] = false;
$aData["surveyinfo"] = $surveyinfo;
$aData['title_bar']['title'] = $surveyinfo['surveyls_title']."(".gT("ID").":".$iSurveyId.")";
Expand Down Expand Up @@ -1062,6 +1072,7 @@ public function deletetokenattributes($iSurveyId)
$this->getController()->redirect($this->getController()->createUrl("/admin/survey/sa/view/surveyid/{$iSurveyId}"));
}

$aData = array();
$aData['thissurvey'] = getSurveyInfo($iSurveyId);
$aData['surveyid'] = $iSurveyId;
$confirm=Yii::app()->request->getPost('confirm','');
Expand Down Expand Up @@ -2306,6 +2317,7 @@ public function tokenify($iSurveyId)
{
self::_newtokentable($iSurveyId);
}
$aData = array();
$aData['thissurvey'] = getSurveyInfo($iSurveyId);
$aData['surveyid'] = $iSurveyId;

Expand Down Expand Up @@ -2372,6 +2384,7 @@ public function kill($iSurveyId)
{
self::_newtokentable($iSurveyId);
}
$aData = array();
$aData['thissurvey'] = getSurveyInfo($iSurveyId);
$aData['surveyid'] = $iSurveyId;

Expand Down Expand Up @@ -2551,8 +2564,10 @@ public function _handletokenform($iSurveyId, $subaction, $iTokenId="", $ajax=fal
}

/**
* Show dialogs and create a new tokens table
*/
* Show dialogs and create a new tokens table
* @param int $iSurveyId
* @return void
*/
public function _newtokentable($iSurveyId)
{
$aSurveyInfo = getSurveyInfo($iSurveyId);
Expand All @@ -2573,6 +2588,8 @@ public function _newtokentable($iSurveyId)
// The user have rigth to create token, then don't test right after
Yii::import('application.helpers.admin.token_helper', true);

$aData = array();

// Update table, must be CRSF controlled
if (Yii::app()->request->getPost('createtable') == "Y")
{
Expand Down Expand Up @@ -2663,12 +2680,13 @@ public function _newtokentable($iSurveyId)
}

/**
* Renders template(s) wrapped in header and footer
*
* @param string $sAction Current action, the folder to fetch views from
* @param string|array $aViewUrls View url(s)
* @param array $aData Data to be passed on. Optional.
*/
* Renders template(s) wrapped in header and footer
*
* @param string $sAction Current action, the folder to fetch views from
* @param string|array $aViewUrls View url(s)
* @param array $aData Data to be passed on. Optional.
* @return void
*/
protected function _renderWrappedTemplate($sAction = 'token', $aViewUrls = array(), $aData = array())
{
$aData['imageurl'] = Yii::app()->getConfig('adminimageurl');
Expand Down

0 comments on commit 99ca6e1

Please sign in to comment.