本文整理汇总了PHP中path::saveElementPaths方法的典型用法代码示例。如果您正苦于以下问题:PHP path::saveElementPaths方法的具体用法?PHP path::saveElementPaths怎么用?PHP path::saveElementPaths使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类path
的用法示例。
在下文中一共展示了path::saveElementPaths方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public function update()
{
global $DB;
global $website;
$groups = '';
if (is_array($this->groups)) {
$this->groups = array_unique($this->groups);
// remove duplicates
$this->groups = array_filter($this->groups);
// remove empty
if (!empty($this->groups)) {
$groups = 'g' . implode(',g', $this->groups);
}
}
if ($groups == 'g') {
$groups = '';
}
$ok = $DB->execute('
UPDATE nv_structure
SET parent = :parent, position = :position, access = :access, groups = :groups,
permission = :permission, icon = :icon, metatags = :metatags,
date_published = :date_published, date_unpublish = :date_unpublish,
template = :template, visible = :visible, views = :views, votes = :votes, score = :score
WHERE id = :id
AND website = :website
', array(":id" => $this->id, ":website" => $this->website, ":parent" => value_or_default($this->parent, 0), ":position" => $this->position, ":access" => $this->access, ":groups" => $groups, ":permission" => $this->permission, ":icon" => value_or_default($this->icon, ''), ":metatags" => value_or_default($this->metatags, ''), ":template" => $this->template, ":date_published" => value_or_default($this->date_published, 0), ":date_unpublish" => value_or_default($this->date_unpublish, 0), ":visible" => $this->visible, ":views" => $this->views, ":votes" => $this->votes, ":score" => $this->score));
if (!$ok) {
throw new Exception($DB->get_last_error());
}
webdictionary::save_element_strings('structure', $this->id, $this->dictionary, $this->website);
path::saveElementPaths('structure', $this->id, $this->paths, $this->website);
return true;
}
示例2: update
public function update()
{
global $DB;
global $website;
global $events;
global $user;
if (!is_null($user)) {
if ($user->permission("items.edit") == 'false' && $this->author != $user->id) {
throw new Exception(t(610, "Sorry, you are not allowed to execute this function."));
}
if (!structure::category_allowed($this->category)) {
throw new Exception(t(610, "Sorry, you are not allowed to execute this function."));
}
}
$this->date_modified = core_time();
$groups = '';
if (is_array($this->groups)) {
$this->groups = array_unique($this->groups);
// remove duplicates
$this->groups = array_filter($this->groups);
// remove empty
if (!empty($this->groups)) {
$groups = 'g' . implode(',g', $this->groups);
}
}
if ($groups == 'g') {
$groups = '';
}
$ok = $DB->execute('
UPDATE nv_items
SET
association = :association,
category = :category,
embedding = :embedding,
template = :template,
date_to_display = :date_to_display,
date_published = :date_published,
date_unpublish = :date_unpublish,
date_modified = :date_modified,
author = :author,
galleries = :galleries,
comments_enabled_to = :comments_enabled_to,
comments_moderator = :comments_moderator,
access = :access,
groups = :groups,
permission = :permission,
views = :views,
votes = :votes,
score = :score,
position = :position
WHERE id = :id
AND website = :website', array(":association" => $this->association, ":category" => $this->category, ":embedding" => $this->embedding, ":template" => $this->template, ":date_to_display" => value_or_default($this->date_to_display, 0), ":date_published" => value_or_default($this->date_published, 0), ":date_unpublish" => value_or_default($this->date_unpublish, 0), ":date_modified" => $this->date_modified, ":author" => $this->author, ":galleries" => serialize($this->galleries), ":comments_enabled_to" => value_or_default($this->comments_enabled_to, 0), ":comments_moderator" => value_or_default($this->comments_moderator, 0), ":access" => $this->access, ":groups" => $groups, ":permission" => $this->permission, ":views" => $this->views, ":votes" => $this->votes, ":score" => $this->score, ":position" => value_or_default($this->position, 0), ":id" => $this->id, ":website" => $this->website));
if (!$ok) {
throw new Exception($DB->get_last_error());
}
webdictionary::save_element_strings('item', $this->id, $this->dictionary, $this->website);
webdictionary_history::save_element_strings('item', $this->id, $this->dictionary, false, $this->website);
path::saveElementPaths('item', $this->id, $this->paths, $this->website);
$events->trigger('item', 'save', array('item' => $this));
return true;
}
示例3: update
public function update()
{
global $DB;
if (!is_array($this->categories)) {
$this->categories = array();
}
$ok = $DB->execute('
UPDATE nv_feeds
SET categories = :categories, format = :format, image = :image, entries = :entries,
content = :content, views = :views, permission = :permission, enabled = :enabled
WHERE id = :id AND website = :website', array('id' => $this->id, 'website' => $this->website, 'categories' => implode(',', $this->categories), 'format' => $this->format, 'image' => value_or_default($this->image, 0), 'entries' => value_or_default($this->entries, 10), 'content' => $this->content, 'views' => value_or_default($this->views, 0), 'permission' => value_or_default($this->permission, 0), 'enabled' => value_or_default($this->enabled, 0)));
if (!$ok) {
throw new Exception($DB->get_last_error());
}
webdictionary::save_element_strings('feed', $this->id, $this->dictionary);
path::saveElementPaths('feed', $this->id, $this->paths);
return true;
}