18 require_once SQ_CORE_PACKAGE_PATH.
'/folder/folder_edit_fns.inc';
43 $this->static_screens[
'details'][
'name'] =
'Purge Trash';
44 $this->static_screens[
'details'][
'lock_type'] =
'none';
45 unset($this->static_screens[
'permissions']);
46 unset($this->static_screens[
'workflow']);
47 unset($this->static_screens[
'metadataSchemas']);
48 unset($this->static_screens[
'metadata']);
49 unset($this->static_screens[
'dependants']);
50 unset($this->static_screens[
'linking']);
51 unset($this->static_screens[
'settings']);
52 unset($this->static_screens[
'history']);
53 unset($this->static_screens[
'preview']);
54 unset($this->static_screens[
'roles']);
55 unset($this->static_screens[
'tagging']);
56 unset($this->static_screens[
'lookupValues']);
57 unset($this->static_screens[
'layouts']);
74 if ($asset->purgeAccess()) {
75 $num_links = $GLOBALS[
'SQ_SYSTEM']->am->countLinks($asset->id);
78 echo translate(
'trash_is_empty');
82 $o->openField(translate(
'purge_root_node'));
83 asset_finder($prefix.
'_purge_root');
84 $o->note(translate(
'purge_root_note'));
87 $o->openField(translate(
'purge_trash'));
88 combo_box($prefix.
'_purge_trash', Array(0 => translate(
'no'), 1 => translate(
'yes')), FALSE, 0, 0,
"onChange=\"Javascript: if (this.value == 1) { if(!confirm(js_translate('confirm_purge_trash'))) { this.value = 0; } } \"");
89 $o->note(translate(
'trash_purge_warning'));
113 if (!$asset->purgeAccess())
return FALSE;
115 if (isset($_POST[$prefix.
'_purge_trash']) && $_POST[$prefix.
'_purge_trash']) {
117 $on_complete = $_SERVER[
'REQUEST_URI'].
'&'.$prefix.
'_purge_complete=1';
118 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
120 $purge_root_linkid = $_POST[$prefix.
'_purge_root'][
'linkid'];
121 $purge_root_assetid = $_POST[$prefix.
'_purge_root'][
'assetid'];
124 if (empty($purge_root_linkid) && !empty($purge_root_assetid)) {
125 $purge_root_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($purge_root_assetid,
'', TRUE);
126 if (!is_null($purge_root_asset)) {
127 $link_info = $GLOBALS[
'SQ_SYSTEM']->am->getLinkByAsset($asset->id, $purge_root_asset->id);
128 $purge_root_linkid = array_get_index($link_info,
'linkid',
'');
133 $hh->queueHipo(
'hipo_job_purge_trash', Array(
'purge_root_linkid' => $purge_root_linkid), $on_complete);
154 return $asset->purgeAccess();