public static function PollsEdit() { wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/themes/smoothness/jquery-ui.css'); wp_register_script('gf-poll-edit', PLUGIN_URL . "js/gf-poll-edit.js"); wp_enqueue_script('gf-poll-edit'); $id = isset($_GET['id']) ? $_GET['id'] : -1; $poll_count = GFontsDB::CountPolls(); if ($id === -1 && $poll_count >= 5) { echo '<span style="color: red;">' . __('You can create maximum 5 polls with Free Version. If you need more please purchase PRO. <a href="http://powerposts.net" target="_blank" >Click here for PRO</a>', self::PLUGIN_SLUG) . '</span>'; return; } if ($id === -1) { $pollname = ""; $polltitle = ""; $polltype = "0"; $voting_end_date = date("Y-m-d", mktime(0, 0, 0, date("m") + 1, date("d"), date("Y"))); $voting_enabled = true; $results_type = 0; $client_mode = 1; // 0 - cookie, 1 - ip based $button_title = 'Vote'; } else { $poll = GFontsDB::GetPoll($id); $pollname = $poll->name; $polltitle = $poll->title; $polltype = $poll->type; $results_type = $poll->results_type; $voting_end_date = $poll->voting_end_date; $voting_enabled = $poll->voting_enabled == 1; $client_mode = $poll->client_mode; $button_title = $poll->button_title; } $tabs = self::GetPollEditTabs($id, true, false, $pollname); GFontsUITabs::DrawTabs($tabs); ?> <form method="post" action="?page=<?php echo self::PLUGIN_POLLS; ?> &act=save" onsubmit="return GfValidatePollEdition();"> <input type="hidden" name="id" value="<?php echo $id; ?> "/> <?php self::PollFormBuilder($pollname, $polltitle, $polltype, $results_type, $results_type, $voting_end_date, $voting_enabled, $client_mode, $button_title); ?> <?php submit_button(__("Save", self::PLUGIN_SLUG)); ?> </form> <?php }