• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP gT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中gT函数的典型用法代码示例。如果您正苦于以下问题:PHP gT函数的具体用法?PHP gT怎么用?PHP gT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了gT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: outputRecord

 /**
  * @param array $headers
  * @param array $values
  * @param FormattingOptions $oOptions
  */
 protected function outputRecord($headers, $values, FormattingOptions $oOptions)
 {
     if ($oOptions->answerFormat == 'short') {
         //No headers at all, only output values.
         $this->output .= implode($this->separator, $values) . PHP_EOL;
     } elseif ($oOptions->answerFormat == 'long') {
         //Output each record, one per page, with a header preceding every value.
         if ($this->isBeginning) {
             $this->isBeginning = false;
         } else {
             $this->output .= "<br clear='all' style='page-break-before:always'>";
         }
         $this->output .= "<table><tr><th colspan='2'>" . gT("Survey response") . "</td></tr>" . PHP_EOL;
         $counter = 0;
         foreach ($headers as $header) {
             //if cell empty, output a space instead, otherwise the cell will be in 2pt font
             $value = "&nbsp;";
             if ($values[$counter] != "") {
                 $value = $values[$counter];
             }
             $this->output .= "<tr><td>" . $header . "</td><td>" . $value . "</td></tr>" . PHP_EOL;
             $counter++;
         }
         $this->output .= "</table>" . PHP_EOL;
     } else {
         safeDie('An invalid answer format was selected.  Only \'short\' and \'long\' are valid.');
     }
     if ($oOptions->output == 'display') {
         echo $this->output;
         $this->output = '';
     } elseif ($oOptions->output == 'file') {
         fwrite($this->file, $this->output);
         $this->output = '';
     }
 }
开发者ID:wrenchpilot,项目名称:LimeSurvey,代码行数:40,代码来源:DocWriter.php


示例2: index

 function index()
 {
     $aData = array();
     $needpermission = false;
     $aData['surveyid'] = $surveyid = sanitize_int(Yii::app()->request->getQuery('sid'));
     $aData['sa'] = $sa = sanitize_paranoid_string(Yii::app()->request->getQuery('sa', 'index'));
     if (($aData['sa'] == 'survey_logic_file' || $aData['sa'] == 'navigation_test') && $surveyid) {
         $needpermission = true;
     }
     if ($needpermission && !Permission::model()->hasSurveyPermission($surveyid, 'surveycontent', 'read')) {
         App()->getClientScript()->registerPackage('jquery-superfish');
         $message['title'] = gT('Access denied!');
         $message['message'] = gT('You do not have sufficient rights to access this page.');
         $message['class'] = "error";
         $this->_renderWrappedTemplate('survey', array("message" => $message), $aData);
     } else {
         App()->getClientScript()->registerPackage('jqueryui');
         App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts') . "survey_runtime.js");
         App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts') . "expressions/em_javascript.js");
         App()->getClientScript()->registerCssFile(Yii::app()->getConfig('adminstyleurl') . "adminstyle.css");
         $this->_printOnLoad(Yii::app()->request->getQuery('sa', 'index'));
         $aData['pagetitle'] = "ExpressionManager:  {$aData['sa']}";
         //header("Content-type: text/html; charset=UTF-8"); // needed for correct UTF-8 encoding
         if (isset($_GET['sa'])) {
             $this->test($aData['sa'], $aData);
         } else {
             $this->_renderWrappedTemplate('expressions', 'test_view', $aData);
         }
     }
 }
开发者ID:wrenchpilot,项目名称:LimeSurvey,代码行数:30,代码来源:expressions.php


示例3: dirReport

function dirReport($dir, $write)
{
    $error = 0;

    if ($dir == "Found")
    {
       $a = gT("Found");
    } else
    {
       $error = 1;
       $a = gT("Not found");
    }

    if ($write == "Writable")
    {
       $b = gT("Writable");
    } else
    {
       $error = 1;
       $b = gT("Unwritable");
    }

    if ($error)
    {
       return '<font color="red">'.$a.' &amp; '.$b.'</font>';
    }
    else
    {
       return $a.' &amp; '.$b;
    }
}
开发者ID:jgianpiere,项目名称:lime-survey,代码行数:31,代码来源:precheck_view.php


示例4: ShowDBUpgradeNotice

function ShowDBUpgradeNotice()
{
    $message = '
        <div class="jumbotron message-box">
            <h2 class="">' . gT('Database upgrade') . '</h2>
            <p class="lead">' . gT('Please verify the following information before continuing with the database upgrade:') . '</p>
            <p>
                <ul class="list-unstyled">
                    <li><b>' . gT('Database type') . ':</b> ' . Yii::app()->db->getDriverName() . '</li>
                    <li><b>' . gT('Database name') . ':</b> ' . getDBConnectionStringProperty('dbname') . '</li>
                    <li><b>' . gT('Table prefix') . ':</b> ' . Yii::app()->db->tablePrefix . '</li>
                    <li><b>' . gT('Site name') . ':</b> ' . Yii::app()->getConfig("sitename") . '</li>
                    <li><b>' . gT('Root URL') . ':</b> ' . Yii::app()->getController()->createUrl('') . '</li>
                </ul>
            </p>

            <p>
                <a class="btn btn-lg btn-success" href="' . Yii::app()->getController()->createUrl("admin/databaseupdate/sa/db/continue/yes") . '" role="button">
                    ' . gT('Click here to continue') . '
                </a>
            </p>

        </div>
    ';
    return $message;
}
开发者ID:GuillaumeSmaha,项目名称:LimeSurvey,代码行数:26,代码来源:update_helper.php


示例5: outputRecord

 public function outputRecord($headers, $values, FormattingOptions $oOptions)
 {
     $this->rowCounter++;
     if ($oOptions->answerFormat == 'short') {
         $pdfstring = '';
         foreach ($values as $value) {
             $pdfstring .= $value . ' | ';
         }
         $this->pdf->intopdf($pdfstring);
     } elseif ($oOptions->answerFormat == 'long') {
         if ($this->rowCounter != 1) {
             $this->pdf->AddPage();
         }
         $this->pdf->addTitle(sprintf(gT("Survey response %d"), $this->rowCounter));
         foreach ($this->aGroupMap as $gid => $questions) {
             if ($gid != 0) {
                 $this->pdf->addGidAnswer($questions[0]['group_name']);
             }
             foreach ($questions as $question) {
                 if (isset($values[$question['index']]) && isset($headers[$question['index']])) {
                     $this->pdf->addAnswer($headers[$question['index']], $values[$question['index']], false);
                 }
             }
         }
     } else {
         safeDie('An invalid answer format was encountered: ' . $oOptions->answerFormat);
     }
 }
开发者ID:GuillaumeSmaha,项目名称:LimeSurvey,代码行数:28,代码来源:PdfWriter.php


示例6: ShowDBUpgradeNotice

function ShowDBUpgradeNotice()
{
    $message = '
        <div class="jumbotron message-box">
            <h2 class="">' . gT('Database upgrade') . '</h2>
            <p class="lead">' . gT('Please verify the following information before continuing with the database upgrade:') . '</p>
            <div class="row">
            <div class="col-md-offset-4 col-md-4">
                <table class="table table-striped">
                    <tr><th>' . gT('Database type:') . '</th><td>' . Yii::app()->db->getDriverName() . '</td></tr>
                    <tr><th>' . gT('Database name:') . '</th><td>' . getDBConnectionStringProperty('dbname') . '</td></tr>
                    <tr><th>' . gT('Table prefix:') . '</th><td>' . Yii::app()->db->tablePrefix . '</td></tr>
                    <tr><th>' . gT('Site name:') . '</th><td>' . Yii::app()->getConfig("sitename") . '</td></tr>
                    <tr><th>' . gT('Root URL:') . '</th><td>' . Yii::app()->getController()->createUrl('') . '</td></tr>
                    <tr><th>' . gT('Current database version:') . '</th><td>' . GetGlobalSetting('DBVersion') . '</td></tr>
                    <tr><th>' . gT('Target database version:') . '</th><td>' . Yii::app()->getConfig('dbversionnumber') . '</td></tr>
                </table>
            </div>
            </div>

            <p>
                <a class="btn btn-lg btn-success" href="' . Yii::app()->getController()->createUrl("admin/databaseupdate/sa/db/continue/yes") . '" role="button">
                    ' . gT('Click here to continue') . '
                </a>
            </p>

        </div>
    ';
    return $message;
}
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:30,代码来源:update_helper.php


示例7: validateAttribute

 /**
  * Validates the attribute of the object.
  * If there is any error, the error message is added to the object.
  * @param CModel $object the object being validated
  * @param string $attribute the attribute being validated
  * @throws CException if invalid operator is used
  */
 protected function validateAttribute($object, $attribute)
 {
     $value = strtolower($object->{$attribute});
     if ($this->allowEmpty && $this->isEmpty($value)) {
         return;
     }
     if ($this->compareValue !== null) {
         $compareTo = $this->compareValue;
         $compareValue = strtolower($compareTo);
     } else {
         throw new CException('compareValue must be set when using LSYii_CompareInsensitiveValidator');
     }
     switch ($this->operator) {
         case '=':
         case '==':
             if ($value != $compareValue) {
                 $message = $this->message !== null ? $this->message : sprintf(gT('%s must be case-insensitive equal to %s'), $attribute, $compareTo);
             }
             break;
         case '!=':
             if ($value == $compareValue) {
                 $message = $this->message !== null ? $this->message : sprintf(gT('%s must not be case-insensitive equal to %s'), $attribute, $compareTo);
             }
             break;
         default:
             throw new CException(Yii::t('yii', 'Invalid operator "{operator}".', array('{operator}' => $this->operator)));
     }
     if (!empty($message)) {
         $this->addError($object, $attribute, $message, array('{compareAttribute}' => $compareTo, '{compareValue}' => $compareValue));
     }
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:38,代码来源:LSYii_CompareInsensitiveValidator.php


示例8: run

 public function run()
 {
     App()->loadHelper('surveytranslator');
     $aData['issuperadmin'] = false;
     if (Permission::model()->hasGlobalPermission('superadmin', 'read')) {
         $aData['issuperadmin'] = true;
     }
     // We get the last survey visited by user
     $setting_entry = 'last_survey_' . Yii::app()->user->getId();
     $lastsurvey = getGlobalSetting($setting_entry);
     $survey = Survey::model()->findByPk($lastsurvey);
     if ($lastsurvey != null && $survey) {
         $aData['showLastSurvey'] = true;
         $iSurveyID = $lastsurvey;
         $surveyinfo = $survey->surveyinfo;
         $aData['surveyTitle'] = $surveyinfo['surveyls_title'] . "(" . gT("ID") . ":" . $iSurveyID . ")";
         $aData['surveyUrl'] = $this->getController()->createUrl("admin/survey/sa/view/surveyid/{$iSurveyID}");
     } else {
         $aData['showLastSurvey'] = false;
     }
     // We get the last question visited by user
     $setting_entry = 'last_question_' . Yii::app()->user->getId();
     $lastquestion = getGlobalSetting($setting_entry);
     // the question group of this question
     $setting_entry = 'last_question_gid_' . Yii::app()->user->getId();
     $lastquestiongroup = getGlobalSetting($setting_entry);
     // the sid of this question : last_question_sid_1
     $setting_entry = 'last_question_sid_' . Yii::app()->user->getId();
     $lastquestionsid = getGlobalSetting($setting_entry);
     $survey = Survey::model()->findByPk($lastquestionsid);
     if ($lastquestion && $lastquestiongroup && $survey) {
         $baselang = $survey->language;
         $aData['showLastQuestion'] = true;
         $qid = $lastquestion;
         $gid = $lastquestiongroup;
         $sid = $lastquestionsid;
         $qrrow = Question::model()->findByAttributes(array('qid' => $qid, 'gid' => $gid, 'sid' => $sid, 'language' => $baselang));
         if ($qrrow) {
             $aData['last_question_name'] = $qrrow['title'];
             if ($qrrow['question']) {
                 $aData['last_question_name'] .= ' : ' . $qrrow['question'];
             }
             $aData['last_question_link'] = $this->getController()->createUrl("admin/questions/sa/view/surveyid/{$sid}/gid/{$gid}/qid/{$qid}");
         } else {
             $aData['showLastQuestion'] = false;
         }
     } else {
         $aData['showLastQuestion'] = false;
     }
     $aData['countSurveyList'] = count(getSurveyList(true));
     // We get the home page display setting
     $aData['bShowSurveyList'] = getGlobalSetting('show_survey_list') == "show";
     $aData['bShowSurveyListSearch'] = getGlobalSetting('show_survey_list_search') == "show";
     $aData['bShowLogo'] = getGlobalSetting('show_logo') == "show";
     $aData['oSurveySearch'] = new Survey('search');
     $aData['bShowLastSurveyAndQuestion'] = getGlobalSetting('show_last_survey_and_question') == "show";
     $aData['iBoxesByRow'] = (int) getGlobalSetting('boxes_by_row');
     $aData['sBoxesOffSet'] = (string) getGlobalSetting('boxes_offset');
     $this->_renderWrappedTemplate('super', 'welcome', $aData);
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:60,代码来源:index.php


示例9: afterAdminMenuLoaded

 public function afterAdminMenuLoaded()
 {
     $event = $this->event;
     $menu = $event->get('menu', array());
     $menu['left'][] = array('href' => "http://docs.limesurvey.org", 'alt' => gT('LimeSurvey online manual'), 'image' => 'showhelp.png');
     $event->set('menu', $menu);
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:7,代码来源:Example.php


示例10: getPdfLanguageSettings

 /**
  * getPdfLanguageSettings
  *
  * Usage: getPdfLanguageSettings($language)
  *
  * @return array ('pdffont','pdffontsize','lg'=>array('a_meta_charset','a_meta_dir','a_meta_language','w_page')
  * @param string $language : language code for the PDF
  */
 public static function getPdfLanguageSettings($language)
 {
     Yii::import('application.libraries.admin.pdf', true);
     Yii::import('application.helpers.surveytranslator_helper', true);
     $pdffont = Yii::app()->getConfig('pdfdefaultfont');
     if ($pdffont == 'auto') {
         $pdffont = PDF_FONT_NAME_DATA;
     }
     $pdfcorefont = array("freesans", "dejavusans", "courier", "helvetica", "freemono", "symbol", "times", "zapfdingbats");
     if (in_array($pdffont, $pdfcorefont)) {
         $alternatepdffontfile = Yii::app()->getConfig('alternatepdffontfile');
         if (array_key_exists($language, $alternatepdffontfile)) {
             $pdffont = $alternatepdffontfile[$language];
             // Actually use only core font
         }
     }
     $pdffontsize = Yii::app()->getConfig('pdffontsize');
     if ($pdffontsize == 'auto') {
         $pdffontsize = PDF_FONT_SIZE_MAIN;
     }
     $lg = array();
     $lg['a_meta_charset'] = 'UTF-8';
     if (getLanguageRTL($language)) {
         $lg['a_meta_dir'] = 'rtl';
     } else {
         $lg['a_meta_dir'] = 'ltr';
     }
     $lg['a_meta_language'] = $language;
     $lg['w_page'] = gT("page");
     return array('pdffont' => $pdffont, 'pdffontsize' => $pdffontsize, 'lg' => $lg);
 }
开发者ID:wrenchpilot,项目名称:LimeSurvey,代码行数:39,代码来源:pdfHelper.php


示例11: attributeLabels

 public function attributeLabels()
 {
     $labels = array('tid' => gT('Token ID'), 'partcipant' => gT('Participant ID'), 'firstname' => gT('First name'), 'lastname' => gT('Last name'), 'email' => gT('Email address'), 'emailstatus' => gT('Email status'), 'token' => gT('Token'), 'language' => gT('Language code'), 'blacklisted' => gT('Blacklisted'), 'sent' => gT('Invitation sent date'), 'remindersent' => gT('Last reminder sent date'), 'remindercount' => gT('Total numbers of sent reminders'), 'completed' => gT('Completed'), 'usesleft' => gT('Uses left'), 'validfrom' => gT('Valid from'), 'validuntil' => gT('Valid until'));
     foreach (decodeTokenAttributes($this->survey->attributedescriptions) as $key => $info) {
         $labels[$key] = $info['description'];
     }
     return $labels;
 }
开发者ID:Spycomb,项目名称:LimeSurvey,代码行数:8,代码来源:Token.php


示例12: delete

 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function delete($id)
 {
     $this->loadModel($id)->delete();
     Yii::app()->user->setFlash('success', gT('Box deleted'));
     // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
     if (!isset($_GET['ajax'])) {
         $this->getController()->redirect(array('admin/homepagesettings'));
     }
 }
开发者ID:CSCI-462-01-2016,项目名称:LimeSurvey,代码行数:14,代码来源:homepagesettings.php


示例13: __construct

 function __construct($controller, $id)
 {
     parent::__construct($controller, $id);
     if (!Permission::model()->hasGlobalPermission('superadmin', 'read')) {
         die;
     }
     if (!in_array(Yii::app()->db->getDriverName(), array('mysql', 'mysqli')) || Yii::app()->getConfig('demoMode') == true) {
         die(gT('This feature is only available for MySQL databases.'));
     }
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:10,代码来源:dumpdb.php


示例14: afterAdminMenuLoad

 /**
  * Runs after Admin Menu Loads. Used to display New Icon that will link to
  * the Community Action Data report page.
  **/
 public function afterAdminMenuLoad()
 {
     //Check for if current user is authenticated as a superadmin
     if ($this->isSuperAdmin()) {
         $event = $this->event;
         $menu = $event->get('menu', array());
         $menu['items']['left'][] = array('href' => "plugins/direct?plugin=Report&function=managePrograms", 'alt' => gT('CA Report'), 'image' => 'chart_bar.png');
         $event->set('menu', $menu);
     }
 }
开发者ID:schreinerkw,项目名称:CommunityActionProject,代码行数:14,代码来源:Report.php


示例15: getGlobalBasePermissions

 /**
  * Returns the global permissions including description and title
  *
  * @access public
  * @static
  * @return array
  */
 public static function getGlobalBasePermissions()
 {
     $defaults = array('create' => true, 'read' => true, 'update' => true, 'delete' => true, 'import' => true, 'export' => true);
     $aPermissions = array('surveys' => array('import' => false, 'title' => gT("Surveys"), 'description' => gT("Permission to create surveys (for which all permissions are automatically given) and view, update and delete surveys from other users"), 'img' => 'survey'), 'users' => array('import' => false, 'export' => false, 'title' => gT("Users"), 'description' => gT("Permission to create, view, update and delete users"), 'img' => 'security'), 'usergroups' => array('import' => false, 'export' => false, 'title' => gT("User groups"), 'description' => gT("Permission to create, view, update and delete user groups"), 'img' => 'usergroup'), 'templates' => array('title' => gT("Templates"), 'description' => gT("Permission to create, view, update, delete, export and import templates"), 'img' => 'templates'), 'labelsets' => array('title' => gT("Label sets"), 'description' => gT("Permission to create, view, update, delete, export and import label sets/labels"), 'img' => 'labels'), 'settings' => array('create' => false, 'delete' => false, 'export' => false, 'title' => gT("Settings & Plugins"), 'description' => gT("Permission to view and update global settings & plugins and to delete and import plugins"), 'img' => 'global'), 'participantpanel' => array('import' => false, 'title' => gT("Participant panel"), 'description' => gT("Permission to create your own participants in the central participants database (for which all permissions are automatically given) and view, update and delete participants from other users"), 'img' => 'cpdb'));
     uasort($aPermissions, array(__CLASS__, "comparePermissionTitle"));
     $aPermissions['superadmin'] = array('create' => false, 'update' => false, 'delete' => false, 'import' => false, 'export' => false, 'title' => gT("Superadministrator"), 'description' => gT("Unlimited administration permissions"), 'img' => 'superadmin');
     foreach ($aPermissions as &$permission) {
         $permission = array_merge($defaults, $permission);
     }
     return $aPermissions;
 }
开发者ID:Narasimman,项目名称:UrbanExpansion,代码行数:18,代码来源:Permission.php


示例16: run

 public function run()
 {
     if (Yii::app()->session['just_logged_in']) {
         $aViewUrls = array('message' => array('title' => gT("Logged in"), 'message' => Yii::app()->session['loginsummary']));
         unset(Yii::app()->session['just_logged_in'], Yii::app()->session['loginsummary']);
         $this->_renderWrappedTemplate('super', $aViewUrls);
     } elseif (count(getSurveyList(true)) == 0) {
         $this->_renderWrappedTemplate('super', 'firststeps');
     } else {
         $this->getController()->redirect(array('admin/survey/sa/index'));
     }
 }
开发者ID:wrenchpilot,项目名称:LimeSurvey,代码行数:12,代码来源:index.php


示例17: _renderWrappedTemplate

 /**
  * 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.
  */
 protected function _renderWrappedTemplate($sAction = 'saved', $aViewUrls = array(), $aData = array())
 {
     $aData['display']['menu_bars']['browse'] = gT('Browse responses');
     // browse is independent of the above
     $aData['surveyid'] = $iSurveyId = $aData['iSurveyId'];
     $surveyinfo = Survey::model()->findByPk($iSurveyId)->surveyinfo;
     $aData["surveyinfo"] = $surveyinfo;
     $aData['title_bar']['title'] = gT('Browse responses') . ': ' . $surveyinfo['surveyls_title'];
     $aData['menu']['close'] = true;
     $aData['menu']['edition'] = false;
     parent::_renderWrappedTemplate($sAction, $aViewUrls, $aData);
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:19,代码来源:saved.php


示例18: __construct

 /**
  * @param iPlugin $plugin The plugin to which this question belongs.
  * @param int $questionId
  * @param int $responseId Pass a response id to load results.
  */
 public function __construct(iPlugin $plugin, LimesurveyApi $api, $questionId = null, $responseId = null)
 {
     $this->plugin = $plugin;
     $this->api = $api;
     $this->responseId = $responseId;
     $this->questionId = $questionId;
     if (isset($questionId)) {
         $this->loadSubQuestions($questionId);
     }
     $this->defaultAttributes = array('questiontype' => array('type' => 'select', 'localized' => false, 'advanced' => false, 'label' => gT('Question type:'), 'options' => CHtml::listData(App()->getPluginManager()->loadQuestionObjects(), 'guid', 'name')), 'code' => array('type' => 'string', 'localized' => false, 'advanced' => false, 'label' => gT('Question code:')), 'gid' => array('type' => 'select', 'localized' => false, 'advanced' => false, 'label' => gT('Question group:'), 'options' => function ($this) {
         return $this->api->getGroupList($this->get('sid'));
     }), 'relevance' => array('type' => 'relevance', 'localized' => false, 'advanced' => false, 'label' => gT('Relevance equation:')), 'randomization' => array('type' => 'string', 'localized' => false, 'advanced' => false, 'label' => gT("Randomization group:")));
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:18,代码来源:QuestionBase.php


示例19: logout

 /**
  * Logout user
  */
 public function logout()
 {
     // Fetch the current user
     $plugin = App()->user->getState('plugin', null);
     // Save for afterLogout, current user will be destroyed by then
     /* Adding beforeLogout event */
     $beforeLogout = new PluginEvent('beforeLogout');
     App()->getPluginManager()->dispatchEvent($beforeLogout, array($plugin));
     App()->user->logout();
     App()->user->setFlash('loginmessage', gT('Logout successful.'));
     /* Adding afterLogout event */
     $event = new PluginEvent('afterLogout');
     App()->getPluginManager()->dispatchEvent($event, array($plugin));
     $this->getController()->redirect(array('/pl/authentication/sa/login'));
 }
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:18,代码来源:authentication.php


示例20: run

 public function run()
 {
     App()->loadHelper('surveytranslator');
     App()->getClientScript()->registerPackage('panel-clickable');
     App()->getClientScript()->registerPackage('panels-animation');
     $aData['issuperadmin'] = false;
     if (Permission::model()->hasGlobalPermission('superadmin', 'read')) {
         $aData['issuperadmin'] = true;
     }
     // We get the last survey visited by user
     $setting_entry = 'last_survey_' . Yii::app()->user->getId();
     $lastsurvey = getGlobalSetting($setting_entry);
     if ($lastsurvey != null) {
         $aData['showLastSurvey'] = true;
         $iSurveyID = $lastsurvey;
         $surveyinfo = Survey::model()->findByPk($iSurveyID)->surveyinfo;
         $aData['surveyTitle'] = $surveyinfo['surveyls_title'] . "(" . gT("ID") . ":" . $iSurveyID . ")";
         $aData['surveyUrl'] = $this->getController()->createUrl("admin/survey/sa/view/surveyid/{$iSurveyID}");
     } else {
         $aData['showLastSurvey'] = false;
     }
     // We get the last question visited by user
     $setting_entry = 'last_question_' . Yii::app()->user->getId();
     $lastquestion = getGlobalSetting($setting_entry);
     // the question group of this question
     $setting_entry = 'last_question_gid_' . Yii::app()->user->getId();
     $lastquestiongroup = getGlobalSetting($setting_entry);
     // the sid of this question : last_question_sid_1
     $setting_entry = 'last_question_sid_' . Yii::app()->user->getId();
     $lastquestionsid = getGlobalSetting($setting_entry);
     if ($lastquestion != null && $lastquestiongroup != null) {
         $baselang = Survey::model()->findByPk($iSurveyID)->language;
         $aData['showLastQuestion'] = true;
         $qid = $lastquestion;
         $gid = $lastquestiongroup;
         $sid = $lastquestionsid;
         $qrrow = Question::model()->findByAttributes(array('qid' => $qid, 'gid' => $gid, 'sid' => $sid, 'language' => $baselang));
         $aData['last_question_name'] = $qrrow['title'];
         if ($qrrow['question']) {
             $aData['last_question_name'] .= ' : ' . $qrrow['question'];
         }
         $aData['last_question_link'] = $this->getController()->createUrl("admin/questions/sa/view/surveyid/{$iSurveyID}/gid/{$gid}/qid/{$qid}");
     } else {
         $aData['showLastQuestion'] = false;
     }
     $aData['countSurveyList'] = count(getSurveyList(true));
     $this->_renderWrappedTemplate('super', 'welcome', $aData);
 }
开发者ID:jgianpiere,项目名称:lime-survey,代码行数:48,代码来源:index.php



注:本文中的gT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP gTime函数代码示例发布时间:2022-05-15
下一篇:
PHP gSQLWhere函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap