protected function buildInternal() { parent::buildInternal(); $item_list = $this->getItemList('integer'); $instance_id = $this->app->getInstanceId(); $dep = new AdminListDependency(); $dep->setTitle(Blorg::_('post'), Blorg::_('posts')); $sql = sprintf('select id, title, bodytext from BlorgPost where instance %s %s and id in (%s) order by publish_date desc, title', SwatDB::equalityOperator($instance_id), $this->app->db->quote($instance_id, 'integer'), $item_list); $posts = SwatDB::query($this->app->db, $sql, 'BlorgPostWrapper'); $entries = array(); foreach ($posts as $post) { $entry = new AdminDependencyEntry(); $entry->id = $post->id; $entry->title = $post->getTitle(); $entry->status_level = AdminDependency::DELETE; $entry->parent = null; $entries[] = $entry; } $dep->entries = $entries; $message = $this->ui->getWidget('confirmation_message'); $message->content = $dep->getMessage(); $message->content_type = 'text/xml'; if ($dep->getStatusLevelCount(AdminDependency::DELETE) == 0) { $this->switchToCancelButton(); } }
public function buildInternal() { parent::buildInternal(); $item_list = $this->getItemList('integer'); $instance_id = $this->app->getInstanceId(); $where_clause = sprintf('id in (%s) and instance %s %s', $item_list, SwatDB::equalityOperator($instance_id), $this->app->db->quote($instance_id, 'integer')); $dep = new AdminListDependency(); $dep->setTitle(Pinhole::_('photographer'), Pinhole::_('photographers')); $dep->entries = AdminListDependency::queryEntries($this->app->db, 'PinholePhotographer', 'integer:id', null, 'text:fullname', 'fullname', $where_clause, AdminDependency::DELETE); $message = $this->ui->getWidget('confirmation_message'); $message->content = $dep->getMessage(); $message->content_type = 'text/xml'; }
protected function buildInternal() { parent::buildInternal(); $item_list = $this->getItemList('integer'); $dep = new AdminListDependency(); $dep->setTitle('tag', 'tags'); $dep->entries = AdminListDependency::queryEntries($this->app->db, 'BlorgTag', 'integer:id', null, 'text:title', 'id', 'id in (' . $item_list . ')', AdminDependency::DELETE); $message = $this->ui->getWidget('confirmation_message'); $message->content = $dep->getMessage(); $message->content_type = 'text/xml'; if ($dep->getStatusLevelCount(AdminDependency::DELETE) == 0) { $this->switchToCancelButton(); } }
protected function buildInternal() { AdminDBDelete::buildInternal(); $item_list = $this->getItemList('integer'); $instance_id = $this->app->getInstanceId(); $where_clause = sprintf('id in (%s) and instance %s %s', $item_list, SwatDB::equalityOperator($instance_id), $this->app->db->quote($instance_id, 'integer')); $dep = new AdminListDependency(); $dep->setTitle(Site::_('article'), Site::_('articles')); $dep->entries = AdminListDependency::queryEntries($this->app->db, 'Article', 'integer:id', null, 'text:title', 'title', $where_clause, AdminDependency::DELETE); $this->getDependencies($dep, $item_list); $message = $this->ui->getWidget('confirmation_message'); $message->content = $dep->getMessage(); $message->content_type = 'text/xml'; if ($dep->getStatusLevelCount(AdminDependency::DELETE) === 0) { $this->switchToCancelButton(); } }
protected function buildInternal() { parent::buildInternal(); $item_list = $this->getItemList('integer'); $blocks = SwatDB::query($this->app->db, sprintf('select * from Block where id in (%s)', $this->getItemList('integer')), SwatDBClassMap::get('BuildingBlockWrapper')); $view = SiteViewFactory::get($this->app, 'building-block'); $view->getImageView()->setImageDimensionShortname('thumb'); ob_start(); $header = new SwatHtmlTag('h1'); $header->setContent('Delete the following content?'); $header->display(); foreach ($blocks as $block) { $view->display($block); } $message = $this->ui->getWidget('confirmation_message'); $message->content = ob_get_clean(); $message->content_type = 'text/xml'; }
protected function buildInternal() { parent::buildInternal(); $item_list = $this->getItemList('integer'); $instance_id = $this->app->getInstanceId(); $where_clause = sprintf('id in (%s) and instance %s %s', $item_list, SwatDB::equalityOperator($instance_id), $this->app->db->quote($instance_id, 'integer')); $dep = new AdminListDependency(); $dep->setTitle('author', 'authors'); $dep->entries = AdminListDependency::queryEntries($this->app->db, 'BlorgAuthor', 'integer:id', null, 'text:name', 'id', $where_clause, AdminDependency::DELETE); $dep_posts = new AdminSummaryDependency(); $dep_posts->setTitle(Blorg::_('post'), Blorg::_('posts')); $dep_posts->summaries = AdminSummaryDependency::querySummaries($this->app->db, 'BlorgPost', 'integer:id', 'integer:author', 'author in (' . $item_list . ')', AdminDependency::NODELETE); $dep->addDependency($dep_posts); $message = $this->ui->getWidget('confirmation_message'); $message->content = $dep->getMessage(); $message->content_type = 'text/xml'; if ($dep->getStatusLevelCount(AdminDependency::DELETE) == 0) { $this->switchToCancelButton(); } }
protected function buildInternal() { parent::buildInternal(); if ($this->extended_selected) { $message = $this->ui->getWidget('confirmation_message'); $message->content = Pinhole::_('Are you sure you want ' . 'to delete <strong>all tags</strong>?'); $message->content_type = 'text/xml'; } else { $item_list = $this->getItemList('integer'); $instance_id = $this->app->getInstanceId(); $where_clause = sprintf('id in (%s) and instance %s %s', $item_list, SwatDB::equalityOperator($instance_id), $this->app->db->quote($instance_id, 'integer')); $dep = new AdminListDependency(); $dep->setTitle(Pinhole::_('tag'), Pinhole::_('tags')); $dep->entries = AdminListDependency::queryEntries($this->app->db, 'PinholeTag', 'integer:id', null, 'text:title', 'title', $where_clause, AdminDependency::DELETE); $message = $this->ui->getWidget('confirmation_message'); $message->content = $dep->getMessage(); $message->content_type = 'text/xml'; if ($dep->getStatusLevelCount(AdminDependency::DELETE) == 0) { $this->switchToCancelButton(); } } }
protected function buildInternal() { parent::buildInternal(); $dep = new AdminListDependency(); $dep->setTitle(Deliverance::_('newsletter'), Deliverance::_('newsletters')); $entries = array(); $newsletters = $this->getNewsletters(); foreach ($newsletters as $newsletter) { $entry = new AdminDependencyEntry(); $entry->title = $newsletter->getCampaignTitle(); $entry->status_level = $newsletter->isSent() ? AdminDependency::NODELETE : AdminDependency::DELETE; $entries[] = $entry; } $dep->entries = $entries; $message = $this->ui->getWidget('confirmation_message'); $message->content = $dep->getMessage(); $message->content_type = 'text/xml'; if ($dep->getStatusLevelCount(AdminDependency::DELETE) == 0) { $this->switchToCancelButton(); } }
public function finalize() { parent::finalize(); $this->layout->addHtmlHeadEntry(new SwatStyleSheetHtmlHeadEntry('packages/pinhole/admin/styles/pinhole-photo-tile.css', Pinhole::PACKAGE_ID)); }
protected function buildNavBar() { parent::buildNavBar(); // build the navbar like we're in the Post component because it's the // only way this delete page gets loaded. In the Comment component, // comments get deleted with the AJAX server. $this->navbar->popEntry(); $this->navbar->popEntry(); $this->navbar->addEntry(new SwatNavBarEntry(Blorg::_('Posts'), 'Post')); $this->navbar->addEntry(new SwatNavBarEntry($this->post->getTitle(), sprintf('Post/Details?id=%s', $this->post->id))); $this->navbar->addEntry(new SwatNavBarEntry(Blorg::_('Delete Comments'))); }
protected function buildNavBar() { parent::buildNavBar(); $this->navbar->popEntries(1); $this->navbar->createEntry(CME::ngettext('Delete CME Front Matter', 'Delete CME Front Matters', count($this->items))); }