content->postqueue = ""; $this->content->viewmode = ""; $this->content->offset = 0; $this->content->limit = -1; } public function type() { return 'postqueue'; } public function build($editmode) { if($editmode) { if($this->grid){ return t("Postqueue: ".$this->content->postqueue. "
Offset: ".$this->content->offset." - Limit:".$this->content->limit); } else { return t("Postqueue"); } } else { return $this->content; } } public function contentStructure() { $cs = parent::contentStructure(); $store = new \Postqueue\Store(); $queues = $store->get_queues(); $qs = array(); foreach ($queues as $queue) { $qs[] = array("key"=>$queue->slug, "text"=>$queue->name); } $cs[] = array( 'key' => 'postqueue', 'label' => t('Postqueue'), 'type' => 'select', 'selections' => $qs, ); $viewmodes = \Postqueue\Plugin::getViewmodes(); if(count($viewmodes) > 0){ $cs[] = array( 'key' => 'viewmode', 'label' => t("Viewmode"), 'type' => "select", 'selections' => $viewmodes, ); } $cs[] = array( 'key' => 'offset', 'label' => 'Offset', 'type' => 'number', ); $cs[] = array( 'key' => 'limit', 'label' => 'Limit ', 'type' => 'number', ); $cs[] = array( 'label' => '', 'text' => sprintf( /* translators: %s: link to the Postqueues screen, labelled "Tools › Postqueues" */ _x( 'Go to %s to edit queue contents.', 'grid box', 'postqueue' ), sprintf( '%s', esc_url( admin_url( 'tools.php?page=' . \Postqueue\Editor::PAGE_SLUG ) ), esc_html_x( 'Tools › Postqueues', 'grid box', 'postqueue' ) ) ), 'type' => 'info', ); return $cs; } }