本文整理汇总了PHP中viewHelper::getIconLink方法的典型用法代码示例。如果您正苦于以下问题:PHP viewHelper::getIconLink方法的具体用法?PHP viewHelper::getIconLink怎么用?PHP viewHelper::getIconLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类viewHelper
的用法示例。
在下文中一共展示了viewHelper::getIconLink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTokens_json
//.........这里部分代码省略.........
if ($limit != 0) {
$aData->total = ceil($aData->records / $limit);
} else {
$aData->total = 0;
}
Yii::app()->loadHelper("surveytranslator");
$format = getDateFormatData(Yii::app()->session['dateformat']);
$aSurveyInfo = Survey::model()->findByPk($iSurveyId)->getAttributes();
//Get survey settings
$attributes = getAttributeFieldNames($iSurveyId);
// Now find all responses for the visible tokens
$visibleTokens = array();
$answeredTokens = array();
if ($aSurveyInfo['anonymized'] == "N" && $aSurveyInfo['active'] == "Y") {
foreach ($tokens as $token) {
if (isset($token['token']) && $token['token']) {
$visibleTokens[] = $token['token'];
}
}
$answers = SurveyDynamic::model($iSurveyId)->findAllByAttributes(array('token' => $visibleTokens));
foreach ($answers as $answer) {
$answeredTokens[$answer['token']] = $answer['token'];
}
}
$bReadPermission = Permission::model()->hasSurveyPermission($iSurveyId, 'responses', 'read');
$bCreatePermission = Permission::model()->hasSurveyPermission($iSurveyId, 'responses', 'create');
$bTokenUpdatePermission = Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'update');
$bTokenDeletePermission = Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'delete');
$bGlobalPanelReadPermission = Permission::model()->hasGlobalPermission('participantpanel', 'read');
foreach ($tokens as $token) {
$aRowToAdd = array();
if ((int) $token['validfrom']) {
$token['validfrom'] = date($format['phpdate'] . ' H:i', strtotime(trim($token['validfrom'])));
} else {
$token['validfrom'] = '';
}
if ((int) $token['validuntil']) {
$token['validuntil'] = date($format['phpdate'] . ' H:i', strtotime(trim($token['validuntil'])));
} else {
$token['validuntil'] = '';
}
$aRowToAdd['id'] = $token['tid'];
$action = "";
$action .= "<div class='inputbuttons'>";
// so we can hide this when edit is clicked
// Check is we have an answer
if (in_array($token['token'], $answeredTokens) && $bReadPermission) {
// @@TODO change link
$url = $this->getController()->createUrl("admin/responses/sa/browse/surveyid/{$iSurveyId}", array('token' => $token['token']));
$title = gT("View response details");
$action .= CHtml::link('<span class="inputbuttons-square glyphicon glyphicon-list-alt text-success" title="' . $title . '"></span>', $url, array('class' => 'imagelink'));
} else {
$action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
}
// Check if the token can be taken
if ($token['token'] != "" && ($token['completed'] == "N" || $token['completed'] == "" || $aSurveyInfo['alloweditaftercompletion'] == "Y") && $bCreatePermission) {
$action .= viewHelper::getIconLink('inputbuttons-square icon-do text-success', "survey/index/sid/{$iSurveyId}/token/{$token['token']}/lang/{$token['language']}/newtest/Y", gT("Do survey"), '_blank');
} else {
$action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
}
// Add delete icon
if ($bTokenDeletePermission) {
$attribs = array('onclick' => 'if (confirm("' . gT("Are you sure you want to delete this entry?") . ' (' . $token['tid'] . ')")) {$("#displaytokens").delRowData(' . $token['tid'] . ');$.post(delUrl,{tid:' . $token['tid'] . '});}');
$action .= viewHelper::getIconLink('inputbuttons-square glyphicon glyphicon-trash text-warning', null, gT("Delete token entry"), null, 'imagelink btnDelete', $attribs);
}
// Add email button
if (strtolower($token['emailstatus']) == 'ok' && $token['email'] && $bTokenUpdatePermission) {
if ($token['completed'] == 'N' && $token['usesleft'] > 0) {
if ($token['sent'] == 'N') {
$action .= viewHelper::getIconLink('inputbuttons-square icon-invite text-success', "admin/tokens/sa/email/surveyid/{$iSurveyId}/tokenids/" . $token['tid'], gT("Send invitation email to this person (if they have not yet been sent an invitation email)"), "_blank");
} else {
$action .= viewHelper::getIconLink('inputbuttons-square icon-remind text-success', "admin/tokens/sa/email/action/remind/surveyid/{$iSurveyId}/tokenids/" . $token['tid'], gT("Send reminder email to this person (if they have already received the invitation email)"), "_blank");
}
} else {
$action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
}
} else {
$action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
}
// Add edit button
if ($bTokenUpdatePermission) {
$action .= viewHelper::getIconLink('inputbuttons-square glyphicon glyphicon-pencil text-success', null, gT("Edit token entry"), null, 'imagelink token_edit');
}
// Add view button?
if (!empty($token['participant_id']) && $token['participant_id'] != "" && $bGlobalPanelReadPermission) {
$action .= viewHelper::getIconLink('inputbuttons-square icon-cpdb text-success', null, gT("View this person in the central participants database"), null, 'imagelink cpdb', array('onclick' => "sendPost('" . $this->getController()->createUrl('admin/participants/sa/displayParticipants') . "','',['searchcondition'],['participant_id||equal||{$token['participant_id']}']);"));
} else {
$action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
}
$action .= '</div>';
$aRowToAdd['cell'] = array($token['tid'], $action, htmlspecialchars($token['firstname'], ENT_QUOTES), htmlspecialchars($token['lastname'], ENT_QUOTES), htmlspecialchars($token['email'], ENT_QUOTES), htmlspecialchars($token['emailstatus'], ENT_QUOTES), htmlspecialchars($token['token'], ENT_QUOTES), htmlspecialchars($token['language'], ENT_QUOTES), htmlspecialchars($token['sent'], ENT_QUOTES), htmlspecialchars($token['remindersent'], ENT_QUOTES), htmlspecialchars($token['remindercount'], ENT_QUOTES), htmlspecialchars($token['completed'], ENT_QUOTES), htmlspecialchars($token['usesleft'], ENT_QUOTES), htmlspecialchars($token['validfrom'], ENT_QUOTES), htmlspecialchars($token['validuntil'], ENT_QUOTES));
foreach ($attributes as $attribute) {
$aRowToAdd['cell'][] = htmlspecialchars($token[$attribute], ENT_QUOTES);
}
$aData->rows[] = $aRowToAdd;
}
viewHelper::disableHtmlLogging();
header("Content-type: application/json");
echo ls_json_encode($aData);
}