当前位置: 首页>>代码示例>>PHP>>正文


PHP PrepareEditorScript函数代码示例

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


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

示例1: index

 /**
  * Load edit email template screen.
  * @param mixed $iSurveyId
  * @return
  */
 function index($iSurveyId)
 {
     $clang = $this->getController()->lang;
     $iSurveyId = sanitize_int($iSurveyId);
     $this->getController()->_css_admin_includes(Yii::app()->getConfig('adminstyleurl') . "superfish.css");
     Yii::app()->loadHelper('admin.htmleditor');
     Yii::app()->loadHelper('surveytranslator');
     Yii::app()->session['FileManagerContext'] = "edit:assessments:{$iSurveyId}";
     if (isset($iSurveyId) && getEmailFormat($iSurveyId) == 'html') {
         $ishtml = true;
     } else {
         $ishtml = false;
     }
     $grplangs = Survey::model()->findByPk($iSurveyId)->additionalLanguages;
     $baselang = Survey::model()->findByPk($iSurveyId)->language;
     array_unshift($grplangs, $baselang);
     $sEditScript = PrepareEditorScript(false, $this->getController());
     $aData['attrib'] = array();
     $aData['bplangs'] = array();
     $aData['defaulttexts'] = array();
     if ($ishtml) {
         $sEscapeMode = 'html';
     } else {
         $sEscapeMode = 'unescaped';
     }
     foreach ($grplangs as $key => $grouplang) {
         $aData['bplangs'][$key] = new limesurvey_lang($grouplang);
         $aData['attrib'][$key] = Surveys_languagesettings::model()->find('surveyls_survey_id = :ssid AND surveyls_language = :ls', array(':ssid' => $iSurveyId, ':ls' => $grouplang));
         $aData['defaulttexts'][$key] = templateDefaultTexts($aData['bplangs'][$key], $sEscapeMode);
     }
     $aData['surveyid'] = $iSurveyId;
     $aData['ishtml'] = $ishtml;
     $aData['grplangs'] = $grplangs;
     $this->_renderWrappedTemplate('emailtemplates', array('output' => $sEditScript, 'emailtemplates_view'), $aData);
 }
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:40,代码来源:emailtemplates.php

示例2: index

 /**
  * Load edit email template screen.
  * @param mixed $iSurveyId
  * @return
  */
 function index($iSurveyId)
 {
     $iSurveyId = sanitize_int($iSurveyId);
     Yii::app()->loadHelper('admin.htmleditor');
     Yii::app()->loadHelper('surveytranslator');
     Yii::app()->session['FileManagerContext'] = "edit:emailsettings:{$iSurveyId}";
     initKcfinder();
     if (isset($iSurveyId) && getEmailFormat($iSurveyId) == 'html') {
         $ishtml = true;
     } else {
         $ishtml = false;
     }
     $grplangs = Survey::model()->findByPk($iSurveyId)->additionalLanguages;
     $baselang = Survey::model()->findByPk($iSurveyId)->language;
     array_unshift($grplangs, $baselang);
     $sEditScript = PrepareEditorScript(false, $this->getController());
     $aData['attrib'] = array();
     $aData['bplangs'] = array();
     $aData['defaulttexts'] = array();
     if ($ishtml) {
         $sEscapeMode = 'html';
     } else {
         $sEscapeMode = 'unescaped';
     }
     foreach ($grplangs as $key => $grouplang) {
         $aData['bplangs'][$key] = $grouplang;
         $aData['attrib'][$key] = SurveyLanguageSetting::model()->find('surveyls_survey_id = :ssid AND surveyls_language = :ls', array(':ssid' => $iSurveyId, ':ls' => $grouplang));
         $aData['attrib'][$key]['attachments'] = unserialize($aData['attrib'][$key]['attachments']);
         $aData['defaulttexts'][$key] = templateDefaultTexts($aData['bplangs'][$key], $sEscapeMode);
     }
     $aData['sidemenu']['state'] = false;
     $surveyinfo = Survey::model()->findByPk($iSurveyId)->surveyinfo;
     $aData['title_bar']['title'] = $surveyinfo['surveyls_title'] . "(" . gT("ID") . ":" . $iSurveyId . ")";
     $aData['surveybar']['savebutton']['form'] = 'frmeditgroup';
     $aData['surveybar']['saveandclosebutton']['form'] = 'frmeditgroup';
     if (!Permission::model()->hasSurveyPermission($iSurveyId, 'surveycontent', 'update')) {
         unset($aData['surveybar']['savebutton']);
         unset($aData['surveybar']['saveandclosebutton']);
     }
     $aData['surveybar']['closebutton']['url'] = 'admin/survey/sa/view/surveyid/' . $iSurveyId;
     // Close button
     $aData['surveyid'] = $iSurveyId;
     $aData['ishtml'] = $ishtml;
     $aData['grplangs'] = $grplangs;
     $this->_renderWrappedTemplate('emailtemplates', array('output' => $sEditScript, 'emailtemplates_view'), $aData);
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:51,代码来源:emailtemplates.php

示例3: index

 /**
  * Load edit email template screen.
  * @param mixed $iSurveyId
  * @return
  */
 function index($iSurveyId)
 {
     $iSurveyId = sanitize_int($iSurveyId);
     App()->getClientScript()->registerPackage('jquery-superfish');
     Yii::app()->loadHelper('admin.htmleditor');
     Yii::app()->loadHelper('surveytranslator');
     Yii::app()->session['FileManagerContext'] = "edit:emailsettings:{$iSurveyId}";
     initKcfinder();
     if (isset($iSurveyId) && getEmailFormat($iSurveyId) == 'html') {
         $ishtml = true;
     } else {
         $ishtml = false;
     }
     $grplangs = Survey::model()->findByPk($iSurveyId)->additionalLanguages;
     $baselang = Survey::model()->findByPk($iSurveyId)->language;
     array_unshift($grplangs, $baselang);
     $sEditScript = PrepareEditorScript(false, $this->getController());
     $aData['attrib'] = array();
     $aData['bplangs'] = array();
     $aData['defaulttexts'] = array();
     if ($ishtml) {
         $sEscapeMode = 'html';
     } else {
         $sEscapeMode = 'unescaped';
     }
     foreach ($grplangs as $key => $grouplang) {
         $aData['bplangs'][$key] = $grouplang;
         $aData['attrib'][$key] = SurveyLanguageSetting::model()->find('surveyls_survey_id = :ssid AND surveyls_language = :ls', array(':ssid' => $iSurveyId, ':ls' => $grouplang));
         $aData['attrib'][$key]['attachments'] = unserialize($aData['attrib'][$key]['attachments']);
         $aData['defaulttexts'][$key] = templateDefaultTexts($aData['bplangs'][$key], $sEscapeMode);
     }
     $aData['surveyid'] = $iSurveyId;
     $aData['ishtml'] = $ishtml;
     $aData['grplangs'] = $grplangs;
     $this->_renderWrappedTemplate('emailtemplates', array('output' => $sEditScript, 'emailtemplates_view'), $aData);
 }
开发者ID:wrenchpilot,项目名称:LimeSurvey,代码行数:41,代码来源:emailtemplates.php

示例4: PrepareEditorScript

';
    var lafail = '<?php 
$clang->eT('Sorry, the request failed!');
?>
';
    var ok = '<?php 
$clang->eT('Ok');
?>
';
    var cancel = '<?php 
$clang->eT('Cancel');
?>
';
</script>
<?php 
echo PrepareEditorScript();
?>
<div class='header ui-widget-header'>
    <?php 
$clang->eT("Edit subquestions");
?>
</div>
<?php 
echo CHtml::form(array("admin/database"), 'post', array('id' => 'editsubquestionsform', 'name' => 'editsubquestionsform'));
?>

    <input type='hidden' name='sid' value='<?php 
echo $surveyid;
?>
' />
    <input type='hidden' name='gid' value='<?php 
开发者ID:ryu1inaba,项目名称:LimeSurvey,代码行数:31,代码来源:subQuestion_view.php

示例5: PrepareEditorScript

<?php

echo PrepareEditorScript(false, $this);
?>

<div class='header ui-widget-header'><?php 
$clang->eT("Edit Group");
?>
</div>
<?php 
echo CHtml::form(array("admin/questiongroups/sa/update/gid/{$gid}"), 'post', array('id' => 'frmeditgroup', 'name' => 'frmeditgroup', 'class' => 'form30'));
?>
    <div id='tabs'>
        <ul>
            <?php 
foreach ($tabtitles as $i => $eachtitle) {
    ?>
                <li style='clear:none'><a href='#editgrp_<?php 
    echo $i;
    ?>
'><?php 
    echo $eachtitle;
    ?>
</a></li><?php 
}
?>
        </ul>
        <?php 
foreach ($tabtitles as $i => $eachtitle) {
    ?>
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:30,代码来源:editGroup_view.php

示例6: PrepareEditorScript

<?php echo PrepareEditorScript(true, $this); ?>
<div class='header ui-widget-header'>
    <?php $clang->eT("Send email reminder"); ?></div><br />

<?php if ($thissurvey['active'] != 'Y') { ?>
    <div class='messagebox ui-corner-all'><div class='warningheader'><?php $clang->eT('Warning!'); ?></div><?php $clang->eT("This survey is not yet activated and so your participants won't be able to fill out the survey."); ?></div>
<?php } ?>

<div id='tabs'>
    <ul>
        <?php
        foreach ($surveylangs as $language)
        {
            //GET SURVEY DETAILS
            echo '<li><a href="#tabpage_' . $language . '">' . getLanguageNameFromCode($language, false);
            if ($language == $baselang)
            {
                echo "(" . $clang->gT("Base language") . ")";
            }
            echo "</a></li>";
        }
        ?>
    </ul>

    <?php echo CHtml::form(array("admin/tokens/sa/email/action/remind/surveyid/{$surveyid}"), 'post', array('id'=>'sendreminder', 'class'=>'form30')); ?>
        <?php
        foreach ($surveylangs as $language)
        {
            //GET SURVEY DETAILS
            if (!$thissurvey[$language]['email_remind'])
开发者ID:elcharlygraf,项目名称:Encuesta-YiiFramework,代码行数:30,代码来源:remind.php

示例7: implode

    var langs='<?php echo implode(';',$anslangs); ?>';
    var otherisreserved='<?php $clang->eT("Error: 'other' is a reserved keyword.",'js'); ?>';
    var sImageURL ='<?php echo Yii::app()->getConfig('adminimageurl'); ?>';
    var saveaslabletitle  = '<?php $clang->eT('Save as label set','js'); ?>';
    var lanameurl = '<?php echo Yii::app()->createUrl('/admin/labels/sa/getAllSets'); ?>';
    var lasaveurl = '<?php echo Yii::app()->createUrl('/admin/labels/sa/ajaxSets'); ?>';
    var sCheckLabelURL = '<?php echo Yii::app()->createUrl('/admin/questions/sa/ajaxchecklabel'); ?>';
    var lsdetailurl = '<?php echo Yii::app()->createUrl('/admin/questions/sa/ajaxlabelsetdetails'); ?>';
    var lspickurl = '<?php echo Yii::app()->createUrl('/admin/questions/sa/ajaxlabelsetpicker'); ?>';
    var check = true;
    var lasuccess = '<?php $clang->eT('The records have been saved successfully!'); ?>';
    var lafail = '<?php $clang->eT('Sorry, the request failed!'); ?>';
    var ok = '<?php $clang->eT('Ok'); ?>';
    var cancel = '<?php $clang->eT('Cancel'); ?>';
</script>
<?php echo PrepareEditorScript(); ?>
<div class='header ui-widget-header'>
    <?php $clang->eT("Edit subquestions"); ?>
</div>
<?php echo CHtml::form(array("admin/database"), 'post', array('id'=>'editsubquestionsform', 'name'=>'editsubquestionsform')); ?>

    <input type='hidden' name='sid' value='<?php echo $surveyid; ?>' />
    <input type='hidden' name='gid' value='<?php echo $gid; ?>' />
    <input type='hidden' name='qid' value='<?php echo $qid; ?>' />
    <input type='hidden' id='action' name='action' value='updatesubquestions' />
    <input type='hidden' id='sortorder' name='sortorder' value='' />
    <input type='hidden' id='deletedqids' name='deletedqids' value='' />
    <div id='tabs'>
        <ul>
            <?php foreach ($anslangs as $anslang)
                { ?>
开发者ID:Narasimman,项目名称:UrbanExpansion,代码行数:31,代码来源:subQuestion_view.php

示例8: foreach

     $translateoutput .= "" . "\t\t<li><a href=\"#tab-" . $type . "\"><span>" . $amTypeOptions["description"] . "</span></a></li>\n";
 }
 $translateoutput .= "" . "\t</ul>\n";
 // Define content of each tab
 foreach ($tab_names as $type) {
     $amTypeOptions = setupTranslateFields($surveyid, $type, $tolang, $baselang);
     $type2 = $amTypeOptions["associated"];
     if ($type2 != "") {
         $associated = TRUE;
         $amTypeOptions2 = setupTranslateFields($surveyid, $type2, $tolang, $baselang);
     } else {
         $associated = FALSE;
     }
     // Create tab names and heading
     $translateoutput .= "\t<div id='tab-" . $type . "'>\n";
     $translateoutput .= PrepareEditorScript();
     // Setup form
     // start a counter in order to number the input fields for each record
     $i = 0;
     $evenRow = FALSE;
     $all_fields_empty = TRUE;
     $querybase = $amTypeOptions["querybase"];
     $resultbase = db_execute_assoc($querybase);
     if ($associated) {
         $querybase2 = $amTypeOptions2["querybase"];
         $resultbase2 = db_execute_assoc($querybase2);
     }
     $queryto = $amTypeOptions["queryto"];
     $resultto = db_execute_assoc($queryto);
     if ($associated) {
         $queryto2 = $amTypeOptions2["queryto"];
开发者ID:ddrmoscow,项目名称:queXS,代码行数:31,代码来源:translate.php

示例9: view

 /**
  * Function to view a labelset.
  *
  * @access public
  * @param int $lid
  * @return void
  */
 public function view($lid = 0)
 {
     if (!Permission::model()->hasGlobalPermission('labelsets', 'read')) {
         Yii::app()->session['flashmessage'] = gT('Access denied!');
         $this->getController()->redirect(App()->createUrl("/admin"));
     }
     // Escapes the id variable
     if ($lid != false) {
         $lid = sanitize_int($lid);
     }
     Yii::app()->session['FileManagerContext'] = "edit:label:{$lid}";
     // Gets the current language
     $action = 'labels';
     $aViewUrls = array();
     $aData = array();
     // Includes some javascript files
     App()->getClientScript()->registerPackage('jquery-json');
     // Checks if user have the sufficient rights to manage the labels
     // Get a result containing labelset with the specified id
     $result = LabelSet::model()->findByAttributes(array('lid' => $lid));
     // If there is label id in the variable $lid and there are labelset records in the database
     $labelset_exists = !empty($result);
     if ($lid && $labelset_exists) {
         // Now recieve all labelset information and display it
         $aData['lid'] = $lid;
         $aData['row'] = $result->attributes;
         $rwlabelset = $result;
         // Make languages array from the current row
         $lslanguages = explode(" ", trim($result['languages']));
         Yii::app()->loadHelper("admin/htmleditor");
         $aViewUrls['output'] = PrepareEditorScript(false, $this->getController());
         $criteria = new CDbCriteria();
         $criteria->select = 'max(sortorder) as maxsortorder, sortorder';
         $criteria->addCondition('lid = :lid');
         $criteria->addCondition('language = :language');
         $criteria->params = array(':lid' => $lid, ':language' => $lslanguages[0]);
         $criteria->group = 'sortorder';
         $maxresult = Label::model()->find($criteria);
         $maxsortorder = 1;
         if (!empty($maxresult)) {
             $maxsortorder = $maxresult->maxsortorder + 1;
         }
         $i = 0;
         Yii::app()->loadHelper("surveytranslator");
         $results = array();
         foreach ($lslanguages as $lslanguage) {
             $result = Label::model()->findAllByAttributes(array('lid' => $lid, 'language' => $lslanguage), array('order' => 'sortorder, code'));
             $criteria = new CDbCriteria();
             $criteria->order = 'sortorder, code';
             $criteria->condition = 'lid = :lid AND language = :language';
             $criteria->params = array(':lid' => $lid, ':language' => $lslanguage);
             $labelcount = Label::model()->count($criteria);
             $results[$i] = array();
             foreach ($result as $row) {
                 $results[$i][] = $row->attributes;
             }
             $i++;
         }
         $aViewUrls['labelview_view'][] = array('results' => $results, 'lslanguages' => $lslanguages, 'lid' => $lid, 'maxsortorder' => $maxsortorder, 'action' => $action);
     } else {
         //show listing
         $aViewUrls['labelsets_view'][] = array();
         $aData['model'] = LabelSet::model();
     }
     if ($lid == 0) {
         $aData['labelbar']['buttons']['view'] = true;
     } else {
         $aData['labelbar']['buttons']['delete'] = true;
         $aData['labelbar']['savebutton']['form'] = 'mainform';
         $aData['labelbar']['savebutton']['text'] = gT("Save changes");
         $aData['labelbar']['closebutton']['url'] = Yii::app()->request->getUrlReferrer(Yii::app()->createUrl('admin/labels/sa/view'));
         $aData['labelbar']['buttons']['edition'] = true;
         $aData['labelbar']['buttons']['edit'] = true;
         if (!Permission::model()->hasGlobalPermission('labelsets', 'update')) {
             unset($aData['labelbar']['buttons']['edition']);
         }
     }
     if (isset($_GET['pageSize'])) {
         Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']);
     }
     $this->_renderWrappedTemplate('labels', $aViewUrls, $aData);
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:89,代码来源:labels.php

示例10: editlocalsettings

 /**
  * Load editing of local settings of a survey screen.
  *
  * @access public
  * @param int $iSurveyID
  * @return void
  */
 public function editlocalsettings($iSurveyID)
 {
     $aData['surveyid'] = $iSurveyID = sanitize_int($iSurveyID);
     $aViewUrls = array();
     if (Permission::model()->hasSurveyPermission($iSurveyID, 'surveylocale', 'read')) {
         $this->_registerScriptFiles();
         if (Permission::model()->hasSurveyPermission($iSurveyID, 'surveylocale', 'update')) {
             Yii::app()->session['FileManagerContext'] = "edit:survey:{$iSurveyID}";
         }
         $grplangs = Survey::model()->findByPk($iSurveyID)->additionalLanguages;
         $baselang = Survey::model()->findByPk($iSurveyID)->language;
         array_unshift($grplangs, $baselang);
         Yii::app()->loadHelper("admin/htmleditor");
         $aData['scripts'] = PrepareEditorScript(false, $this->getController());
         foreach ($grplangs as $i => $sLang) {
             // this one is created to get the right default texts fo each language
             Yii::app()->loadHelper('database');
             Yii::app()->loadHelper('surveytranslator');
             $esrow = SurveyLanguageSetting::model()->findByPk(array('surveyls_survey_id' => $iSurveyID, 'surveyls_language' => $sLang))->getAttributes();
             $aTabTitles[$sLang] = getLanguageNameFromCode($esrow['surveyls_language'], false);
             if ($esrow['surveyls_language'] == Survey::model()->findByPk($iSurveyID)->language) {
                 $aTabTitles[$sLang] .= '(' . gT("Base language") . ')';
             }
             $aData['esrow'] = $esrow;
             $aData['action'] = "editsurveylocalesettings";
             $aData['i'] = $i;
             $aTabContents[$sLang] = $this->getController()->renderPartial('/admin/survey/editLocalSettings_view', $aData, true);
         }
         unset($aData['i']);
         $aData['has_permissions'] = Permission::model()->hasSurveyPermission($iSurveyID, 'surveylocale', 'update');
         $aData['surveyls_language'] = $esrow["surveyls_language"];
         $aData['aTabContents'] = $aTabContents;
         $aData['aTabTitles'] = $aTabTitles;
         $esrow = array();
         $esrow = self::_fetchSurveyInfo('editsurvey', $iSurveyID);
         $aData['esrow'] = $esrow;
         $aData = array_merge($aData, $this->_generalTabEditSurvey($iSurveyID, $esrow));
         $aData = array_merge($aData, $this->_tabPresentationNavigation($esrow));
         $aData = array_merge($aData, $this->_tabPublicationAccess($esrow));
         $aData = array_merge($aData, $this->_tabNotificationDataManagement($esrow));
         $aData = array_merge($aData, $this->_tabTokens($esrow));
         $aData = array_merge($aData, $this->_tabPanelIntegration($esrow));
         $aData = array_merge($aData, $this->_tabResourceManagement($iSurveyID));
         $oResult = Question::model()->getQuestionsWithSubQuestions($iSurveyID, $esrow['language'], "({{questions}}.type = 'T'  OR  {{questions}}.type = 'Q'  OR  {{questions}}.type = 'T' OR {{questions}}.type = 'S')");
         $aData['questions'] = $oResult;
         $aData['display']['menu_bars']['surveysummary'] = "editsurveysettings";
         $tempData = $aData;
         $aData['settings_data'] = $tempData;
         $aData['sidemenu']['state'] = false;
         $surveyinfo = Survey::model()->findByPk($iSurveyID)->surveyinfo;
         $aData['title_bar']['title'] = $surveyinfo['surveyls_title'] . "(" . gT("ID") . ":" . $iSurveyID . ")";
         $aData['surveybar']['savebutton']['form'] = 'globalsetting';
         $aData['surveybar']['savebutton']['useformid'] = 'true';
         $aData['surveybar']['saveandclosebutton']['form'] = true;
         $aData['surveybar']['closebutton']['url'] = 'admin/survey/sa/view/surveyid/' . $iSurveyID;
         $aViewUrls[] = 'editLocalSettings_main_view';
     } else {
         $this->getController()->error('Access denied');
     }
     $this->_renderWrappedTemplate('survey', $aViewUrls, $aData);
 }
开发者ID:GuillaumeSmaha,项目名称:LimeSurvey,代码行数:68,代码来源:surveyadmin.php

示例11: edit_body

 function edit_body()
 {
     Yii::app()->loadHelper("admin/htmleditor");
     $clang = Yii::app()->lang;
     if (!Permission::model()->hasGlobalPermission('emailTemp', 'update')) {
         Yii::app()->setFlashMessage($clang->gT("You do not have sufficient rights to access this page."), 'error');
         $this->getController()->redirect(array("admin/index"));
     }
     $action = isset($_POST['action']) ? $_POST['action'] : '';
     //Yii::app()->session['FileManagerContext'] = "edit:survey:21";
     Yii::app()->loadHelper("admin/htmleditor");
     //initKcfinder();
     $aViewUrls['output'] = PrepareEditorScript(true, $this->getController());
     if (isset($_POST['email_body_id']) && isset($_POST['email_language_code'])) {
         $email_body_id = (int) Yii::app()->request->getPost("email_body_id");
         $email_language_code = flattenText($_POST['email_language_code'], false, true, 'UTF-8', true);
         if ($action == 'modbody') {
             $current_date = date('y-m-d h:i:s');
             $body_language = flattenText($_POST['body_language'], false, true, 'UTF-8', true);
             $translated_content = $_POST['translated_content'];
             $body_content = $_POST['body_content'];
             $translated_content = str_replace("'", "&#39", $translated_content);
             $body_content = str_replace("'", "&#39", $body_content);
             $Isactive = flattenText($_POST['IsActive'], false, true, 'UTF-8', true);
             $Is_active = 0;
             if ($Isactive) {
                 $Is_active = 1;
             }
             if ($translated_content == '' || $body_language == '') {
                 $aViewUrls['message'] = array('title' => $clang->gT("Failed to edit Email Body"), 'message' => $clang->gT("A email body or translated body was not supplied or the email body or translated body is invalid."), 'class' => 'warningheader');
             } else {
                 $oRecord = Get_body::model()->findByPk($email_body_id);
                 $oRecord->content_text = $body_content;
                 $oRecord->updated_datetime = $current_date;
                 $oRecord->IsActive = $Is_active;
                 $EditEmailSubject = $oRecord->save();
                 if ($EditEmailSubject) {
                     $sql = "SELECT count(*) as cnt FROM {{translation_email_body}}\n                            WHERE email_bodyid = '{$email_body_id}' AND language_code_dest = '{$body_language}'";
                     $result = Yii::app()->db->createCommand($sql)->queryRow();
                     if ($result['cnt'] > 0) {
                         $sqlupdate = "UPDATE {{translation_email_body}} SET\n                                    translated_body = '{$translated_content}'\n                                    ,updated_datetime = '{$current_date}'\n                                    WHERE email_bodyid = '{$email_body_id}' AND language_code_dest = '{$body_language}'";
                         $result = Yii::app()->db->createCommand($sqlupdate)->query();
                     } else {
                         $sqlupdate = "INSERT INTO {{translation_email_body}}\n                                (email_bodyid,language_code_dest,translated_body,created_datetime) \n                                VALUES('{$email_body_id}', '{$body_language}', '{$translated_content}', '{$current_date}');";
                         $result = Yii::app()->db->createCommand($sqlupdate)->query();
                     }
                     Yii::app()->setFlashMessage($clang->gT("Email Body updated successfully"));
                     $this->getController()->redirect(array("admin/get/sa/list_body"));
                 } else {
                     $aViewUrls['mboxwithredirect'][] = $this->_messageBoxWithRedirect($clang->gT("Editing Email Body"), $clang->gT("Could not modify Email Body."), 'warningheader');
                 }
             }
         } else {
             $sresult = getEmailBody($email_language_code, $email_body_id);
             $aData['mur'] = $sresult;
             $aData['email_body_id'] = $email_body_id;
             $aData['email_language_code'] = $email_language_code;
             $this->_renderWrappedTemplate('get', 'view_editbody', $aData);
             return;
         }
     }
     Yii::app()->setFlashMessage(Yii::app()->lang->gT("You do not have sufficient rights to access this page."), 'error');
     $this->getController()->redirect(array("admin/get/sa/list_body"));
 }
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:64,代码来源:get_action.php

示例12: GetAdditionalLanguagesFromSurveyID

*
* $Id:
*
*/
include_once "login_check.php";
//Login Check dies also if the script is started directly
$js_admin_includes[] = 'scripts/emailtemplates.js';
if (isset($surveyid) && getEmailFormat($surveyid) == 'html') {
    $ishtml = true;
} else {
    $ishtml = false;
}
$grplangs = GetAdditionalLanguagesFromSurveyID($surveyid);
$baselang = GetBaseLanguageFromSurveyID($surveyid);
array_unshift($grplangs, $baselang);
$sHTMLOutput = PrepareEditorScript();
// Inject necessary strings for Javascript functions
$sHTMLOutput .= "<script type='text/javascript'>\n                          var sReplaceTextConfirmation='" . $clang->gT("This will replace the existing text. Continue?", "js") . "'\n                       </script>\n";
$sHTMLOutput .= "<div class='header ui-widget-header'>\n" . $clang->gT("Edit email templates") . "</div>\n" . "<form class='form30newtabs' id='emailtemplates' action='{$scriptname}' method='post'>\n" . "<div id='tabs'><ul>";
$surveyinfo = getSurveyInfo($surveyid);
foreach ($grplangs as $grouplang) {
    $sHTMLOutput .= "<li><a href='#tab-{$grouplang}'>" . getLanguageNameFromCode($grouplang, false);
    if ($grouplang == GetBaseLanguageFromSurveyID($surveyid)) {
        $sHTMLOutput .= ' (' . $clang->gT("Base language") . ')';
    }
    $sHTMLOutput .= "</a></li>";
}
$sHTMLOutput .= "</ul>";
foreach ($grplangs as $grouplang) {
    // this one is created to get the right default texts fo each language
    $bplang = new limesurvey_lang($grouplang);
开发者ID:ddrmoscow,项目名称:queXS,代码行数:31,代码来源:editemailtemplates.php

示例13: db_execute_assoc

					."\t</div>\n"
					."\t</div>\n"
					."\t</div>\n";
					$labelsoutput .= "<p style='margin:0;font-size:1px;line-height:1px;height:1px;'>&nbsp;</p>"; //CSS Firefox 2 transition fix
        }


        //LABEL ANSWERS  - SHOW THE MASK FOR EDITING THE LABELS


        $qulabelset = "SELECT * FROM ".db_table_name('labelsets')." WHERE lid=$lid";
        $rslabelset = db_execute_assoc($qulabelset) or safe_die($connect->ErrorMsg());
        $rwlabelset=$rslabelset->FetchRow();
        $lslanguages=explode(" ", trim($rwlabelset['languages']));

        $labelsoutput.= PrepareEditorScript();

        $maxquery = "SELECT max(sortorder) as maxsortorder FROM ".db_table_name('labels')." WHERE lid=$lid and language='{$lslanguages[0]}'";
        $maxresult = db_execute_assoc($maxquery) or safe_die($connect->ErrorMsg());
        $msorow=$maxresult->FetchRow();
        $maxsortorder=$msorow['maxsortorder']+1;

        // KP
        $labelsoutput.= "\t<div class='header ui-widget-header'>".$clang->gT("Labels")."\t</div>\n";
        $labelsoutput.= "<form method='post' action='admin.php' onsubmit=\"return codeCheck('code_',$maxsortorder,'".$clang->gT("Error: You are trying to use duplicate label codes.",'js')."','".$clang->gT("Error: 'other' is a reserved keyword.",'js')."');\">\n"
        ."<input type='hidden' name='sortorder' value='{$row['sortorder']}' />\n"
        ."<input type='hidden' name='lid' value='$lid' />\n"
        ."<input type='hidden' name='action' value='modlabelsetanswers' />\n";
        $first=true;
        $sortorderids=''; $codeids='';
        $i = 0;
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:31,代码来源:labels.php

示例14: PrepareEditorScript

        else
        {
            $tokenoutput .= "<div class='warningheader'>".$clang->gT("Warning")."</div>\n".$clang->gT("There were no eligible emails to send. This will be because none satisfied the criteria of:")
            ."<br/>&nbsp;<ul><li>".$clang->gT("having a valid email address")."</li>"
            ."<li>".$clang->gT("not having been sent an invitation already")."</li>"
            ."<li>".$clang->gT("having already completed the survey")."</li>"
            ."<li>".$clang->gT("having a token")."</li></ul>";
        }
    }
    //$tokenoutput .= "</div>\n</div>\n";
    $tokenoutput .= "</div>\n"; // TIBO only close on div, cause dialog-modal will cklose wrapper
}

if ($subaction == "remind" && bHasSurveyPermission($surveyid, 'tokens','update'))
{
    $tokenoutput .= PrepareEditorScript();
    $tokenoutput .= "\t<div class='header ui-widget-header'>"
    .$clang->gT("Send email reminder")."</div><br />\n";
    if (!isset($_POST['ok']) || !$_POST['ok'])
    {
        if ($thissurvey['active']!='Y')
        {
            $tokenoutput .="<div class='messagebox ui-corner-all'><div class='warningheader'>".$clang->gT('Warning!')."</div>".$clang->gT("This survey is not yet activated and so your participants won't be able to fill out the survey.")."</div>";
        }
        //GET SURVEY DETAILS
        $tokenoutput .= "<form method='post' class='form30' id='sendreminder' action='$scriptname?action=tokens'>";
        $surveylangs = GetAdditionalLanguagesFromSurveyID($surveyid);
        $baselang = GetBaseLanguageFromSurveyID($surveyid);
        array_unshift($surveylangs,$baselang);

        $tokenoutput .= "<div class='tab-pane' id='tab-pane-send-$surveyid'>";
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:31,代码来源:tokens.php

示例15: editlocalsettings

 /**
  * Load editing of local settings of a survey screen.
  *
  * @access public
  * @param int $iSurveyID
  * @return void
  */
 public function editlocalsettings($iSurveyID)
 {
     $clang = $this->getController()->lang;
     $aData['surveyid'] = $iSurveyID = sanitize_int($iSurveyID);
     $aViewUrls = array();
     if (hasSurveyPermission($iSurveyID, 'surveylocale', 'read')) {
         if (hasSurveyPermission($iSurveyID, 'surveylocale', 'update')) {
             Yii::app()->session['FileManagerContext'] = "edit:survey:{$iSurveyID}";
         }
         $editsurvey = '';
         $grplangs = Survey::model()->findByPk($iSurveyID)->additionalLanguages;
         $baselang = Survey::model()->findByPk($iSurveyID)->language;
         array_unshift($grplangs, $baselang);
         Yii::app()->loadHelper("admin/htmleditor");
         $aViewUrls['output'] = PrepareEditorScript(false, $this->getController());
         $i = 0;
         foreach ($grplangs as $grouplang) {
             // this one is created to get the right default texts fo each language
             Yii::app()->loadHelper('database');
             Yii::app()->loadHelper('surveytranslator');
             $bplang = $this->getController()->lang;
             //new lang($grouplang);
             $esrow = Surveys_languagesettings::model()->findByPk(array('surveyls_survey_id' => $iSurveyID, 'surveyls_language' => $grouplang))->getAttributes();
             $tab_title[$i] = getLanguageNameFromCode($esrow['surveyls_language'], false);
             if ($esrow['surveyls_language'] == Survey::model()->findByPk($iSurveyID)->language) {
                 $tab_title[$i] .= '(' . $clang->gT("Base language") . ')';
             }
             $esrow = array_map('htmlspecialchars', $esrow);
             $aData['esrow'] = $esrow;
             $aData['action'] = "editsurveylocalesettings";
             $aData['clang'] = $clang;
             $tab_content[$i] = $this->getController()->render('/admin/survey/editLocalSettings_view', $aData, true);
             $i++;
         }
         $editsurvey .= CHtml::openTag('ul');
         foreach ($tab_title as $i => $eachtitle) {
             $a_link = CHtml::link($eachtitle, "#edittxtele{$i}");
             $editsurvey .= CHtml::tag('li', array('style' => 'clear:none;'), $a_link);
         }
         $editsurvey .= CHtml::closeTag('ul');
         foreach ($tab_content as $i => $eachcontent) {
             $editsurvey .= CHtml::tag('div', array('id' => 'edittxtele' . $i), $eachcontent);
         }
         $editsurvey .= CHtml::closeTag('div');
         $aData['has_permissions'] = hasSurveyPermission($iSurveyID, 'surveylocale', 'update');
         $aData['surveyls_language'] = $esrow["surveyls_language"];
         $aData['additional_content'] = $editsurvey;
         $aViewUrls[] = 'editLocalSettings_main_view';
     } else {
         $this->getController()->error('Access denied');
     }
     $this->_renderWrappedTemplate('survey', $aViewUrls, $aData);
 }
开发者ID:pmaonline,项目名称:limesurvey-quickstart,代码行数:60,代码来源:surveyadmin.php


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