Esempio n. 1
0
 /**
  * Show confirmation form before removing item from page
  */
 private function pageItems_Delete()
 {
     global $language;
     $id = fix_id($_REQUEST['id']);
     $manager = UserPageItemsManager::getInstance();
     // grab item from database
     $item = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id));
     if ($item->type == user_page::VIDEO) {
         // get video title
         $video_manager = YouTube_VideoManager::getInstance();
         $name = $video_manager->getItemValue('title', array('id' => $item->item));
     } else {
         // get gallery title
         $gallery_manager = GalleryGroupManager::getInstance();
         $name = $gallery_manager->getItemValue('name', array('id' => $item->item));
     }
     // create template
     $template = new TemplateHandler('confirmation.xml', $this->path . 'templates/');
     $template->setMappedModule($this->name);
     // parse template
     $params = array('message' => $this->getLanguageConstant('message_page_item_delete'), 'name' => $name, 'yes_text' => $this->getLanguageConstant('delete'), 'no_text' => $this->getLanguageConstant('cancel'), 'yes_action' => window_LoadContent('user_pages_items_delete', url_Make('transfer_control', 'backend_module', array('module', $this->name), array('backend_action', 'page_items_delete_commit'), array('id', $id))), 'no_action' => window_Close('user_pages_items_delete'));
     $template->restoreXML();
     $template->setLocalParams($params);
     $template->parse();
 }
Esempio n. 2
0
 /**
  * Create empty gallery
  * 
  * @param array $name Multi-language name
  * @return integer Id of newly created gallery
  */
 public function createEmptyGallery($name)
 {
     $gallery_manager = GalleryGroupManager::getInstance();
     // create gallery
     $gallery_manager->insertData(array('name' => $name));
     $result = $gallery_manager->getInsertedID();
     return $result;
 }