/** * Get the $info array for $title for use with $gp_titles * @static */ function GetInfo($title) { global $dataDir; static $trash_titles = false; if ($trash_titles === false) { $trash_titles = admin_trash::TrashFiles(); } if (!isset($trash_titles[$title])) { return false; } $title_info = $trash_titles[$title]; //make sure we have a label if (empty($title_info['label'])) { $title_info['label'] = admin_tools::LabelToSlug($title); } //make sure we have a file_type if (empty($title_info['type'])) { $trash_file = $dataDir . '/data/_trash/' . $title . '.php'; $title_info['type'] = admin_trash::GetTypes($trash_file); } //make sure we have a file name if (empty($title_info['file'])) { $title_info['file'] = $dataDir . '/data/_trash/' . $title . '.php'; } return $title_info; }
/** * Get the $info array for $title for use with $gp_titles * @static */ static function GetInfo($trash_index) { global $dataDir; static $trash_titles = false; if ($trash_titles === false) { $trash_titles = admin_trash::TrashFiles(); } if (!array_key_exists($trash_index, $trash_titles)) { return false; } $title_info = $trash_titles[$trash_index]; $trash_dir = $dataDir . '/data/_trash/' . $trash_index; //make sure we have a file or dir if (empty($title_info['rm_path'])) { if (empty($title_info['file'])) { $title_info['file'] = $trash_index . '.php'; } $title_info['rm_path'] = $dataDir . '/data/_trash/' . $title_info['file']; $title_info['page_file'] = $dataDir . '/data/_trash/' . $title_info['file']; } //make sure we have a label if (empty($title_info['label'])) { $title_info['label'] = admin_tools::LabelToSlug($trash_index); } //make sure we have a file_type if (empty($title_info['type'])) { $title_info['type'] = admin_trash::GetTypes($title_info['page_file']); } return $title_info; }