本文整理汇总了PHP中ActivityModel::updateInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP ActivityModel::updateInfo方法的具体用法?PHP ActivityModel::updateInfo怎么用?PHP ActivityModel::updateInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActivityModel
的用法示例。
在下文中一共展示了ActivityModel::updateInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editInfo
public function editInfo($post_id = NULL)
{
if (in_array(Auth::getCapability(), array(CAPABILITY_ADMINISTRATOR))) {
Model::autoloadModel('activity');
$model = new ActivityModel($this->db);
$this->para = new stdClass();
if (isset($_POST['activity'])) {
$this->para->post_id = $_POST['activity'];
} elseif (isset($post_id) && !is_null($post_id)) {
$this->para->post_id = $post_id;
}
if (isset($this->para->post_id)) {
if (isset($_POST['action']) && $_POST['action'] == "update") {
$this->para->action = $_POST['action'];
if (isset($_POST['post_title'])) {
$this->para->post_title = trim($_POST['post_title']);
}
if (isset($_POST['country_id']) && isset($_POST['country_id']) != "" && $_POST['country_id'] != "0") {
$this->para->country_id = $_POST['country_id'];
}
if (isset($_POST['city_id'])) {
$this->para->city_id = $_POST['city_id'];
}
if (isset($_POST['current_rating'])) {
$this->para->current_rating = $_POST['current_rating'];
}
if (isset($_POST['vote_times'])) {
$this->para->vote_times = $_POST['vote_times'];
}
if (isset($_POST['tag_list'])) {
$this->para->tag_list = $_POST['tag_list'];
}
if (isset($_POST['post_content'])) {
$this->para->post_content = trim($_POST['post_content']);
}
if (isset($_FILES['image']) && isset($_FILES['image']['name']) && $_FILES['image']['name'] != '') {
$this->para->image = $_FILES['image'];
}
$result = $model->updateInfo($this->para);
if (!$result) {
$this->view->para = $this->para;
} else {
$update_success = TRUE;
}
}
$this->view->activityBO = $model->get($this->para->post_id);
Model::autoloadModel('taxonomy');
$taxonomyModel = new TaxonomyModel($this->db);
$this->view->countryList = new SplDoublyLinkedList();
$taxonomyModel->getAllSorted($this->view->countryList, $taxonomyModel->buildTree($taxonomyModel->getAll("country")), -1);
$this->view->cityList = new SplDoublyLinkedList();
if (isset($this->view->activityBO->country_id) && $this->view->activityBO->country_id != "0") {
$taxonomyModel->getAllSorted($this->view->cityList, $taxonomyModel->buildTree($taxonomyModel->getByMetaData("city", "country", $this->view->activityBO->country_id)), -1);
}
if (isset($this->view->para) && isset($this->view->para->country_id)) {
$taxonomyModel->getAllSorted($this->view->cityList, $taxonomyModel->buildTree($taxonomyModel->getByMetaData("city", "country", $this->view->para->country_id)), -1);
}
if (isset($post_id) && !is_null($post_id)) {
$this->view->renderAdmin(RENDER_VIEW_ACTIVITY_EDIT);
} else {
$this->view->renderAdmin(RENDER_VIEW_ACTIVITY_EDIT, TRUE);
}
} else {
header('location: ' . URL . CONTEXT_PATH_ACTIVITY_INDEX);
}
} else {
$this->login();
}
}