本文整理汇总了PHP中Survey::getTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP Survey::getTypes方法的具体用法?PHP Survey::getTypes怎么用?PHP Survey::getTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Survey
的用法示例。
在下文中一共展示了Survey::getTypes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showSurvey
function showSurvey($message = "")
{
$survey = new Survey($_SESSION['SUID']);
$returnStr = $this->showTranslatorHeader(Language::messageSMSTitle());
$returnStr .= '<div id="wrap">';
$returnStr .= $this->showNavBar();
$returnStr .= '<div class="container">';
$returnStr .= '<ol class="breadcrumb">';
$returnStr .= '<li>' . setSessionParamsHref(array('page' => 'translator.surveys'), Language::headerSurveys()) . '</li>';
$returnStr .= '<li>' . $survey->getName() . '</li>';
if ($_SESSION['VRFILTERMODE_SURVEY'] == 0) {
$returnStr .= '<li class="active">' . Language::headerSections() . '</li>';
} else {
if ($_SESSION['VRFILTERMODE_SURVEY'] == 1) {
$returnStr .= '<li class="active">' . Language::headerSettings() . '</li>';
} else {
if ($_SESSION['VRFILTERMODE_SURVEY'] == 2) {
$returnStr .= '<li class="active">' . Language::headerTypes() . '</li>';
} else {
if ($_SESSION['VRFILTERMODE_SURVEY'] == 3) {
$returnStr .= '<li class="active">' . Language::headerGroups() . '</li>';
} else {
$returnStr .= '<li class="active">' . Language::headerSections() . '</li>';
}
}
}
}
$returnStr .= '</ol>';
$returnStr .= $this->getSurveyTopTab($_SESSION['VRFILTERMODE_SURVEY']);
$returnStr .= '<div class="well" style="background-color:white;">';
$returnStr .= $message;
$returnStr .= '<div class="row row-offcanvas row-offcanvas-right">';
$returnStr .= '<div id=sectiondiv class="col-xs-12 col-sm-9">';
if ($_SESSION['VRFILTERMODE_SURVEY'] == 0) {
$survey = new Survey($_SESSION['SUID']);
$sections = $survey->getSections();
$returnStr .= $this->showSections($sections);
} else {
if ($_SESSION['VRFILTERMODE_SURVEY'] == 1) {
$returnStr .= $this->showSettingsList();
} else {
if ($_SESSION['VRFILTERMODE_SURVEY'] == 2) {
$survey = new Survey($_SESSION['SUID']);
$types = $survey->getTypes();
$returnStr .= $this->showTypes($types);
} else {
if ($_SESSION['VRFILTERMODE_SURVEY'] == 3) {
$survey = new Survey($_SESSION['SUID']);
$groups = $survey->getGroups();
$returnStr .= $this->showGroups($groups);
} else {
$survey = new Survey($_SESSION['SUID']);
$sections = $survey->getSections();
$returnStr .= $this->showSections($sections);
}
}
}
}
$returnStr .= '</div>';
$returnStr .= $this->showSurveySideBar($survey, $_SESSION['VRFILTERMODE_SURVEY']);
$returnStr .= '</div>';
$returnStr .= '</div></div></div>';
//container and wrap
$returnStr .= $this->showBottomBar();
$returnStr .= $this->showFooter(false);
return $returnStr;
}
示例2: show_form
function show_form($page, $action, $qid, $type = 'new', $current = null)
{
$page->changeTpl('survey/edit_survey.tpl');
$page->assign('survey_action', $action);
$page->assign('survey_qid', $qid);
$page->assign('survey_formaction', './survey/edit');
$page->assign('survey_type', $type);
if (!is_null($current) && is_array($current)) {
$page->assign('survey_current', $current);
} elseif ($type == 'new') {
$page->addJsLink('ajax.js');
$page->assign('survey_types', Survey::getTypes());
}
if ($type == 'root' || $type == 'newsurvey') {
$page->assign('survey_modes', Survey::getModes());
}
}
示例3: showRemoveSurveyRes
function showRemoveSurveyRes()
{
/* update last page */
$_SESSION['LASTPAGE'] = 'sysadmin.surveys';
$displaySysAdmin = new DisplaySysAdmin();
$suid = getFromSessionParams('suid');
if ($suid != '') {
//remove
$survey = new Survey($suid);
/* remove sections */
$sections = $survey->getSections();
foreach ($sections as $section) {
$section->remove();
/* remove variables */
$variables = $survey->getVariableDescriptives($section->getSeid());
foreach ($variables as $variable) {
$variable->remove();
}
}
/* remove types */
$types = $survey->getTypes();
foreach ($types as $type) {
$type->remove();
}
/* remove types */
$groups = $survey->getGroups();
foreach ($groups as $group) {
$group->remove();
}
/* remove versions */
$versions = $survey->getVersions();
foreach ($versions as $version) {
$version->remove();
}
/* remove survey */
$survey->remove();
/* update users */
$users = new Users();
$users = $users->getUsers();
foreach ($users as $u) {
$u->removeSurvey($suid);
$u->saveChanges();
}
/* return result */
return $displaySysAdmin->showSurveys($displaySysAdmin->displaySuccess(Language::messageSurveyRemoved($survey->getName())));
} else {
return $displaySysAdmin->showSurveys();
}
}
示例4: showTypes
function showTypes()
{
$returnStr = '';
$survey = new Survey($_SESSION['SUID']);
$types = $survey->getTypes();
$displaySysAdmin = new DisplaySysAdmin();
$returnStr .= $displaySysAdmin->showTypes($types);
return $returnStr;
}
示例5: showAvailableTypes
function showAvailableTypes($current)
{
$survey = new Survey($_SESSION['SUID']);
$types = $survey->getTypes();
if (sizeof($types) == 0) {
return "";
}
$returnStr = '<tr><td>' . Language::labelTypeEditGeneralVariableType() . '</td><td>';
$returnStr .= "<select id='typeselect' class='selectpicker show-tick' name=" . SETTING_TYPE . ">";
$selected = "";
if ($current == "" || $current == -1) {
$selected = " SELECTED";
}
$returnStr .= "<option {$selected} value=-1>" . Language::optionTypeNone() . "</option>";
foreach ($types as $type) {
$selected = "";
if ($type->getTyd() == $current) {
$selected = " SELECTED";
}
$returnStr .= "<option {$selected} value=" . $type->getTyd() . ">" . $type->getName() . "</option>";
}
$returnStr .= "</select>";
$returnStr .= '</td></tr>';
$returnStr .= '<script type="text/javascript">
$( document ).ready(function() {
$("#typeselect").change(function() {
if (this.value == -1) {
$("#arraytypeoption").remove();
$("#keeptypeoption").remove();
$("#answertypeoption").remove();
}
else {
$("#arraydrop option:first").after($("<option />", { "value": "' . SETTING_FOLLOW_TYPE . '", text: "' . Language::optionsFollowType() . '", id: "arraytypeoption" }));
$("#keepdrop option:first").after($("<option />", { "value": "' . SETTING_FOLLOW_TYPE . '", text: "' . Language::optionsFollowType() . '", id: "keeptypeoption" }));
$("#answertype").prepend("<option value=\'' . SETTING_FOLLOW_TYPE . '\' id=\'answertypeoption\'>' . Language::optionsFollowType() . '</option>");
}
$("#arraydrop").selectpicker("refresh");
$("#keepdrop").selectpicker("refresh");
$("#answertype").selectpicker("refresh");
});
});
</script>';
return $returnStr;
}