本文整理汇总了PHP中Section::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Section::setDescription方法的具体用法?PHP Section::setDescription怎么用?PHP Section::setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section::setDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public static function add($name, $description = "", $grantAdmin = true)
{
$sectionManager = new Section();
if ($sectionManager->rowCount(array('label' => $name)) == 0) {
$sectionManager->setLabel($name);
$sectionManager->setDescription($description);
$sectionManager->save();
if ($grantAdmin) {
$right = new Right();
$right = $right->load(array('section' => $sectionManager->getLabel(), 'rank' => 1));
$right = !$right ? new Right() : $right;
$right->setSection($sectionManager->getId());
$right->setCreate(1);
$right->setRead(1);
$right->setUpdate(1);
$right->setDelete(1);
$right->setRank(1);
$right->save();
}
}
}
示例2: underscore
camp_html_add_msg(getGS('You must fill in the $1 field.','"'.getGS('Name').'"'));
}
if ($cShortName == "") {
camp_html_add_msg(getGS('You must fill in the $1 field.','"'.getGS('URL Name').'"'));
}
$isValidShortName = camp_is_valid_url_name($cShortName);
if (!$isValidShortName) {
camp_html_add_msg(getGS('The $1 field may only contain letters, digits and underscore (_) character.', '"' . getGS('URL Name') . '"'));
}
$editUrl = "/$ADMIN/sections/edit.php?Pub=$Pub&Issue=$Issue&Language=$Language&Section=$Section";
if (!camp_html_has_msgs()) {
$modified = true;
$modified &= $sectionObj->setName($cName);
$modified &= $sectionObj->setDescription($cDescription);
$modified &= $sectionObj->setSectionTemplateId($cSectionTplId);
$modified &= $sectionObj->setArticleTemplateId($cArticleTplId);
if ($cSubs == "a") {
$numSubscriptionsAdded = Subscription::AddSectionToAllSubscriptions($Pub, $Section);
if ($numSubscriptionsAdded < 0) {
$errors[] = getGS('Error updating subscriptions.');
}
}
if ($cSubs == "d") {
$numSubscriptionsDeleted = Subscription::DeleteSubscriptionsInSection($Pub, $Section);
if ($numSubscriptionsDeleted < 0) {
$errors[] = getGS('Error updating subscriptions.');
}
}
示例3: showEditSectionRes
function showEditSectionRes()
{
$displaySysAdmin = new DisplaySysAdmin();
$survey = new Survey($_SESSION['SUID']);
$seid = getFromSessionParams('seid');
$content = "";
if ($seid != '') {
//edit
$section = $survey->getSection($seid);
$_SESSION['SEID'] = $seid;
$content = $displaySysAdmin->displaySuccess(Language::messageSectionChanged(loadvar(SETTING_NAME)));
} else {
//add section!
if (loadvar(SETTING_NAME) != "") {
$section = new Section();
$section->setSuid($_SESSION['SUID']);
$content = $displaySysAdmin->displaySuccess(Language::messageSectionAdded(loadvar(SETTING_NAME)));
}
}
$checker = new Checker($_SESSION['SUID']);
if ($seid == '') {
$checks = $checker->checkName(loadvar(SETTING_NAME));
if (sizeof($checks) > 0) {
$content = implode("<br/>", $checks);
return $this->showAddSection($content);
}
}
//ADD ALL SORTS OF CHECKS!!
if ($seid != '' || loadvar(SETTING_NAME) != "") {
$section->setName(trim(loadvar(SETTING_NAME)));
$section->setDescription(loadvar(SETTING_DESCRIPTION));
$section->setHidden(loadvar(SETTING_HIDDEN));
$section->setHeader(loadvarAllowHTML(SETTING_SECTION_HEADER));
$section->setFooter(loadvarAllowHTML(SETTING_SECTION_FOOTER));
$section->save();
$checks = $checker->checkSection($section);
if (sizeof($checks) > 0) {
$content .= $displaySysAdmin->displayError(implode("<br/>", $checks));
}
}
/* compile */
$compiler = new Compiler($_SESSION['SUID'], getSurveyVersion($survey));
$mess = $compiler->generateSections(array($section));
$mess = $compiler->generateGetFillsSections(array($section));
$mess = $compiler->generateInlineFieldsSections(array($section));
/* update last page */
$_SESSION['LASTPAGE'] = substr($_SESSION['LASTPAGE'], 0, strripos($_SESSION['LASTPAGE'], "res"));
if ($seid != '') {
return $displaySysAdmin->showEditSection($_SESSION['SEID'], $content);
} else {
return $displaySysAdmin->showSurvey($content);
}
}