本文整理汇总了PHP中getTemplateList函数的典型用法代码示例。如果您正苦于以下问题:PHP getTemplateList函数的具体用法?PHP getTemplateList怎么用?PHP getTemplateList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getTemplateList函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _refreshtemplates
private function _refreshtemplates()
{
$template_a = getTemplateList();
foreach ($template_a as $tp => $fullpath) {
// check for each folder if there is already an entry in the database
// if not create it with current user as creator (user with rights "create user" can assign template rights)
$result = Template::model()->findByPk($tp);
if (count($result) == 0) {
$post = new Template();
$post->folder = $tp;
$post->creator = Yii::app()->session['loginID'];
$post->save();
}
}
return true;
}
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:16,代码来源:useraction.php
示例2: eT
><?php eT("Group by Group"); ?>
</option>
<option value='A'
<?php if ($esrow['format'] == "A") { ?>
selected='selected'
<?php } ?>
><?php eT("All in one"); ?>
</option>
</select>
</li>
<li>
<label for='template'><?php eT("Template:"); ?></label>
<select id='template' name='template'>
<?php foreach (array_keys(getTemplateList()) as $tname) {
if (Permission::model()->hasGlobalPermission('superadmin','read') || Permission::model()->hasGlobalPermission('templates','read') || hasTemplateManageRights(Yii::app()->session["loginID"], $tname) == 1 || $esrow['template']==htmlspecialchars($tname) ) { ?>
<option value='<?php echo $tname; ?>'
<?php if ($esrow['template'] && htmlspecialchars($tname) == $esrow['template']) { ?>
selected='selected'
<?php } elseif (!$esrow['template'] && $tname == Yii::app()->getConfig('defaulttemplate')) { ?>
selected='selected'
<?php } ?>
><?php echo $tname; ?></option>
<?php }
} ?>
</select>
</li>
<li><label for='preview'><?php eT("Template Preview:"); ?></label>
开发者ID:jgianpiere,项目名称:lime-survey,代码行数:31,代码来源:tabPresentation_view.php
示例3: _initialise
/**
* Function that initialises all data and call other functions to load default view.
*
* @access protected
* @param string $templatename
* @param string $screenname
* @param string $editfile
* @param bool $showsummary
* @return
*/
protected function _initialise($templatename, $screenname, $editfile, $showsummary = true)
{
App()->getClientScript()->reset();
$clang = $this->getController()->lang;
Yii::app()->loadHelper('surveytranslator');
Yii::app()->loadHelper('admin/template');
$files = $this->_initfiles($templatename);
$cssfiles = $this->_initcssfiles();
// Standard Support Files
// These files may be edited or saved
$supportfiles[] = array('name' => 'print_img_radio.png');
$supportfiles[] = array('name' => 'print_img_checkbox.png');
// Standard screens
// Only these may be viewed
$screens[] = array('name' => $clang->gT('Survey List Page'), 'id' => 'surveylist');
$screens[] = array('name' => $clang->gT('Welcome Page'), 'id' => 'welcome');
$screens[] = array('name' => $clang->gT('Question Page'), 'id' => 'question');
$screens[] = array('name' => $clang->gT('Completed Page'), 'id' => 'completed');
$screens[] = array('name' => $clang->gT('Clear All Page'), 'id' => 'clearall');
$screens[] = array('name' => $clang->gT('Register Page'), 'id' => 'register');
$screens[] = array('name' => $clang->gT('Load Page'), 'id' => 'load');
$screens[] = array('name' => $clang->gT('Save Page'), 'id' => 'save');
$screens[] = array('name' => $clang->gT('Print answers page'), 'id' => 'printanswers');
$screens[] = array('name' => $clang->gT('Printable survey page'), 'id' => 'printablesurvey');
// Page display blocks
$SurveyList = array('startpage.pstpl', 'surveylist.pstpl', 'endpage.pstpl');
$Welcome = array('startpage.pstpl', 'welcome.pstpl', 'privacy.pstpl', 'navigator.pstpl', 'endpage.pstpl');
$Question = array('startpage.pstpl', 'survey.pstpl', 'startgroup.pstpl', 'groupdescription.pstpl', 'question.pstpl', 'endgroup.pstpl', 'navigator.pstpl', 'endpage.pstpl');
$CompletedTemplate = array('startpage.pstpl', 'assessment.pstpl', 'completed.pstpl', 'endpage.pstpl');
$Clearall = array('startpage.pstpl', 'clearall.pstpl', 'endpage.pstpl');
$Register = array('startpage.pstpl', 'survey.pstpl', 'register.pstpl', 'endpage.pstpl');
$Save = array('startpage.pstpl', 'save.pstpl', 'endpage.pstpl');
$Load = array('startpage.pstpl', 'load.pstpl', 'endpage.pstpl');
$printtemplate = array('startpage.pstpl', 'printanswers.pstpl', 'endpage.pstpl');
$printablesurveytemplate = array('print_survey.pstpl', 'print_group.pstpl', 'print_question.pstpl');
$file_version = "LimeSurvey template editor " . Yii::app()->getConfig('versionnumber');
Yii::app()->session['s_lang'] = Yii::app()->session['adminlang'];
$templatename = sanitize_dirname($templatename);
$screenname = autoUnescape($screenname);
// Checks if screen name is in the list of allowed screen names
if (multiarray_search($screens, 'id', $screenname) === false) {
$this->getController()->error('Invalid screen name');
}
if (!isset($action)) {
$action = sanitize_paranoid_string(returnGlobal('action'));
}
if (!isset($subaction)) {
$subaction = sanitize_paranoid_string(returnGlobal('subaction'));
}
if (!isset($newname)) {
$newname = sanitize_dirname(returnGlobal('newname'));
}
if (!isset($copydir)) {
$copydir = sanitize_dirname(returnGlobal('copydir'));
}
if (is_file(Yii::app()->getConfig('usertemplaterootdir') . '/' . $templatename . '/question_start.pstpl')) {
$files[] = array('name' => 'question_start.pstpl');
$Question[] = 'question_start.pstpl';
}
$availableeditorlanguages = array('bg', 'cs', 'de', 'dk', 'en', 'eo', 'es', 'fi', 'fr', 'hr', 'it', 'ja', 'mk', 'nl', 'pl', 'pt', 'ru', 'sk', 'zh');
$extension = substr(strrchr($editfile, "."), 1);
if ($extension == 'css' || $extension == 'js') {
$highlighter = $extension;
} else {
$highlighter = 'html';
}
if (in_array(Yii::app()->session['adminlang'], $availableeditorlanguages)) {
$codelanguage = Yii::app()->session['adminlang'];
} else {
$codelanguage = 'en';
}
$templates = getTemplateList();
if (!isset($templates[$templatename])) {
$templatename = Yii::app()->getConfig('defaulttemplate');
}
$normalfiles = array("DUMMYENTRY", ".", "..", "preview.png");
foreach ($files as $fl) {
$normalfiles[] = $fl["name"];
}
foreach ($cssfiles as $fl) {
$normalfiles[] = $fl["name"];
}
// Some global data
$aData['sitename'] = Yii::app()->getConfig('sitename');
$siteadminname = Yii::app()->getConfig('siteadminname');
$siteadminemail = Yii::app()->getConfig('siteadminemail');
// Set this so common.php doesn't throw notices about undefined variables
$thissurvey['active'] = 'N';
// FAKE DATA FOR TEMPLATES
$thissurvey['name'] = $clang->gT("Template Sample");
//.........这里部分代码省略.........
开发者ID:Narasimman,项目名称:UrbanExpansion,代码行数:101,代码来源:templates.php
示例4: htmlspecialchars
?>
</p></div>
<div id='general'>
<ul>
<li><label for='sitename'><?php
$clang->eT("Site name:") . (Yii::app()->getConfig("demoMode") == true ? '*' : '');
?>
</label>
<input type='text' size='50' id='sitename' name='sitename' value="<?php
echo htmlspecialchars(getGlobalSetting('sitename'));
?>
" /></li>
<?php
$thisdefaulttemplate = getGlobalSetting('defaulttemplate');
$templatenames = array_keys(getTemplateList());
?>
<li><label for="defaulttemplate"><?php
$clang->eT("Default template:");
?>
</label>
<select name="defaulttemplate" id="defaulttemplate">
<?php
foreach ($templatenames as $templatename) {
echo "<option value='{$templatename}'";
if ($thisdefaulttemplate == $templatename) {
echo " selected='selected' ";
}
echo ">{$templatename}</option>";
}
开发者ID:ryu1inaba,项目名称:LimeSurvey,代码行数:31,代码来源:globalSettings_view.php
示例5: foreach
<?php
/* Preparing some array
/* Template list : find User template, allways add existing template */
$aTemplateOptions=array();
foreach (array_keys(getTemplateList()) as $sTemplateName) {
if(Permission::model()->hasTemplatePermission($sTemplateName) || htmlspecialchars($sTemplateName) == $esrow['template'])
$aTemplateOptions[$sTemplateName]=$sTemplateName;
}
/* showxquestion */
$sValShowxquestions=$esrow['showxquestions'];
switch (Yii::app()->getConfig('showxquestions'))
{
case 'show':
$aShowxquestionsOptions=array("Y"=>gT('Yes (Forced by the system administrator)','unescaped'));
$bDisableShowxquestions=true;
$sValShowxquestions="Y";
break;
case 'hide':
$aShowxquestionsOptions=array("N"=>gT('No (Forced by the system administrator)','unescaped'));
$bDisableShowxquestions=true;
$sValShowxquestions="N";
break;
case 'choose':
default:
$aShowxquestionsOptions=array("Y"=>gT("Yes",'unescaped'),"N"=>gT("No",'unescaped'));
$bDisableShowxquestions=false;
break;
}
/* showgroupinfo */
$sValShowgroupinfo=$esrow['showgroupinfo'];
开发者ID:krsandesh,项目名称:LimeSurvey,代码行数:31,代码来源:tabPresentation_view.php
示例6: _saveSettings
private function _saveSettings()
{
if ($_POST['action'] !== "globalsettingssave") {
return;
}
if (!Permission::model()->hasGlobalPermission('settings', 'update')) {
$this->getController()->redirect(array('/admin'));
}
Yii::app()->loadHelper('surveytranslator');
$iPDFFontSize = sanitize_int($_POST['pdffontsize']);
if ($iPDFFontSize < 1) {
$iPDFFontSize = 9;
}
$iPDFLogoWidth = sanitize_int($_POST['pdflogowidth']);
if ($iPDFLogoWidth < 1) {
$iPDFLogoWidth = 50;
}
$maxemails = $_POST['maxemails'];
if (sanitize_int($_POST['maxemails']) < 1) {
$maxemails = 1;
}
$defaultlang = sanitize_languagecode($_POST['defaultlang']);
$aRestrictToLanguages = explode(' ', sanitize_languagecodeS($_POST['restrictToLanguages']));
if (!in_array($defaultlang, $aRestrictToLanguages)) {
// Force default language in restrictToLanguages
$aRestrictToLanguages[] = $defaultlang;
}
if (count(array_diff(array_keys(getLanguageData(false, Yii::app()->session['adminlang'])), $aRestrictToLanguages)) == 0) {
$aRestrictToLanguages = '';
} else {
$aRestrictToLanguages = implode(' ', $aRestrictToLanguages);
}
setGlobalSetting('defaultlang', $defaultlang);
setGlobalSetting('restrictToLanguages', trim($aRestrictToLanguages));
setGlobalSetting('sitename', strip_tags($_POST['sitename']));
setGlobalSetting('defaulthtmleditormode', sanitize_paranoid_string($_POST['defaulthtmleditormode']));
setGlobalSetting('defaultquestionselectormode', sanitize_paranoid_string($_POST['defaultquestionselectormode']));
setGlobalSetting('defaulttemplateeditormode', sanitize_paranoid_string($_POST['defaulttemplateeditormode']));
if (!Yii::app()->getConfig('demoMode')) {
$sTemplate = Yii::app()->getRequest()->getPost("defaulttemplate");
if (array_key_exists($sTemplate, getTemplateList())) {
setGlobalSetting('defaulttemplate', $sTemplate);
}
}
setGlobalSetting('admintheme', sanitize_paranoid_string($_POST['admintheme']));
setGlobalSetting('adminthemeiconsize', trim(file_get_contents(Yii::app()->getConfig("styledir") . DIRECTORY_SEPARATOR . sanitize_paranoid_string($_POST['admintheme']) . DIRECTORY_SEPARATOR . 'iconsize')));
setGlobalSetting('emailmethod', strip_tags($_POST['emailmethod']));
setGlobalSetting('emailsmtphost', strip_tags(returnGlobal('emailsmtphost')));
if (returnGlobal('emailsmtppassword') != 'somepassword') {
setGlobalSetting('emailsmtppassword', strip_tags(returnGlobal('emailsmtppassword')));
}
setGlobalSetting('bounceaccounthost', strip_tags(returnGlobal('bounceaccounthost')));
setGlobalSetting('bounceaccounttype', strip_tags(returnGlobal('bounceaccounttype')));
setGlobalSetting('bounceencryption', strip_tags(returnGlobal('bounceencryption')));
setGlobalSetting('bounceaccountuser', strip_tags(returnGlobal('bounceaccountuser')));
if (returnGlobal('bounceaccountpass') != 'enteredpassword') {
setGlobalSetting('bounceaccountpass', strip_tags(returnGlobal('bounceaccountpass')));
}
setGlobalSetting('emailsmtpssl', sanitize_paranoid_string(Yii::app()->request->getPost('emailsmtpssl', '')));
setGlobalSetting('emailsmtpdebug', sanitize_int(Yii::app()->request->getPost('emailsmtpdebug', '0')));
setGlobalSetting('emailsmtpuser', strip_tags(returnGlobal('emailsmtpuser')));
setGlobalSetting('filterxsshtml', strip_tags($_POST['filterxsshtml']));
$warning = '';
// make sure emails are valid before saving them
if (Yii::app()->request->getPost('siteadminbounce', '') == '' || validateEmailAddress(Yii::app()->request->getPost('siteadminbounce'))) {
setGlobalSetting('siteadminbounce', strip_tags(Yii::app()->request->getPost('siteadminbounce')));
} else {
$warning .= gT("Warning! Admin bounce email was not saved because it was not valid.") . '<br/>';
}
if (Yii::app()->request->getPost('siteadminemail', '') == '' || validateEmailAddress(Yii::app()->request->getPost('siteadminemail'))) {
setGlobalSetting('siteadminemail', strip_tags(Yii::app()->request->getPost('siteadminemail')));
} else {
$warning .= gT("Warning! Admin email was not saved because it was not valid.") . '<br/>';
}
setGlobalSetting('siteadminname', strip_tags($_POST['siteadminname']));
setGlobalSetting('shownoanswer', sanitize_int($_POST['shownoanswer']));
setGlobalSetting('showxquestions', $_POST['showxquestions']);
setGlobalSetting('showgroupinfo', $_POST['showgroupinfo']);
setGlobalSetting('showqnumcode', $_POST['showqnumcode']);
$repeatheadingstemp = (int) $_POST['repeatheadings'];
if ($repeatheadingstemp == 0) {
$repeatheadingstemp = 25;
}
setGlobalSetting('repeatheadings', $repeatheadingstemp);
setGlobalSetting('maxemails', sanitize_int($maxemails));
$iSessionExpirationTime = (int) $_POST['iSessionExpirationTime'];
if ($iSessionExpirationTime == 0) {
$iSessionExpirationTime = 7200;
}
setGlobalSetting('iSessionExpirationTime', $iSessionExpirationTime);
setGlobalSetting('ipInfoDbAPIKey', $_POST['ipInfoDbAPIKey']);
setGlobalSetting('pdffontsize', $iPDFFontSize);
setGlobalSetting('pdfshowheader', $_POST['pdfshowheader']);
setGlobalSetting('pdflogowidth', $iPDFLogoWidth);
setGlobalSetting('pdfheadertitle', $_POST['pdfheadertitle']);
setGlobalSetting('pdfheaderstring', $_POST['pdfheaderstring']);
setGlobalSetting('googleMapsAPIKey', $_POST['googleMapsAPIKey']);
setGlobalSetting('googleanalyticsapikey', $_POST['googleanalyticsapikey']);
setGlobalSetting('googletranslateapikey', $_POST['googletranslateapikey']);
setGlobalSetting('force_ssl', $_POST['force_ssl']);
//.........这里部分代码省略.........
开发者ID:nicbon,项目名称:LimeSurvey,代码行数:101,代码来源:globalsettings.php
示例7: tmplfilter
/**
* Defines the customs validation rule tmplfilter
*
* @param mixed $attribute
* @param mixed $params
*/
public function tmplfilter($attribute, $params)
{
if (!array_key_exists($this->{$attribute}, getTemplateList())) {
$this->{$attribute} = 'default';
}
}
开发者ID:elcharlygraf,项目名称:Encuesta-YiiFramework,代码行数:12,代码来源:Survey.php
示例8: saveElement
/**
* @return bool true if the operation was successfull false otherwise
*
* @access public
*/
function saveElement($regroup)
{
if ($regroup == 'templ_man') {
return $this->_saveTemplateManager();
}
if ($regroup == 'suiteman') {
return $this->_saveSuiteManager();
}
$reSetting = sql_query("\r\n\t\tSELECT param_name, value_type, extra_info\r\n\t\tFROM " . $this->table . "\r\n\t\tWHERE regroup = '" . $regroup . "' AND hide_in_modify = '0'");
$re = true;
while (list($var_name, $value_type, $extra_info) = sql_fetch_row($reSetting)) {
switch ($value_type) {
case "menuvoice":
require_once $GLOBALS['where_framework'] . '/lib/lib.menu.php';
$menu_man = new MenuManager();
if (isset($_POST['option'][$var_name]) && $_POST['option'][$var_name] == 1) {
$menu_man->addPerm(ADMIN_GROUP_GODADMIN, '/lms/admin' . $extra_info);
$new_value = 1;
} else {
$menu_man->removePerm(ADMIN_GROUP_GODADMIN, '/lms/admin' . $extra_info);
$new_value = 0;
}
break;
case "menuvoice_course_public":
$after_reload_perm = true;
require_once $GLOBALS['where_framework'] . '/lib/lib.menu.php';
$menu_man = new MenuManager();
if (isset($_POST['option'][$var_name]) && $_POST['option'][$var_name] == 1) {
$perm = explode(';', $extra_info);
foreach ($perm as $k => $perm_suffix) {
$menu_man->addPerm('/oc_0', '/lms/course' . trim($perm_suffix));
}
$new_value = 1;
} else {
$perm = explode(';', $extra_info);
foreach ($perm as $k => $perm_suffix) {
$menu_man->removePerm('/oc_0', '/lms/course' . trim($perm_suffix));
}
$new_value = 0;
}
break;
case "tablist_coursecatalogue":
$tab_selected = array();
foreach ($_POST['tablist'] as $tab_code => $v) {
$tab_selected[$tab_code] = 1;
}
$new_value = urlencode(serialize($tab_selected));
break;
case "tablist_mycourses":
$temp_arr = array();
for ($i = 0; $i < 3; $i++) {
$temp_var = $_POST['mycourses'][$i];
if ($temp_var != '' && !in_array($temp_var, $temp_arr)) {
//avoid repeated params
$temp_arr[] = $temp_var;
}
}
$new_value = implode(',', $temp_arr);
break;
//if is int cast it
//if is int cast it
case "language":
$lang = Docebo::langManager()->getAllLangCode();
$new_value = $lang[$_POST['option'][$var_name]];
break;
case "template":
$templ = getTemplateList();
$new_value = $templ[$_POST['option'][$var_name]];
break;
case "int":
$new_value = (int) $_POST['option'][$var_name];
break;
//if is enum switch value to on or off
//if is enum switch value to on or off
case "enum":
if (isset($_POST['option'][$var_name])) {
$new_value = 'on';
} else {
$new_value = 'off';
}
break;
case "check":
if (isset($_POST['option'][$var_name]) && $_POST['option'][$var_name] == 1) {
$new_value = 1;
} else {
$new_value = 0;
}
break;
case "menuvoice":
require_once $GLOBALS['where_framework'] . '/lib/lib.menu.php';
$menu_man = new MenuManager();
if (isset($_POST['option'][$var_name]) && $_POST['option'][$var_name] == 1) {
$menu_man->addPerm(ADMIN_GROUP_GODADMIN, '/framework/admin' . $extra_info);
$new_value = 1;
} else {
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:class.conf.php
示例9: saveElement
/**
* @return bool true if the operation was successfull false otherwise
*
* @access public
*/
function saveElement($regroup)
{
if ($regroup == 'root') {
return $this->_setRoot();
}
$reSetting = sql_query("\r\n\t\tSELECT param_name, value_type, extra_info \r\n\t\tFROM " . $this->table . " \r\n\t\tWHERE regroup = '" . $regroup . "' AND \r\n\t\t\thide_in_modify = '0'");
$re = true;
while (list($var_name, $value_type, $extra_info) = sql_fetch_row($reSetting)) {
switch ($value_type) {
//if is int cast it
case "template":
$templ = getTemplateList();
$new_value = $templ[$_POST['option'][$var_name]];
break;
case "int":
$new_value = (int) $_POST['option'][$var_name];
break;
//if is enum switch value to on or off
//if is enum switch value to on or off
case "enum":
if (isset($_POST['option'][$var_name])) {
$new_value = 'on';
} else {
$new_value = 'off';
}
break;
case "check":
if (isset($_POST['option'][$var_name]) && $_POST['option'][$var_name] == 1) {
$new_value = 1;
} else {
$new_value = 0;
}
break;
//else simple assignament
//else simple assignament
default:
$new_value = $_POST['option'][$var_name];
}
if (!sql_query("\r\n\t\t\tUPDATE " . $this->table . " \r\n\t\t\tSET param_value = '{$new_value}' \r\n\t\t\tWHERE param_name = '{$var_name}' AND regroup = '" . $regroup . "'")) {
$re = false;
}
}
return $re;
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:49,代码来源:class.conf_scs.php
示例10: savePreferences
/**
* @param array $array_source save the preferences of a user
* @param string $base_path if specified load only preference form this base_path
*
* @return nothing
*/
function savePreferences($array_source, $base_path = false)
{
$info_pref = $this->_up_db->getFullPreferences($this->id_user, true, false, $base_path);
if (!isset($array_source[$this->base_name])) {
return true;
}
if (!is_array($array_source[$this->base_name])) {
return true;
}
$re = true;
while (list(, $pref) = each($info_pref)) {
if (isset($array_source[$this->base_name][$pref['path_name']])) {
$new_value = $array_source[$this->base_name][$pref['path_name']];
} else {
$new_value = NULL;
}
switch ($pref['type']) {
case "language":
$langs = Docebo::langManager()->getAllLangCode();
$re &= $this->setLanguage($langs[$new_value]);
break;
case "template":
$templ = getTemplateList();
$re &= $this->setTemplate($templ[$new_value]);
break;
case "enum":
if ($new_value == NULL) {
$re &= $this->setPreference($pref['path_name'], 'off');
} else {
$re &= $this->setPreference($pref['path_name'], 'on');
}
break;
default:
$re &= $this->setPreference($pref['path_name'], $new_value);
}
}
return $re;
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:44,代码来源:lib.preference.php
示例11: _initialise
//.........这里部分代码省略.........
$availableeditorlanguages = array('bg', 'cs', 'de', 'dk', 'en', 'eo', 'es', 'fi', 'fr', 'hr', 'it', 'ja', 'mk', 'nl', 'pl', 'pt', 'ru', 'sk', 'zh');
// 2.06 way of doing.
if (!$useindex) {
$extension = substr(strrchr($editfile, "."), 1);
} else {
// The extension is now set as a prefix separated by a _
$file_datas = explode("_", $editfile);
$extension = $file_datas[0];
// The file name is now based on the index of the oTemplate files
$file_index = $file_datas[1];
switch ($extension) {
case 'css':
$aTemplateFiles = (array) $oEditedTemplate->config->files_editable->css->filename;
break;
case 'js':
$aTemplateFiles = (array) $oEditedTemplate->config->files_editable->js->filename;
break;
default:
$aTemplateFiles = (array) $oEditedTemplate->config->files_editable->css->filename;
break;
}
$editfile = $aTemplateFiles[$file_index];
}
if ($extension == 'css' || $extension == 'js') {
$highlighter = $extension;
} else {
$highlighter = 'html';
}
if (in_array(Yii::app()->session['adminlang'], $availableeditorlanguages)) {
$codelanguage = Yii::app()->session['adminlang'];
} else {
$codelanguage = 'en';
}
$templates = getTemplateList();
if (!isset($templates[$templatename])) {
$templatename = Yii::app()->getConfig('defaulttemplate');
}
$normalfiles = array("DUMMYENTRY", ".", "..", "preview.png");
foreach ($files as $fl) {
$normalfiles[] = $fl["name"];
}
foreach ($cssfiles as $fl) {
$normalfiles[] = $fl["name"];
}
// Some global data
$aData['sitename'] = Yii::app()->getConfig('sitename');
$siteadminname = Yii::app()->getConfig('siteadminname');
$siteadminemail = Yii::app()->getConfig('siteadminemail');
// Set this so common.php doesn't throw notices about undefined variables
$thissurvey['active'] = 'N';
// FAKE DATA FOR TEMPLATES
$thissurvey['name'] = gT("Template Sample");
$thissurvey['description'] = "<p>" . gT('This is a sample survey description. It could be quite long.') . "</p>" . "<p>" . gT("But this one isn't.") . "<p>";
$thissurvey['welcome'] = "<p>" . gT('Welcome to this sample survey') . "<p>" . "<p>" . gT('You should have a great time doing this') . "<p>";
$thissurvey['allowsave'] = "Y";
$thissurvey['active'] = "Y";
$thissurvey['tokenanswerspersistence'] = "Y";
$thissurvey['templatedir'] = $templatename;
$thissurvey['format'] = "G";
$thissurvey['surveyls_url'] = "http://www.limesurvey.org/";
$thissurvey['surveyls_urldescription'] = gT("Some URL description");
$thissurvey['usecaptcha'] = "A";
$percentcomplete = makegraph(6, 10);
$groupname = gT("Group 1: The first lot of questions");
$groupdescription = gT("This group description is fairly vacuous, but quite important.");
$navigator = $this->getController()->render('/admin/templates/templateeditor_navigator_view', array('screenname' => $screenname), true);
开发者ID:kochichi,项目名称:LimeSurvey,代码行数:67,代码来源:templates.php
示例12: getLanguage
<?php
$body = "";
$languages = Docebo::langManager()->getAllLanguages(true);
//getAllLangCode();
$std_lang = getLanguage();
$body .= Form::openForm('addfolder_form', "ajax.adm_server.php?r=" . $this->link . "/createfolder");
$body .= Form::getHidden('addfolder_id_parent', 'id_parent', $id_parent);
$body .= Form::getTextfield(Lang::t('_CODE', 'organization_chart'), 'org_code', 'org_code', 50);
$body .= Form::getDropdown(Lang::t('_DEFAULTTEMPLATE', 'configuration'), 'associated_template', 'associated_template', getTemplateList(), $default_template);
$body .= Form::getBreakRow();
foreach ($languages as $language) {
$lang_code = $language['code'];
$lang_name = $language['description'];
$body .= Form::getTextfield($lang_code, 'newfolder_' . $lang_code, 'langs[' . $lang_code . ']', 255);
}
$body .= Form::closeForm();
if (isset($json)) {
$output['header'] = $title;
$output['body'] = $body;
echo $json->encode($output);
} else {
echo '<h2>' . $title . '</h2>';
echo $body;
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:25,代码来源:add_folder.php
示例13: array
$aSettingsUpdate[$sName] = array('type' => 'link', 'label' => $sLabel, 'text' => gt("Use ComfortUpdate"), 'link' => $this->createUrl("admin/update", array('sa' => 'index', 'build' => $aUpdateVersion['build'])), 'htmlOptions' => array('class' => 'button', 'target' => '_top'), 'help' => sprintf(gT('You can %s and % manually or use the %s'), CHtml::link(gT("download"), $sDownloadLink, array('target' => '_blank')), CHtml::link(gT("update"), "http://manual.limesurvey.org/Upgrading_from_a_previous_version", array('target' => '_blank')), CHtml::link(gT("3-Click ComfortUpdate"), "http://manual.limesurvey.org/ComfortUpdate", array('target' => '_blank'))));
}
} elseif (isset($updateinfo['errorcode'])) {
$aSettingsUpdate['updateavailable'] = array('type' => 'info', 'label' => sprintf(gT('There was an error on update check (%s)'), $updateinfo['errorcode']), 'content' => CHtml::tag('pre', array(), strip_tags($updateinfo['errorhtml'])));
} elseif ($updatable) {
$aSettingsUpdate['updateavailable'] = array('type' => 'info', 'content' => gT('There is currently no newer LimeSurvey version available.'));
} else {
$aSettingsUpdate['updateavailable'] = array('type' => 'info', 'content' => sprintf(gT('This is an unstable version and cannot be updated using ComfortUpdate. Please check %s regularly for a newer version.'), CHtml::link(gT("our website"), "http://www.limesurvey.org")));
}
$this->widget('ext.SettingsWidget.SettingsWidget', array('title' => gt("Updates"), 'form' => false, 'formHtmlOptions' => array('class' => 'form-core'), 'inlist' => true, 'settings' => $aSettingsUpdate));
?>
</div>
<?php
// General seetings in one part
// Preparing array
$aTemplateNames = array_keys(getTemplateList());
$aAdminThemes = array_keys(getAdminThemeList());
$dateformatdata = getDateFormatData(Yii::app()->session['dateformat']);
$aGeneralSettings = array('info_general' => array(), 'sitename' => array('type' => 'string', 'label' => gT("Site name") . $sStringDemoMode, 'labelOptions' => array('class' => $sClassDemoMode), 'current' => getGlobalSetting('sitename'), 'htmlOptions' => array('readonly' => $bDemoMode)), 'defaulttemplate' => array('type' => 'select', 'label' => gT('Default template') . $sStringDemoMode, 'labelOptions' => array('class' => $sClassDemoMode), 'htmlOptions' => array('readonly' => $bDemoMode), 'options' => array_combine($aTemplateNames, $aTemplateNames), 'current' => Template::templateNameFilter(getGlobalSetting('defaulttemplate'))), 'admintheme' => array('type' => 'select', 'label' => gT('Administration template') . $sStringDemoMode, 'labelOptions' => array('class' => $sClassDemoMode), 'htmlOptions' => array('readonly' => $bDemoMode), 'options' => array_combine($aAdminThemes, $aAdminThemes), 'current' => getGlobalSetting('admintheme')), 'defaulthtmleditormode' => array('type' => 'select', 'label' => gT('Default HTML editor mode') . $sStringDemoMode, 'labelOptions' => array('class' => $sClassDemoMode), 'htmlOptions' => array('readonly' => $bDemoMode), 'options' => array('none' => gT("No HTML editor", 'unescaped'), 'inline' => gT("Inline HTML editor (default)", 'unescaped'), 'popup' => gT("Popup HTML editor", 'unescaped')), 'current' => getGlobalSetting('defaulthtmleditormode')), 'defaultquestionselectormode' => array('type' => 'select', 'label' => gT('Question type selector') . $sStringDemoMode, 'labelOptions' => array('class' => $sClassDemoMode), 'htmlOptions' => array('readonly' => $bDemoMode), 'options' => array('default' => gT("Full selector (default)", 'unescaped'), 'none' => gT("Simple selector", 'unescaped')), 'current' => getGlobalSetting('defaultquestionselectormode')), 'defaulttemplateeditormode' => array('type' => 'select', 'label' => gT('Template editor') . $sStringDemoMode, 'labelOptions' => array('class' => $sClassDemoMode), 'htmlOptions' => array('readonly' => $bDemoMode), 'options' => array('default' => gT("Full template editor (default)", 'unescaped'), 'none' => gT("Simple template editor", 'unescaped')), 'current' => getGlobalSetting('defaulttemplateeditormode')), 'timeadjust' => array('type' => 'float', 'label' => gt("Time difference (in hours)"), 'current' => str_replace(array('+', ' hours', ' minutes'), array('', '', ''), getGlobalSetting('timeadjust')) / 60, 'help' => sprintf(gT("Server time: %s - Corrected time: %s"), convertDateTimeFormat(date('Y-m-d H:i:s'), 'Y-m-d H:i:s', $dateformatdata['phpdate'] . ' H:i'), convertDateTimeFormat(dateShift(date("Y-m-d H:i:s"), 'Y-m-d H:i:s', getGlobalSetting('timeadjust')), 'Y-m-d H:i:s', $dateformatdata['phpdate'] . ' H:i'))), 'iSessionExpirationTime' => array(), 'GeoNamesUsername' => array('type' => 'string', 'label' => 'GeoNames username for API', 'current' => getGlobalSetting('GeoNamesUsername'), 'htmlOptions' => array('size' => '35')), 'googleMapsAPIKey' => array('type' => 'string', 'label' => 'Google Maps API key', 'current' => getGlobalSetting('googleMapsAPIKey'), 'htmlOptions' => array('size' => '35')), 'ipInfoDbAPIKey' => array('type' => 'string', 'label' => 'IP Info DB API Key', 'current' => getGlobalSetting('ipInfoDbAPIKey'), 'htmlOptions' => array('size' => '35')), 'googleanalyticsapikey' => array('type' => 'string', 'label' => 'Google Analytics API key', 'current' => getGlobalSetting('googleanalyticsapikey'), 'htmlOptions' => array('size' => '35')), 'googletranslateapikey' => array('type' => 'string', 'label' => 'Google Translate API key', 'current' => getGlobalSetting('googletranslateapikey'), 'htmlOptions' => array('size' => '35')));
if (isset(Yii::app()->session->connectionID)) {
$aGeneralSettings["iSessionExpirationTime"] = array('type' => 'int', 'label' => 'Session lifetime for surveys (seconds)', 'current' => getGlobalSetting('iSessionExpirationTime'), 'htmlOptions' => array('style' => 'width:10em', 'min' => 1));
}
if ($bDemoMode) {
$aGeneralSettings['info_general'] = array('type' => 'info', 'class' => 'alert', 'label' => gt("Note"), 'content' => gt("Demo mode is activated. Some settings can't be changed."));
}
$this->widget('ext.SettingsWidget.SettingsWidget', array('id' => 'general', 'form' => false, 'formHtmlOptions' => array('class' => 'form-core'), 'inlist' => true, 'settings' => $aGeneralSettings));
?>
<div id='email'>
<?php
// Email in 2 part : User and SMTP
开发者ID:kalckhoff,项目名称:LimeSurvey,代码行数:31,代码来源:globalSettings_view.php
示例14: getDefaultTemplate
/**
* Search for the default template
* @return string the default template saved in database
*/
function getDefaultTemplate($platform = false)
{
$plat_templ = Get::sett('defaultTemplate');
if (is_dir(_base_ . '/templates/' . $plat_templ)) {
return $plat_templ;
} else {
return array_pop(getTemplateList());
}
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:13,代码来源:lib.template.php
示例15: getSettingsTable
$region = CAT_Helper_Validate::get('_REQUEST', 'template');
$tpl = 'backend_settings_index_' . $region . '.tpl';
$data = getSettingsTable();
$tpl_data = array('values' => $data);
$tpl_data['DISPLAY_ADVANCED'] = $users->checkPermission('Settings', 'settings_advanced');
switch ($region) {
case 'frontend':
$tpl_data['templates'] = getTemplateList('frontend');
$tpl_data['variants'] = array();
$info = CAT_Helper_Addons::checkInfo(CAT_PATH . '/templates/' . CAT_Registry::get('DEFAULT_TEMPLATE'));
if (isset($info['module_variants']) && is_array($info['module_variants']) && count($info['module_variants'])) {
$tpl_data['variants'] = $info['module_variants'];
}
break;
case 'backend':
$tpl_data['backends'] = getTemplateList('backend');
$tpl_data['wysiwyg'] = CAT_Helper_Addons::get_addons(CAT_Registry::get('WYSIWYG_EDITOR'), 'module', 'wysiwyg');
$tpl_data['variants'] = array();
$info = CAT_Helper_Addons::checkInfo(CAT_PATH . '/templates/' . CAT_Registry::get('DEFAULT_THEME'));
if (isset($info['module_variants']) && is_array($info['module_variants']) && count($info['module_variants'])) {
$tpl_data['variants'] = $info['module_variants'];
}
break;
case 'system':
$tpl_data['er_levels'] = getErrorLevels();
$tpl_data['PAGES_LIST'] = getPagesList('maintenance_page', CAT_Registry::get('MAINTENANCE_PAGE'));
$tpl_data['ERR_PAGES_LIST'] = getPagesList('err_page_404', CAT_Registry::get('ERR_PAGE_404'));
break;
case 'users':
$tpl_data['groups'] = $users->get_groups(CAT_Registry::get('FRONTEND_SIGNUP'), '', false);
break;
开发者ID:ircoco,项目名称:BlackCatCMS,代码行数:31,代码来源:ajax_get_settings.php
示例16: modfolder
public function modfolder()
{
//check permissions
if (!$this->permissions['mod_org']) {
$output = array('success' => false, 'message' => $this->_getErrorMessage('no permission'));
echo $this->json->encode($output);
return;
}
$output = array();
$id = Get::req('node_id', DOTY_INT, -1);
$code = Get::req('org_code', DOTY_STRING, '');
$template_id = Get::req('associated_template', DOTY_INT, '');
$template_arr = getTemplateList();
$langs = Get::req('modfolder', DOTY_MIXED, false);
$res = $this->model->modFolderCodeAndTemplate($id, $code, $template_arr[$template_id]);
$res = $this->model->renameFolder($id, $langs);
if ($res) {
$output['success'] = true;
//$output['new_name'] = ($code != "" ? '['.$code.'] ' : '').$langs[getLanguage()];
$output['new_name'] = $this->_formatFolderCode($id, $code) . $langs[getLanguage()];
} else {
$output['success'] = false;
$output['message'] = Lang::t('_CONNECTION_ERROR');
}
echo $this->json->encode($output);
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:26,代码来源:UsermanagementAdmController.php
注:本文中的getTemplateList函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论