本文整理汇总了PHP中Album::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Album::remove方法的具体用法?PHP Album::remove怎么用?PHP Album::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Album
的用法示例。
在下文中一共展示了Album::remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
if (empty($notify)) {
$notify = '&saved';
}
}
header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin-edit.php?page=edit' . $qs_albumsuffix . $notify . $pg . $returntab);
exit;
break;
/** DELETION ******************************************************************/
/*****************************************************************************/
/** DELETION ******************************************************************/
/*****************************************************************************/
case "deletealbum":
XSRFdefender('delete');
if ($folder) {
$album = new Album($gallery, $folder);
if ($album->remove()) {
$nd = 3;
} else {
$nd = 4;
}
if (isset($_GET['return'])) {
$albumdir = pathurlencode(sanitize($_GET['return'], 3));
} else {
$albumdir = dirname($folder);
if ($albumdir != '/' && $albumdir != '.') {
$albumdir = "&album=" . pathurlencode($albumdir);
} else {
$albumdir = '';
}
}
}
示例2: remove
/**
* Delete the entire album PERMANENTLY. Be careful! This is unrecoverable.
* Returns true if successful
*
* @return bool
*/
function remove()
{
if (parent::remove()) {
if (!$this->isDynamic()) {
foreach ($this->getAlbums() as $folder) {
$subalbum = new Album($this->gallery, $folder);
$subalbum->remove();
}
foreach ($this->getImages() as $filename) {
$image = newImage($this, $filename);
$image->remove();
}
$curdir = getcwd();
chdir($this->localpath);
$filelist = safe_glob('*');
foreach ($filelist as $file) {
if ($file != '.' && $file != '..') {
unlink($this->localpath . $file);
// clean out any other files in the folder
}
}
chdir($curdir);
}
query("DELETE FROM " . prefix('options') . "WHERE `ownerid`=" . $this->id);
query("DELETE FROM " . prefix('comments') . "WHERE `type`='albums' AND `ownerid`=" . $this->id);
query("DELETE FROM " . prefix('obj_to_tag') . "WHERE `type`='albums' AND `objectid`=" . $this->id);
$success = true;
if ($this->isDynamic()) {
$filestoremove = safe_glob(substr($this->localpath, 0, strrpos($this->localpath, '.')) . '.*');
} else {
$filestoremove = safe_glob(substr($this->localpath, 0, -1) . '.*');
}
foreach ($filestoremove as $file) {
if (in_array(strtolower(getSuffix($file)), $this->sidecars)) {
$success = $success && unlink($file);
}
}
if ($this->isDynamic()) {
return @unlink($this->localpath) && $success;
} else {
return @rmdir($this->localpath) && $success;
}
}
return false;
}
示例3: processAlbumBulkActions
/**
* Processes the check box bulk actions for albums
*
*/
function processAlbumBulkActions()
{
global $gallery;
$action = sanitize($_POST['checkallaction']);
$ids = $_POST['ids'];
$total = count($ids);
$message = NULL;
if ($action != 'noaction') {
if ($total > 0) {
if ($action == 'addtags' || $action == 'alltags') {
foreach ($_POST as $key => $value) {
$key = postIndexDecode($key);
if (substr($key, 0, 10) == 'mass_tags_') {
if ($value) {
$tags[] = substr($key, 10);
}
}
}
$tags = sanitize($tags, 3);
}
$n = 0;
foreach ($ids as $albumname) {
$n++;
$albumobj = new Album($gallery, $albumname);
switch ($action) {
case 'deleteall':
$albumobj->remove();
break;
case 'showall':
$albumobj->setShow(1);
break;
case 'hideall':
$albumobj->setShow(0);
break;
case 'commentson':
$albumobj->setCommentsAllowed(1);
break;
case 'commentsoff':
$albumobj->setCommentsAllowed(0);
break;
case 'resethitcounter':
$albumobj->set('hitcounter', 0);
break;
case 'addtags':
$mytags = array_unique(array_merge($tags, $albumobj->getTags()));
$albumobj->setTags($mytags);
break;
case 'cleartags':
$albumobj->setTags(array());
break;
case 'alltags':
$images = $albumobj->getImages();
foreach ($images as $imagename) {
$imageobj = newImage($albumobj, $imagename);
$mytags = array_unique(array_merge($tags, $imageobj->getTags()));
$imageobj->setTags($mytags);
$imageobj->save();
}
break;
case 'clearalltags':
$images = $albumobj->getImages();
foreach ($images as $imagename) {
$imageobj = newImage($albumobj, $imagename);
$imageobj->setTags(array());
$imageobj->save();
}
break;
}
$albumobj->save();
}
}
return $action;
}
}