611,7 → 611,17 |
return $show; |
} |
|
public function showSectionsForm($sectionID = 0, $info = '') { |
/** |
* Вывод формы редактирования/добавления секций |
* |
* @author Alexander Wolf |
* @category Core |
* |
* @param integer $sectionID |
* @param string $info |
* @return string |
*/ |
public function showSectionsForm($sectionID = 0, $info = "") { |
$sSectID = $this->secure->checkInt($sectionID); |
$sInfo = $this->secure->checkStr($info, 1); |
if ($sInfo == "") { |
633,6 → 643,88 |
} |
|
/** |
* Обновление информации о секции |
* |
* @author Alexander Wolf |
* @category Core |
* |
* @param integer $sectionID |
* @param string $sname |
* @param string $sinfo |
* @return array |
*/ |
public function updateSection($sectionID, $sname, $sinfo = "") { |
$result = array(); |
$sSectID = $this->secure->checkInt($sectionID); |
$sSName = $this->secure->checkStr($sname,1); |
$sSInfo = $this->secure->checkStr($sinfo,1); |
|
$query = "UPDATE ".$this->prefix."section SET secname='".$sSName."', sectinfo='".$sSInfo."' WHERE sect_id='".$sSectID."'"; |
$rq =& $this->db->query($query); |
if (PEAR::isError($this->db)) { |
$result["ERR"] = 1; |
$result["ERRINFO"] = $this->db->getMessage(); |
} else { |
$result["ERR"] = 0; |
} |
|
return $result; |
} |
|
/** |
* Удаление информации о секции |
* |
* @author Alexander Wolf |
* @category Core |
* |
* @param integer $sectionID |
* @return array |
*/ |
public function dropSection($sectionID) { |
$result = array(); |
$sSectID = $this->secure->checkInt($sectionID); |
|
// Удаление секции |
$query = "DELETE FROM ".$this->prefix."section WHERE sect_id='".$sSectID."'"; |
$rq =& $this->db->query($query); |
if (PEAR::isError($this->db)) { |
$result["ERR"] = 1; |
$result["ERRINFO"] = $this->db->getMessage(); |
} else { |
$result["ERR"] = 0; |
} |
|
return $result; |
} |
|
/** |
* Добавление новой секции |
* |
* @author Alexander Wolf |
* @category Core |
* |
* @param string $sname |
* @param string $sinfo |
* @return array |
*/ |
public function addSection($sname, $sinfo = "") { |
$result = array(); |
$sSName = $this->secure->checkStr($sname,1); |
$sSInfo = $this->secure->checkStr($sinfo,1); |
|
$query = "INSERT INTO ".$this->prefix."section SET secname='".$sSName."', sectinfo='".$sSInfo."'"; |
$rq =& $this->db->query($query); |
if (PEAR::isError($this->db)) { |
$result["ERR"] = 1; |
$result["ERRINFO"] = $this->db->getMessage(); |
} else { |
$result["ERR"] = 0; |
} |
|
return $result; |
} |
|
/** |
* Проверка пароля (из формы авторизации) |
* |
* @author Alexander Wolf |