public function update_feed_position() { $feed_id = (int) $_REQUEST['feed_id']; $position = (double) $_REQUEST['position']; Model\Feed::find_by_id($feed_id)->update_attributes(array('position' => $position)); die; }
public static function logValidation($feedid, $errors_and_warnings, $redirected = FALSE) { $feed = \Podlove\Model\Feed::find_by_id($feedid); $feed_subscribe_url = $redirected === FALSE ? $feed->get_subscribe_url() : $feed->redirect_url; if ($redirected === TRUE) { $redirected = ' (Redirected)'; } foreach ($errors_and_warnings['warnings'] as $warning_key => $warning) { \Podlove\Log::get()->addInfo('Warning: ' . $warning['text'] . ', line ' . $warning['line'] . ' in Feed <a href="' . $feed_subscribe_url . '">' . $feed->name . $redirected . '</a>.'); } foreach ($errors_and_warnings['errors'] as $error_key => $error) { \Podlove\Log::get()->addError('Error: ' . $error['text'] . ', line ' . $error['line'] . ' in Feed <a href="' . $feed_subscribe_url . '">' . $feed->name . $redirected . '</a>.'); } }
public function ajax_validate_feed() { $feed_id = $_REQUEST['feed_id']; $redirect = $_REQUEST['redirect'] == '0' ? FALSE : TRUE; $feed = \Podlove\Model\Feed::find_by_id($feed_id); // Delete feed source transient $errors_and_warnings = \Podlove\Modules\FeedValidation\Model\FeedValidator::getValidationErrorsandWarnings($feed->id, $redirect); // renew transients set_transient('podlove_dashboard_feed_validation_' . $feed->id, \Podlove\Modules\FeedValidation\Model\FeedValidator::getValidationIcon($feed->id, $redirect), 3600 * 24); set_transient('podlove_dashboard_feed_information_' . $feed->id, \Podlove\Modules\FeedValidation\Model\FeedValidator::getInformation($feed->id, $redirect), 3600 * 24); if ($redirect === TRUE) { set_transient('podlove_dashboard_feed_r_validation_' . $feed->id, \Podlove\Modules\FeedValidation\Model\FeedValidator::getValidationIcon($feed->id, $redirect), 3600 * 24); set_transient('podlove_dashboard_feed_r_information_' . $feed->id, \Podlove\Modules\FeedValidation\Model\FeedValidator::getInformation($feed->id, $redirect), 3600 * 24); } \Podlove\AJAX\Ajax::respond_with_json(array('validation_icon' => \Podlove\Modules\FeedValidation\Model\FeedValidator::getValidationIcon($feed->id, $redirect))); }
private function edit_template() { $feed = \Podlove\Model\Feed::find_by_id($_REQUEST['feed']); echo '<h3>' . sprintf(__('Edit Feed: %s', 'podlove'), $feed->name) . '</h3>'; $this->form_template($feed, 'save'); }