Пример #1
0
 /**
  * Filter the content (which may be empty).
  */
 public function printControlHtml()
 {
     /* are we saving? */
     if ($this->_httpRequestParams->hasParam(self::WIDGET_SUBMIT_TAG)) {
         $this->_wpFunctions->check_admin_referer('tubepress-widget-nonce-save', 'tubepress-widget-nonce');
         $this->_persistence->queueForSave(tubepress_wordpress_api_Constants::OPTION_WIDGET_SHORTCODE, $this->_httpRequestParams->getParamValue('tubepress-widget-tagstring'));
         $this->_persistence->queueForSave(tubepress_wordpress_api_Constants::OPTION_WIDGET_TITLE, $this->_httpRequestParams->getParamValue('tubepress-widget-title'));
         $this->_persistence->flushSaveQueue();
     }
     $templateVars = array(self::WIDGET_TITLE => $this->_persistence->fetch(tubepress_wordpress_api_Constants::OPTION_WIDGET_TITLE), self::WIDGET_CONTROL_TITLE => $this->_translator->trans('Title'), self::WIDGET_CONTROL_SHORTCODE => $this->_translator->trans(sprintf('TubePress shortcode for the widget. See the <a href="%s" target="_blank">documentation</a>.', "http://docs.tubepress.com/")), self::WIDGET_SHORTCODE => $this->_persistence->fetch(tubepress_wordpress_api_Constants::OPTION_WIDGET_SHORTCODE), self::WIDGET_SUBMIT_TAG => self::WIDGET_SUBMIT_TAG, self::WIDGET_NONCE_FIELD => $this->_wpFunctions->wp_nonce_field('tubepress-widget-nonce-save', 'tubepress-widget-nonce', true, false));
     echo $this->_templating->renderTemplate('wordpress/single-widget-controls', $templateVars);
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function onSubmit()
 {
     $this->_wpFunctions->check_admin_referer('tubepress-save', 'tubepress_nonce');
     return null;
 }