本文整理匯總了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);
}
}