コード例 #1
0
 /**
  * Delete the template, along with its file
  * @return nothing
  */
 public function delete()
 {
     $file = PerchUtil::file_path(PERCH_TEMPLATE_PATH . '/pages/' . $this->templatePath());
     if (!PERCH_RUNWAY && file_exists($file)) {
         unlink($file);
     }
     parent::delete();
 }
コード例 #2
0
 public function delete()
 {
     $Items = new PerchContent_Items();
     $Items->delete_for_region($this->id());
     $r = parent::delete();
     $Perch = Perch::fetch();
     $Perch->event('region.delete', $this);
     return $r;
 }
コード例 #3
0
 public function delete()
 {
     $Categories = new PerchCategories_Categories();
     $categories = $Categories->get_by('setID', $this->id());
     if (PerchUtil::count($categories)) {
         foreach ($categories as $Category) {
             $Category->delete();
         }
     }
     return parent::delete();
 }
コード例 #4
0
 public function delete()
 {
     if ($this->clean_resources && !$this->resourceInLibrary()) {
         $Perch = Perch::fetch();
         $bucket = $Perch->get_resource_bucket($this->resourceBucket());
         $file_path = PerchUtil::file_path($bucket['file_path'] . '/' . $this->resourceFile());
         if (file_exists($file_path) && !is_dir($file_path)) {
             unlink($file_path);
             PerchUtil::debug('Deleting resource: ' . $file_path);
         }
     }
     return parent::delete();
 }
コード例 #5
0
 public function to_array($template_ids = false)
 {
     $out = parent::to_array();
     if (isset($out['pageAttributes']) && $out['pageAttributes'] != '') {
         $dynamic_fields = PerchUtil::json_safe_decode($out['pageAttributes'], true);
         if (PerchUtil::count($dynamic_fields)) {
             foreach ($dynamic_fields as $key => $value) {
                 $out['perch_' . $key] = $value;
             }
         }
         $out = array_merge($dynamic_fields, $out);
     }
     $out = array_merge($out, PerchSystem::get_attr_vars());
     return $out;
 }