public function register_page() { $podcast = \Podlove\Model\Podcast::get(); $form_attributes = array('context' => 'podlove_flattr', 'action' => $this->get_url()); ?> <p> <?php echo __('This Flattr account will be associated with your Podcast. Flattr donations for e.g. new episodes will be linked with this account.', 'podlove'); ?> </p> <style type="text/css"> /* add linebreak after each radio button+label */ input[type="radio"] + label::after { content: " "; display: block; } </style> <?php \Podlove\Form\build_for((object) Flattr::get_setting(), $form_attributes, function ($form) { $wrapper = new \Podlove\Form\Input\TableWrapper($form); $podcast = $form->object; $wrapper->string('account', ['label' => __('Flattr Account', 'podlove'), 'html' => ['class' => 'regular-text required podlove-check-input']]); if (\Podlove\Modules\Base::is_active('contributors')) { $wrapper->radio('contributor_shortcode_default', ['label' => __('Default Parameter in Contributors Shortcodes', 'podlove'), 'description' => '<br>' . __('You can override this setting individually by passing along the <code>flattr="yes"</code> or <code>flattr="no"</code> parameter to the shortcodes.', 'podlove'), 'options' => ['yes' => 'yes, show Flattr buttons by default', 'no' => 'no, do not show Flattr buttons by default'], 'default' => 'no']); } }); }
private function form_template($feed, $action, $button_text = NULL) { $form_args = array('context' => 'podlove_feed', 'hidden' => array('feed' => $feed->id, 'action' => $action)); \Podlove\Form\build_for($feed, $form_args, function ($form) { $wrapper = new \Podlove\Form\Input\TableWrapper($form); $feed = $form->object; $episode_assets = \Podlove\Model\EpisodeAsset::all(); $assets = array(); foreach ($episode_assets as $asset) { $assets[$asset->id] = $asset->title; } $wrapper->string('name', array('label' => __('Feed Title', 'podlove'), 'description' => __('Some podcast clients may display this title to describe the feed content.', 'podlove'), 'html' => array('class' => 'regular-text required'))); $wrapper->checkbox('discoverable', array('label' => __('Discoverable?', 'podlove'), 'description' => __('Embed a meta tag into the head of your site so browsers and feed readers will find the link to the feed.', 'podlove'), 'default' => true)); // TODO: update url $wrapper->string('slug', array('label' => __('Slug', 'podlove'), 'description' => $feed ? sprintf(__('Feed identifier. URL: %s', 'podlove'), $feed->get_subscribe_url()) : '', 'html' => array('class' => 'regular-text required'))); $wrapper->radio('format', array('label' => __('Format', 'podlove'), 'options' => array('rss' => 'RSS', 'atom' => 'Atom'), 'default' => 'rss')); $wrapper->select('episode_asset_id', array('label' => __('Episode Media File', 'podlove'), 'options' => $assets, 'html' => array('class' => 'required'))); $wrapper->string('itunes_feed_id', array('label' => __('iTunes Feed ID', 'podlove'), 'description' => __('Is used to generate a link to the iTunes directory.', 'podlove'), 'html' => array('class' => 'regular-text'))); // todo: add PING url; see feedburner doc $wrapper->string('redirect_url', array('label' => __('Redirect Url', 'podlove'), 'description' => __('e.g. Feedburner URL', 'podlove'), 'html' => array('class' => 'regular-text'))); $wrapper->checkbox('enable', array('label' => __('Allow Submission to Directories', 'podlove'), 'description' => __('Allow this feed to appear in podcast directories.', 'podlove'), 'default' => true)); // TODO: choose description format: empty, simple, full-force $wrapper->checkbox('show_description', array('label' => __('Include Description?', 'podlove'), 'description' => __('You may want to hide the episode descriptions to reduce the feed file size.', 'podlove'), 'default' => true)); // todo include summary? $wrapper->string('limit_items', array('label' => __('Limit Items', 'podlove'), 'description' => __('A feed only displays the most recent episodes. Define the amount. Leave empty to use the WordPress default.', 'podlove'), 'html' => array('class' => 'regular-text'))); }); }