echo $post_password; ?> " /></div> </fieldset> <fieldset id="pageparent"> <legend><?php _e('Page Parent'); ?> </legend> <div><select name="parent_id"> <option value='0'><?php _e('Main Page (no parent)'); ?> </option> <?php parent_dropdown($post_parent); ?> </select> </div> </fieldset> <fieldset id="postdiv"> <legend><?php _e('Page Content'); ?> </legend> <?php the_quicktags(); $rows = get_settings('default_post_edit_rows'); if ($rows < 3 || $rows > 100) { $rows = 10; }
/** * generates a dropdown of all parent pages - copied from WP core * * @param unknown_type $default * @param unknown_type $parent * @param unknown_type $level * @return unknown */ public static function page_settings_dropdown($default = 0, $parent = 0, $level = 0) { global $wpdb; $items = $wpdb->get_results($wpdb->prepare("SELECT ID, post_parent, post_title FROM {$wpdb->posts} WHERE post_parent = %d AND post_type = 'page' AND post_status != 'trash' ORDER BY menu_order", $parent)); if ($items) { foreach ($items as $item) { $pad = str_repeat(' ', $level * 3); if ($item->ID == $default) { $current = ' selected="selected"'; } else { $current = ''; } echo "\n\t<option class='level-{$level}' value='{$item->ID}'{$current}>{$pad} " . esc_html($item->post_title) . "</option>"; parent_dropdown($default, $item->ID, $level + 1); } } else { return false; } }
function organization_config_mnu() { global $org_options, $espresso_premium, $espresso_check_for_updates; if (isset($_POST['update_org'])) { $org_options['organization'] = isset($_POST['org_name']) && !empty($_POST['org_name']) ? stripslashes_deep($_POST['org_name']) : ''; $org_options['organization_street1'] = isset($_POST['org_street1']) && !empty($_POST['org_street1']) ? $_POST['org_street1'] : ''; $org_options['organization_street2'] = isset($_POST['org_street2']) && !empty($_POST['org_street2']) ? $_POST['org_street2'] : ''; $org_options['organization_city'] = isset($_POST['org_city']) && !empty($_POST['org_city']) ? $_POST['org_city'] : ''; $org_options['organization_state'] = isset($_POST['org_state']) && !empty($_POST['org_state']) ? $_POST['org_state'] : ''; $org_options['organization_zip'] = isset($_POST['org_zip']) && !empty($_POST['org_zip']) ? $_POST['org_zip'] : ''; $org_options['organization_country'] = isset($_POST['org_country']) && !empty($_POST['org_country']) ? $_POST['org_country'] : ''; $org_options['contact_email'] = isset($_POST['email']) && !empty($_POST['email']) ? $_POST['email'] : ''; $org_options['expire_on_registration_end'] = isset($_POST['expire_on_registration_end']) && !empty($_POST['expire_on_registration_end']) ? $_POST['expire_on_registration_end'] : ''; $org_options['event_page_id'] = isset($_POST['event_page_id']) && !empty($_POST['event_page_id']) ? $_POST['event_page_id'] : ''; $org_options['return_url'] = isset($_POST['return_url']) && !empty($_POST['return_url']) ? $_POST['return_url'] : ''; $org_options['cancel_return'] = isset($_POST['cancel_return']) && !empty($_POST['cancel_return']) ? $_POST['cancel_return'] : ''; $org_options['notify_url'] = isset($_POST['notify_url']) && !empty($_POST['notify_url']) ? $_POST['notify_url'] : ''; $org_options['events_in_dasboard'] = isset($_POST['events_in_dasboard']) && !empty($_POST['events_in_dasboard']) ? $_POST['events_in_dasboard'] : ''; $org_options['default_mail'] = isset($_POST['default_mail']) && !empty($_POST['default_mail']) ? $_POST['default_mail'] : ''; $org_options['payment_subject'] = isset($_POST['payment_subject']) && !empty($_POST['payment_subject']) ? $_POST['payment_subject'] : ''; $org_options['payment_message'] = isset($_POST['payment_message']) && !empty($_POST['payment_message']) ? esc_html($_POST['payment_message']) : ''; $org_options['message'] = isset($_POST['success_message']) && !empty($_POST['success_message']) ? esc_html($_POST['success_message']) : ''; $org_options['email_before_payment'] = isset($_POST['email_before_payment']) && !empty($_POST['email_before_payment']) ? $_POST['email_before_payment'] : ''; $org_options['email_fancy_headers'] = isset($_POST['email_fancy_headers']) && !empty($_POST['email_fancy_headers']) ? $_POST['email_fancy_headers'] : ''; $org_options['use_captcha'] = isset($_POST['use_captcha']) && !empty($_POST['use_captcha']) ? $_POST['use_captcha'] : ''; $org_options['recaptcha_publickey'] = isset($_POST['recaptcha_publickey']) && !empty($_POST['recaptcha_publickey']) ? $_POST['recaptcha_publickey'] : ''; $org_options['recaptcha_privatekey'] = isset($_POST['recaptcha_privatekey']) && !empty($_POST['recaptcha_privatekey']) ? $_POST['recaptcha_privatekey'] : ''; $org_options['recaptcha_theme'] = isset($_POST['recaptcha_theme']) && !empty($_POST['recaptcha_theme']) ? $_POST['recaptcha_theme'] : ''; $org_options['recaptcha_width'] = isset($_POST['recaptcha_width']) && !empty($_POST['recaptcha_width']) ? $_POST['recaptcha_width'] : ''; $org_options['recaptcha_language'] = isset($_POST['recaptcha_language']) && !empty($_POST['recaptcha_language']) ? $_POST['recaptcha_language'] : ''; $org_options['espresso_dashboard_widget'] = isset($_POST['espresso_dashboard_widget']) && !empty($_POST['espresso_dashboard_widget']) ? $_POST['espresso_dashboard_widget'] : ''; $org_options['time_reg_limit'] = isset($_POST['time_reg_limit']) && !empty($_POST['time_reg_limit']) ? $_POST['time_reg_limit'] : ''; $org_options['skip_confirmation_page'] = isset($_POST['skip_confirmation_page']) ? $_POST['skip_confirmation_page'] : 'N'; $org_options['allow_mer_discounts'] = isset($_POST['allow_mer_discounts']) ? $_POST['allow_mer_discounts'] : 'N'; $org_options['allow_mer_vouchers'] = isset($_POST['allow_mer_vouchers']) ? $_POST['allow_mer_vouchers'] : 'N'; $org_options['use_attendee_pre_approval'] = isset($_POST['use_attendee_pre_approval']) && !empty($_POST['use_attendee_pre_approval']) ? $_POST['use_attendee_pre_approval'] : ''; if (!empty($_POST['event_ssl_active'])) { $org_options['event_ssl_active'] = isset($_POST['event_ssl_active']) && !empty($_POST['event_ssl_active']) ? $_POST['event_ssl_active'] : ''; } $org_options['show_pending_payment_options'] = isset($_POST['show_pending_payment_options']) && !empty($_POST['show_pending_payment_options']) ? $_POST['show_pending_payment_options'] : ''; $org_options['use_venue_manager'] = isset($_POST['use_venue_manager']) && !empty($_POST['use_venue_manager']) ? $_POST['use_venue_manager'] : ''; $org_options['use_personnel_manager'] = isset($_POST['use_personnel_manager']) && !empty($_POST['use_personnel_manager']) ? $_POST['use_personnel_manager'] : ''; $org_options['use_event_timezones'] = isset($_POST['use_event_timezones']) && !empty($_POST['use_event_timezones']) ? $_POST['use_event_timezones'] : ''; $org_options['full_logging'] = isset($_POST['full_logging']) && !empty($_POST['full_logging']) ? $_POST['full_logging'] : ''; $org_options['surcharge'] = isset($_POST['surcharge']) && !empty($_POST['surcharge']) ? $_POST['surcharge'] : ''; $org_options['surcharge_type'] = isset($_POST['surcharge_type']) && !empty($_POST['surcharge_type']) ? $_POST['surcharge_type'] : ''; $org_options['surcharge_text'] = isset($_POST['surcharge_text']) && !empty($_POST['surcharge_text']) ? $_POST['surcharge_text'] : ''; $org_options['show_reg_footer'] = isset($_POST['show_reg_footer']) && !empty($_POST['show_reg_footer']) ? $_POST['show_reg_footer'] : ''; $org_options['affiliate_id'] = isset($_POST['affiliate_id']) && !empty($_POST['affiliate_id']) ? $_POST['affiliate_id'] : ''; $org_options['site_license_key'] = isset($_POST['site_license_key']) && !empty($_POST['site_license_key']) ? $_POST['site_license_key'] : ''; $org_options['default_payment_status'] = isset($_POST['default_payment_status']) && !empty($_POST['default_payment_status']) ? $_POST['default_payment_status'] : ''; $org_options['default_logo_url'] = isset($_REQUEST['upload_image']) && !empty($_REQUEST['upload_image']) ? $_REQUEST['upload_image'] : ''; $currency_format = getCountryFullData($org_options['organization_country']); switch ($currency_format['iso_code_3']) { case 'USA': $org_options['currency_symbol'] = '$'; // US Dollar break; case 'CHE': $org_options['currency_symbol'] = 'Fr.'; // Swiss Franc break; case 'AUS': $org_options['currency_symbol'] = 'A$'; // Australian Dollar break; case 'GBR': $org_options['currency_symbol'] = '£'; // British Pound break; case 'NOR': $org_options['currency_symbol'] = 'kr'; // Norwegian Krone break; case 'BRA': $org_options['currency_symbol'] = 'R$'; // Brazillian Real break; case 'CAN': $org_options['currency_symbol'] = 'C$'; // Canadian Dollar break; case 'JPN': $org_options['currency_symbol'] = '¥'; // Japanese Yen break; case 'SWE': $org_options['currency_symbol'] = 'kr'; // Swedish Krona break; case 'DNK': $org_options['currency_symbol'] = 'kr'; // Danish Krone break; case 'ZAF': $org_options['currency_symbol'] = 'R'; // South African Rand break; case 'IND': $org_options['currency_symbol'] = 'Rs'; // Indian Rupee break; case 'TUR': $org_options['currency_symbol'] = 'TL'; // Turkish Lira break; case 'NZL': $org_options['currency_symbol'] = 'NZ$'; // New Zealand Dollar break; case 'HKG': $org_options['currency_symbol'] = 'HK$'; // Hong Kong Dollar break; case 'SGP': $org_options['currency_symbol'] = 'S$'; // Singapore Dollar break; case 'POL': $org_options['currency_symbol'] = 'zl'; // Polish Zloty (hex code: zł) break; case 'HUN': $org_options['currency_symbol'] = 'Ft'; // Hungarian Forint break; case 'CZE': $org_options['currency_symbol'] = 'Kc'; // Czech Koruna (hex code: Kč) break; case 'ISR': $org_options['currency_symbol'] = 'ILS'; // Israeli Shekel (hex code: ₪) break; case 'MEX': $org_options['currency_symbol'] = 'Mex$'; // Mexican Peso break; case 'MYS': $org_options['currency_symbol'] = 'RM'; // Malaysian Ringgit break; case 'PHL': $org_options['currency_symbol'] = 'PhP'; // Phillipine Peso (hex code: ₱) break; case 'TWN': $org_options['currency_symbol'] = 'NT$'; // New Taiwan Dollar break; case 'THA': $org_options['currency_symbol'] = 'THB'; // Thai Baht (hex code: ฿) break; case 'AUT' || 'BEL' || 'CYP' || 'EST' || 'FIN' || 'FRA' || 'DEU' || 'GRC' || 'IRL' || 'ITA' || 'LUX' || 'MLT' || 'NLD' || 'PRT' || 'SVK' || 'SVN' || 'ESP' || 'AND' || 'MCO' || 'SMR' || 'VAT' | 'MYT' || 'MNE' || 'XKV' || 'SPM': $org_options['currency_symbol'] = 'EUR'; // use the Euro for all eurozone countries break; default: $org_options['currency_symbol'] = '$'; break; } /* if (getCountryZoneId($org_options['organization_country']) == '2') { $org_options['currency_symbol'] = 'Euro: '; //Creates the symbol for the Euro } */ update_option('events_organization_settings', $org_options); echo '<div id="message" class="updated fade"><p><strong>' . __('Organization details saved.', 'event_espresso') . '</strong></p></div>'; } $org_options = get_option('events_organization_settings'); $values = array(array('id' => 'Y', 'text' => __('Yes', 'event_espresso')), array('id' => 'N', 'text' => __('No', 'event_espresso'))); ?> <div class="wrap columns-2"> <div id="icon-options-event" class="icon32"> </div> <h2> <?php _e('General Settings', 'event_espresso'); ?> </h2> <?php ob_start(); ?> <div class="meta-box-sortables ui-sortable"> <form class="espresso_form" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?> "> <ul id="event_espresso-sortables"> <li> <div class="metabox-holder"> <div class="postbox"> <div title="Click to toggle" class="handlediv"><br /> </div> <h3 class="hndle"> <?php _e('Organization Settings', 'event_espresso'); ?> </h3> <div class="inside"> <div class="padding"> <h4> <?php _e('Company Logo', 'event_espresso'); ?> </h4> <ul> <li><label for="upload_image"> <?php _e('Add a Default Logo', 'event_espresso'); ?> <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=espresso_default_logo_info"><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> /images/question-frame.png" width="16" height="16" /></a></label> <div id="default-logo-image"> <?php $org_options['default_logo_url'] = isset($org_options['default_logo_url']) ? $org_options['default_logo_url'] : ''; ?> <input id="upload_image" type="hidden" size="36" name="upload_image" value="<?php echo $org_options['default_logo_url']; ?> " /> <input id="upload_image_button" type="button" value="Upload Image" /> <?php if ($org_options['default_logo_url'] != '') { ?> <p class="default-logo-thumb"><img src="<?php echo $org_options['default_logo_url']; ?> " alt="" /><br /> <a id="remove-image" href="#" title="Remove this image" onclick="return false;"><?php _e('Remove Image', 'event_espresso'); ?> </a></p> <?php } ?> </div> <div id="espresso_default_logo_info" class="pop-help" style="display:none"> <h2> <?php _e('Default Logo', 'event_espresso'); ?> </h2> <p><?php echo __('The default logo will be used in your custom invoice, ticketing, certificates, and payment templates.', 'event_espresso'); ?> </p> </div> </li> <li><h4><?php _e('Contact Information', 'event_espresso'); ?> </h4></li> <li> <label for="org_name"> <?php _e('Organization Name:', 'event_espresso'); ?> </label> <input type="text" name="org_name" size="45" value="<?php echo stripslashes_deep($org_options['organization']); ?> " /> </li> <li> <label for="org_street1"> <?php _e('Organization Street 1:', 'event_espresso'); ?> </label> <input type="text" name="org_street1" size="45" value="<?php echo $org_options['organization_street1']; ?> " /> </li> <li> <label for="org_street2"> <?php _e('Organization Street 2:', 'event_espresso'); ?> </label> <input type="text" name="org_street2" size="45" value="<?php echo $org_options['organization_street2']; ?> " /> </li> <li> <label for="org_city"> <?php _e('Organization City:', 'event_espresso'); ?> </label> <input type="text" name="org_city" size="45" value="<?php echo $org_options['organization_city']; ?> " /> </li> <li> <label for="org_state"> <?php _e('Organization State:', 'event_espresso'); ?> </label> <input type="text" name="org_state" size="45" value="<?php echo $org_options['organization_state']; ?> " /> </li> <li> <label for="org_zip"> <?php _e('Organization Zip/Postal Code:', 'event_espresso'); ?> </label> <input type="text" name="org_zip" size="10" value="<?php echo $org_options['organization_zip']; ?> " /> </li> <li> <label for="org_country"> <?php _e('Organization Country:', 'event_espresso'); ?> </label> <?php printCountriesSelector("org_country", $org_options['organization_country']); ?> (<?php echo $org_options['currency_symbol']; ?> )</li> <li> <label for="email"> <?php _e('Primary contact email:', 'event_espresso'); ?> </label> <input type="text" name="email" size="45" value="<?php echo $org_options['contact_email']; ?> " /> </li> <li> <h4> <?php _e('Time and Date Settings', 'event_espresso'); ?> </h4> </li > <li class="time-date"> <p> <span class="run-in"> <?php _e('Current Time: ', 'event_espresso'); ?> </span><span class="current-date"> <?php echo date(get_option('date_format') . ' ' . get_option('time_format')); ?> </span><a class="change-date-time" href="options-general.php" target="_blank"> <?php _e('Change timezone and date format settings?', 'event_espresso'); ?> </a> </p> <p> <span class="important"> <?php _e('Note:', 'event_espresso'); ?> </span> <?php _e('You must set the time zone for your city, or the city closest to you. UTC time will not work.', 'event_espresso'); ?> <a href="http://ee-updates.s3.amazonaws.com/images/time-zone-settings-example.jpg" class="thickbox">View an example?</a> </p> </li> </ul> <p> <input class="button-primary" type="submit" name="Submit" value="<?php _e('Save Options', 'event_espresso'); ?> " id="save_organization_saetting_1" /> </p> </div> </div> </div> </div> </li> <li> <div class="metabox-holder"> <div class="postbox"> <div title="Click to toggle" class="handlediv"><br /> </div> <h3 class="hndle"> <?php _e('Page Settings', 'event_espresso'); ?> </h3> <div class="inside"> <div class="padding"> <a name="page_settings" id="page_settings"></a> <?php if (empty($org_options['event_page_id']) || empty($org_options['return_url']) || empty($org_options['notify_url']) || empty($org_options['cancel_return'])) { espresso_create_default_pages(); } //Check to see if we are using the deprecated SSL option. If we are, recommend updating to WordPress HTTPS (SSL). if (!empty($org_options['event_ssl_active']) && $espresso_premium == true && $org_options['event_ssl_active'] == 'Y') { echo '<div id="ssl-reg" style="background-color: #ffffe0; border: #e6db55 1px solid; padding:4px;">'; echo '<p><strong>' . __('Attention!', 'event_espresso') . '</strong><br />' . __('The Secure Payment System has been removed.', 'event_espresso') . '</p>'; echo '<p>' . __('If your site uses SSL to handle secure transactions. Please install the <a href="http://ee-updates.s3.amazonaws.com/espresso-https.1.0.zip" title="Download Now">Event Espresso SSL/HTTPS</a> plugin now.', 'event_espresso') . ' ' . __('<a href="http://eventespresso.com/forums/2011/09/use-wordpress-https-for-ssl-encryption-on-your-event-espresso-site/" target="_blank">More information here</a>.', 'event_espresso') . '</p>'; $ssl_values = array(array('id' => 'N', 'text' => __('Yes', 'event_espresso')), array('id' => 'Y', 'text' => __('No', 'event_espresso'))); ?> <label for="event_ssl_active"> <?php _e('Turn off this message?', 'event_espresso'); ?> </label> <br /> <?php echo select_input('event_ssl_active', $ssl_values, $org_options['event_ssl_active']); echo '</div>'; } ?> <p> <?php _e('The following shortcodes and page settings are required for Event Espresso to function properly. These shortcodes should not be replaced with any other shortcodes. Please view <a href="admin.php?page=support#shortcodes">this page</a> for a list of optional shortcodes.', 'event_espresso'); ?> </p> <p> <label for="event_page_id"> <?php _e('Main registration page:', 'event_espresso'); ?> </label> <select name="event_page_id"> <option value="0"> <?php _e('Main page', 'event_espresso'); ?> </option> <?php parent_dropdown($default = $org_options['event_page_id']); ?> </select> <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=registration_page_info"><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> /images/question-frame.png" width="16" height="16" /></a><br /> <span class="messages"><?php echo sprintf(__("This page should contain the %s shortcode. <br />This page can be hidden from navigation if desired, <br />but should always contain the %s shortcode.", 'event_espresso'), '<span class="highlight">[ESPRESSO_EVENTS]</span>', '[ESPRESSO_EVENTS]'); ?> )</span></p> <?php ###### Popup help box ####### ?> <div id="registration_page_info" class="pop-help" style="display:none"> <h2> <?php _e('Main Events Page', 'event_espresso'); ?> </h2> <p><?php echo sprintf(__('This is the page that displays your events and doubles as your registration page. It is very important that this page always contains the %s shortcode.', 'event_espresso'), '<strong>[ESPRESSO_EVENTS]</strong>'); ?> </p> <p><?php echo sprintf(__("This page should ALWAYS contain the %s shortcode.", 'event_espresso'), '<strong>[ESPRESSO_EVENTS]</strong>'); ?> </p> </div> <?php ###### close popup help box ###### ?> <p> <label for="return_url"> <?php _e('Auto Return URL (Thank You and Return Payment page):', 'event_espresso'); ?> </label> <select name="return_url"> <option value="0"> <?php _e('Main page', 'event_espresso'); ?> </option> <?php parent_dropdown($default = $org_options['return_url']); ?> </select> <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=return_url_info" target="_blank"><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> /images/question-frame.png" width="16" height="16" /></a><br /> <span class="messages">(<?php echo sprintf(__("This page should contain the %s shortcode.<br />This page should hidden from your navigation,<br />but still viewable to the public (not password protected.)", 'event_espresso'), '<span class="highlight">[ESPRESSO_PAYMENTS]</span>'); ?> </span></p> <?php ##### Popup help box ##### ?> <div id="return_url_info" class="pop-help" style="display:none"> <h2> <?php _e('Auto Return URL', 'event_espresso'); ?> </h2> <p> <?php _e('The URL to which the payer\'s browser is redirected after completing the payment; for example, a URL on your site that displays a "Thank you for your payment" page.', 'event_espresso'); ?> </p> <p><?php echo sprintf(__("This page should contain the %s shortcode.", 'event_espresso'), '<strong>[ESPRESSO_PAYMENTS]</strong>'); ?> </p> <p><em class="important"><b> <?php _e('ATTENTION:', 'event_espresso'); ?> </b><br /> <?php _e('This page should be hidden from from your navigation menu. Exclude pages by using the "Exclude Pages" plugin from http://wordpress.org/extend/plugins/exclude-pages/ or using the "exclude" parameter in your "wp_list_pages" template tag. Please refer to http://codex.wordpress.org/Template_Tags/wp_list_pages for more inforamation about excluding pages.', 'event_espresso'); ?> </em> </p> </div> <?php ##### close popup help ##### ?> <p> <label for="cancel_return"> <?php _e('Cancel Return URL (used for cancelled payments):', 'event_espresso'); ?> </label> <select name="cancel_return"> <option value="0"> <?php _e('Main page', 'event_espresso'); ?> </option> <?php parent_dropdown($default = $org_options['cancel_return']); ?> </select> <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=cancel_return_info"><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> /images/question-frame.png" width="16" height="16" /></a><br /> <span class="messages">( <?php echo sprintf(__("This should be a page on your website that contains a cancelled message %s and the %s shortcode. This page should hidden %s from your navigation, but still viewable to the public (not password protected.)", 'event_espresso'), '<br />', '<span class="highlight">[ESPRESSO_CANCELLED]</span>', '<br />'); ?> )</span></p> <?php ##### popup help box ##### ?> <div id="cancel_return_info" class="pop-help" style="display:none"> <h2> <?php _e('Cancel Return URL', 'event_espresso'); ?> </h2> <p> <?php _e('A URL to which the payer\'s browser is redirected if payment is cancelled; for example, a URL on your website that displays a "Payment Canceled" page.', 'event_espresso'); ?> </p> <p> <?php echo sprintf(__("This should be a page on your website that contains a cancelled message and the %s shortcode.", 'event_espresso'), '<strong>[ESPRESSO_CANCELLED]</strong>'); ?> </p> <p><em class="important"><b> <?php _e('ATTENTION:', 'event_espresso'); ?> </b><br /> <?php _e('This page should be hidden from from your navigation menu. Exclude pages by using the "Exclude Pages" plugin from http://wordpress.org/extend/plugins/exclude-pages/ or using the "exclude" parameter in your "wp_list_pages" template tag. Please refer to http://codex.wordpress.org/Template_Tags/wp_list_pages for more inforamation about excluding pages.', 'event_espresso'); ?> </em></p> </div> <?php ##### close popup help box ##### ?> <p> <label for="notify_url"> <?php _e('Notify URL (used to process payments):', 'event_espresso'); ?> </label> <select name="notify_url"> <option value="0"> <?php _e('Main page', 'event_espresso'); ?> </option> <?php parent_dropdown($default = $org_options['notify_url']); ?> </select> <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=notify_url_info"><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> /images/question-frame.png" width="16" height="16" /></a><br /> <span class="messages">(<?php echo sprintf(__("This page should contain the %s shortcode.<br />This page should hidden from your navigation, <br />but still viewable to the public (not password protected.)", 'event_espresso'), '<span class="highlight">[ESPRESSO_TXN_PAGE]</span>'); ?> </span></p> <?php ##### popup help box ##### ?> <div id="notify_url_info" class="pop-help" style="display:none"> <h2> <?php _e('Notify URL', 'event_espresso'); ?> </h2> <p> <?php _e('The URL to which PayPal posts information about the transaction, in the form of Instant Payment Notification messages.', 'event_espresso'); ?> </p> <p> <?php echo sprintf(__('This page should contain the %s shortcode.', 'event_espresso'), '<strong>[ESPRESSO_TXN_PAGE]</strong>'); ?> </p> <p><em class="important"><b> <?php _e('ATTENTION:', 'event_espresso'); ?> </b><br /> <?php _e('This page should be hidden from from your navigation menu. Exclude pages by using the "Exclude Pages" plugin from http://wordpress.org/extend/plugins/exclude-pages/ or using the "exclude" parameter in your "wp_list_pages" template tag. Please refer to http://codex.wordpress.org/Template_Tags/wp_list_pages for more inforamation about excluding pages.', 'event_espresso'); ?> </em> </p> </div> <p> <input class="button-primary" type="submit" name="Submit" value="<?php _e('Save Options', 'event_espresso'); ?> " id="save_organization_saetting_2" /> </p> </div> </div> </div> </div> </li> <li> <div class="metabox-holder"> <div class="postbox"> <div title="Click to toggle" class="handlediv"><br /> </div> <h3 class="hndle"> <?php _e('Email Settings', 'event_espresso'); ?> </h3> <div class="inside"> <div class="padding"><a name="email-settings" id="email-settings"></a> <?php $values = array(array('id' => 'Y', 'text' => __('Yes', 'event_espresso')), array('id' => 'N', 'text' => __('No', 'event_espresso'))); ?> <p> <?php _e('Send payment confirmation emails?', 'event_espresso'); echo select_input('default_mail', $values, $org_options['default_mail']); ?> </p> <p> <?php _e('Send registration confirmation emails before payment is received?', 'event_espresso'); echo select_input('email_before_payment', $values, $org_options['email_before_payment']); ?> </p> <p> <?php _e('Use fancy email headers?', 'event_espresso'); echo select_input('email_fancy_headers', $values, $org_options['email_fancy_headers']); ?> <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=fancyemailheaders"><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> /images/question-frame.png" width="16" height="16" /></a> </p> <?php ###### Popup help box ####### ?> <div id="fancyemailheaders" class="pop-help" style="display:none"> <h2> <?php _e('Fancy Email Headers', 'event_espresso'); ?> </h2> <p><?php echo sprintf(__("This option enables the use of the email header format %s From: name %s %s Reply-to: name %s %s.", 'event_espresso'), '<br />', '<email@address.com>', '<br />', '<email@address.com>', '<br />'); ?> </p> <p><?php _e("You should only use this if you know it will not cause email delivery problems. Some servers will not send emails that use this format.", 'event_espresso'); ?> </p> </div> <h4> <?php _e('Payment Confirmation Email:', 'event_espresso'); ?> </h4> <p> <label for="payment_subject"> <?php _e('Email Subject:', 'event_espresso'); ?> </label> <input id="payment_subject" name="payment_subject" size="50" type="text" value="<?php echo stripslashes_deep($org_options['payment_subject']); ?> " /> </p> <div id="payment-conf-email" class="postbox"> <?php if (function_exists('wp_editor')) { $args = array("textarea_rows" => 5, "textarea_name" => "payment_message", "editor_class" => "my_editor_custom"); wp_editor(espresso_admin_format_content($org_options['payment_message']), "payment_message", $args); } else { echo '<textarea class="theEditor std-textarea" id="payment_message" name="payment_message">' . espresso_admin_format_content($org_options['payment_message']) . '</textarea>'; } ?> <?php /* ?><textarea class="theEditor std-textarea" id="payment_message" name="payment_message"><?php echo espresso_admin_format_content($org_options['payment_message']); ?></textarea><?php */ ?> <table id="payment-confirmation-form" cellspacing="0"> <tbody> <tr> <td class="aer-word-count"></td> <td class="autosave-info"><span><a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=custom_email_info"> <?php _e('View Custom Email Tags', 'event_espresso'); ?> </a></span></td> </tr> </tbody> </table> </div> <h4> <?php _e('Default Registration Confirmation Email:', 'event_espresso'); ?> </h4> <div id="reg-conf-email" class="postbox"> <?php if (function_exists('wp_editor')) { $args = array("textarea_rows" => 5, "textarea_name" => "success_message", "editor_class" => "my_editor_custom"); wp_editor(espresso_admin_format_content($org_options['message']), "success_message", $args); } else { echo '<textarea class="theEditor std-textarea" id="success_message" name="success_message">' . espresso_admin_format_content($org_options['message']) . '</textarea>'; } ?> <?php /* ?><textarea class="theEditor std-textarea" id="reg-conf-email-mce" name="success_message"><?php echo espresso_admin_format_content($org_options['message']); ?></textarea><?php */ ?> <table id="email-confirmation-form" cellspacing="0"> <tbody> <tr> <td class="aer-word-count"></td> <td class="autosave-info"><span><a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=custom_email_info"> <?php _e('View Custom Email Tags', 'event_espresso'); ?> </a> | <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=custom_email_example"> <?php _e('Example', 'event_espresso'); ?> </a></span></td> </tr> </tbody> </table> </div> <p> <input class="button-primary" type="submit" name="Submit" value="<?php _e('Save Options', 'event_espresso'); ?> " id="save_organization_saetting_5" /> </p> </div> </div> </div> </div> <div style="clear:both;"></div> </li> <li> <h2> <?php _e('Advanced Features', 'event_espresso'); ?> </h2> <hr /> </li> <?php if (file_exists(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/recaptcha_form.php') || file_exists(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/optional_event_settings.php')) { if (file_exists(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/optional_event_settings.php')) { echo '<li>'; require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/optional_event_settings.php'; echo '</li>'; } if (file_exists(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/recaptcha_form.php')) { echo '<li>'; require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/recaptcha_form.php'; echo '</li>'; } } else { ?> <li> <div class="metabox-holder"> <div class="postbox"> <div title="Click to toggle" class="handlediv"><br /> </div> <h3 class="hndle"> <?php _e('Optional Event Settings', 'event_espresso'); ?> </h3> <div class="inside"> <div class="padding"> <p><?php echo __('Please purchase a', 'event_espresso'); ?> <a href="http://eventespresso.com/download/" target="_blank"><?php echo __('support license', 'event_espresso'); ?> </a> <?php echo __('to gain access to these features.', 'event_espresso'); ?> </p> <p> <?php _e('Additional features include:', 'event_espresso'); ?> </p> <ol> <li> <?php _e('Upcoming events widget in the admin dashboard', 'event_espresso'); ?> </li> <li> <?php _e('Registration limits on time slots', 'event_espresso'); ?> </li> <li> <?php _e('Ability to display short descriptions in the event listings', 'event_espresso'); ?> </li> <li> <?php _e('Custom post types for events', 'event_espresso'); ?> </li> <li> <?php _e('Attendee pre-approval feature', 'event_espresso'); ?> </li> <li> <?php _e('Event Venue/Staff Manager', 'event_espresso'); ?> </li> <li> <?php _e('Graphical Reports', 'event_espresso'); ?> </li> </ol> </div> </div> </div> </div> </li> <li> <div class="metabox-holder"> <div class="postbox"> <div title="Click to toggle" class="handlediv"><br /> </div> <h3 class="hndle"> <?php _e('reCAPTCHA Settings', 'event_espresso'); ?> </h3> <div class="inside"> <div class="padding"> <p><?php echo __('Please purchase a', 'event_espresso'); ?> <a href="http://eventespresso.com/download/" target="_blank"><?php echo __('support license', 'event_espresso'); ?> </a> <?php echo __('to gain access to this feature.', 'event_espresso'); ?> </p> <p> <?php echo sprintf(__('reCAPTCHA helps prevent automated abuse of your site (such as comment spam or bogus registrations) by using a %s to ensure that only humans perform certain actions.', 'event_espresso'), '<a href="http://recaptcha.net/captcha.html">CAPTCHA</a>'); ?> </p> </div> </div> </div> </div> </li> <?php } if ($espresso_check_for_updates == true && $espresso_premium == true) { ?> <li><a name="license_key" id="license_key"></a> <div class="metabox-holder"> <div class="postbox"> <div title="Click to toggle" class="handlediv"><br /> </div> <h3 class="hndle"> <?php _e('Support License', 'event_espresso'); ?> </h3> <div class="inside"> <div class="padding"> <ul> <li> <label for="site_license_key"> <?php _e('Site License Key:', 'event_espresso'); ?> </label> <input type="text" name="site_license_key" size="45" value="<?php echo isset($org_options['site_license_key']) ? stripslashes_deep($org_options['site_license_key']) : ''; ?> " /> </li> </ul> <p> <input class="button-primary" type="submit" name="Submit" value="<?php _e('Save Options', 'event_espresso'); ?> " id="save_organization_saetting_5" /> </p> </div> </div> </div> </div> </li> <?php } ?> </ul> <input type="hidden" name="update_org" value="update" /> </form> </div> <?php $post_content = ob_get_clean(); espresso_choose_layout($post_content, event_espresso_display_right_column()); ?> </div> <script type="text/javascript" charset="utf-8"> //<![CDATA[ jQuery(document).ready(function() { postboxes.add_postbox_toggles('event_espresso'); //Logo uploader var header_clicked = false; jQuery('#upload_image_button').click(function() { formfield = jQuery('#upload_image').attr('name'); tb_show('', 'media-upload.php?type=image&TB_iframe=1'); jQuery('p.default-logo-thumb').addClass('old'); header_clicked = true; return false; }); window.original_send_to_editor = window.send_to_editor; window.send_to_editor = function(html) { if(header_clicked) { //Remove old image jQuery("#upload_image").val(''); jQuery("p.default-logo-thumb").remove(); jQuery("p#image-display").remove(); jQuery('#remove-image').remove(); //Add new image imgurl = jQuery('img',html).attr('src'); jQuery('#' + formfield).val(imgurl); jQuery('#default-logo-image').append("<p id='image-display'><img src='"+imgurl+"' alt='' /></p>"); header_clicked = false; tb_remove(); } else { window.original_send_to_editor(html); } } // process the remove link in the metabox jQuery('#remove-image').click(function(){ var answer = confirm('<?php _e('Do you really want to delete this image? Please remember to save your settings to complete the removal.', 'event_espresso'); ?> '); if (answer){ jQuery("#upload_image").val(''); jQuery("p.default-logo-thumb").remove(); jQuery("p#image-display").remove(); jQuery('#remove-image').remove(); } return false; }); }); //]]> </script> <?php echo event_espresso_custom_email_info(); if (!function_exists('wp_editor')) { espresso_tiny_mce(); } }
/** * {@internal Missing Short Description}} * * @since 1.5.0 * * @param unknown_type $default * @param unknown_type $parent * @param unknown_type $level * @return unknown */ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) { global $wpdb, $post_ID; $items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) ); if ( $items ) { foreach ( $items as $item ) { // A page cannot be its own parent. if (!empty ( $post_ID ) ) { if ( $item->ID == $post_ID ) { continue; } } $pad = str_repeat( ' ', $level * 3 ); if ( $item->ID == $default) $current = ' selected="selected"'; else $current = ''; echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad " . esc_html($item->post_title) . "</option>"; parent_dropdown( $default, $item->ID, $level +1 ); } } else { return false; } }
function nggallery_picturelist() { // *** show picture list global $wpdb, $nggdb, $user_ID, $ngg; // Look if its a search result $is_search = isset($_GET['s']) ? true : false; $counter = 0; if ($is_search) { // fetch the imagelist $picturelist = $ngg->manage_page->search_result; // we didn't set a gallery or a pagination $act_gid = 0; $_GET['paged'] = 1; $page_links = false; } else { // GET variables $act_gid = $ngg->manage_page->gid; // Load the gallery metadata $gallery = $nggdb->find_gallery($act_gid); if (!$gallery) { nggGallery::show_error(__('Gallery not found.', 'nggallery')); return; } // Check if you have the correct capability if (!nggAdmin::can_manage_this_gallery($gallery->author)) { nggGallery::show_error(__('Sorry, you have no access here', 'nggallery')); return; } // look for pagination if (!isset($_GET['paged']) || $_GET['paged'] < 1) { $_GET['paged'] = 1; } $start = ($_GET['paged'] - 1) * 50; // get picture values $picturelist = $nggdb->get_gallery($act_gid, $ngg->options['galSort'], $ngg->options['galSortDir'], false, 50, $start); // build pagination $page_links = paginate_links(array('base' => add_query_arg('paged', '%#%'), 'format' => '', 'prev_text' => __('«'), 'next_text' => __('»'), 'total' => $nggdb->paged['max_objects_per_page'], 'current' => $_GET['paged'])); // get the current author $act_author_user = get_userdata((int) $gallery->author); } // list all galleries $gallerylist = $nggdb->find_all_galleries(); //get the columns $image_columns = ngg_manage_image_columns(); $hidden_columns = get_hidden_columns('nggallery-manage-images'); $num_columns = count($image_columns) - count($hidden_columns); $attr = nggGallery::current_user_can('NextGEN Edit gallery options') ? '' : 'disabled="disabled"'; ?> <script type="text/javascript"> <!-- function showDialog( windowId, title ) { var form = document.getElementById('updategallery'); var elementlist = ""; for (i = 0, n = form.elements.length; i < n; i++) { if(form.elements[i].type == "checkbox") { if(form.elements[i].name == "doaction[]") if(form.elements[i].checked == true) if (elementlist == "") elementlist = form.elements[i].value else elementlist += "," + form.elements[i].value ; } } jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val()); jQuery("#" + windowId + "_imagelist").val(elementlist); // now show the dialog jQuery( "#" + windowId ).dialog({ width: 640, resizable : false, modal: true, title: title }); jQuery("#" + windowId + ' .dialog-cancel').click(function() { jQuery( "#" + windowId ).dialog("close"); }); } jQuery(function (){ // load a content via ajax jQuery('a.ngg-dialog').click(function() { if ( jQuery( "#spinner" ).length == 0) jQuery("body").append('<div id="spinner"></div>'); var $this = jQuery(this); var results = new RegExp('[\\?&]w=([^&#]*)').exec(this.href); var width = ( results ) ? results[1] : 600; var results = new RegExp('[\\?&]h=([^&#]*)').exec(this.href); var height = ( results ) ? results[1] : 440; jQuery('#spinner').fadeIn(); var dialog = jQuery('<div style="display:hidden"></div>').appendTo('body'); // load the remote content dialog.load( this.href, {}, function () { jQuery('#spinner').hide(); dialog.dialog({ title: ($this.attr('title')) ? $this.attr('title') : '', width: width, height: height, modal: true, resizable: false, close: function() { dialog.remove(); } }).width(width - 30).height(height - 30); } ); //prevent the browser to follow the link return false; }); }); function checkAll(form) { for (i = 0, n = form.elements.length; i < n; i++) { if(form.elements[i].type == "checkbox") { if(form.elements[i].name == "doaction[]") { if(form.elements[i].checked == true) form.elements[i].checked = false; else form.elements[i].checked = true; } } } } function getNumChecked(form) { var num = 0; for (i = 0, n = form.elements.length; i < n; i++) { if(form.elements[i].type == "checkbox") { if(form.elements[i].name == "doaction[]") if(form.elements[i].checked == true) num++; } } return num; } // this function check for a the number of selected images, sumbmit false when no one selected function checkSelected() { var numchecked = getNumChecked(document.getElementById('updategallery')); if(numchecked < 1) { alert('<?php echo esc_js(__('No images selected', 'nggallery')); ?> '); return false; } actionId = jQuery('#bulkaction').val(); switch (actionId) { case "copy_to": showDialog('selectgallery', '<?php echo esc_js(__('Copy image to...', 'nggallery')); ?> '); return false; break; case "move_to": showDialog('selectgallery', '<?php echo esc_js(__('Move image to...', 'nggallery')); ?> '); return false; break; case "add_tags": showDialog('entertags', '<?php echo esc_js(__('Add new tags', 'nggallery')); ?> '); return false; break; case "delete_tags": showDialog('entertags', '<?php echo esc_js(__('Delete tags', 'nggallery')); ?> '); return false; break; case "overwrite_tags": showDialog('entertags', '<?php echo esc_js(__('Overwrite', 'nggallery')); ?> '); return false; break; case "resize_images": showDialog('resize_images', '<?php echo esc_js(__('Resize images', 'nggallery')); ?> '); return false; break; case "new_thumbnail": showDialog('new_thumbnail', '<?php echo esc_js(__('Create new thumbnails', 'nggallery')); ?> '); return false; break; } return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s images \n \n 'Cancel' to stop, 'OK' to proceed.", 'nggallery')), "' + numchecked + '"); ?> '); } jQuery(document).ready( function() { // close postboxes that should be closed jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); postboxes.add_postbox_toggles('ngg-manage-gallery'); }); //--> </script> <div class="wrap"> <?php screen_icon('nextgen-gallery'); if ($is_search) { ?> <h2><?php printf(__('Search results for “%s”', 'nggallery'), esc_html(get_search_query())); ?> </h2> <form class="search-form" action="" method="get"> <p class="search-box"> <label class="hidden" for="media-search-input"><?php _e('Search Images', 'nggallery'); ?> :</label> <input type="hidden" id="page-name" name="page" value="nggallery-manage-gallery" /> <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?> " /> <input type="submit" value="<?php _e('Search Images', 'nggallery'); ?> " class="button" /> </p> </form> <br style="clear: both;" /> <form id="updategallery" class="nggform" method="POST" action="<?php echo $ngg->manage_page->base_page . '&mode=edit&s=' . $_GET['s']; ?> " accept-charset="utf-8"> <?php wp_nonce_field('ngg_updategallery'); ?> <input type="hidden" name="page" value="manage-images" /> <?php } else { ?> <h2><?php echo _n('Gallery', 'Galleries', 1, 'nggallery'); ?> : <?php echo nggGallery::i18n($gallery->title); ?> </h2> <br style="clear: both;" /> <form id="updategallery" class="nggform" method="POST" action="<?php echo $ngg->manage_page->base_page . '&mode=edit&gid=' . $act_gid . '&paged=' . $_GET['paged']; ?> " accept-charset="utf-8"> <?php wp_nonce_field('ngg_updategallery'); ?> <input type="hidden" name="page" value="manage-images" /> <?php if (nggGallery::current_user_can('NextGEN Edit gallery options')) { ?> <div id="poststuff"> <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?> <div id="gallerydiv" class="postbox <?php echo postbox_classes('gallerydiv', 'ngg-manage-gallery'); ?> " > <h3><?php _e('Gallery settings', 'nggallery'); ?> <small> (<?php _e('Click here for more settings', 'nggallery'); ?> )</small></h3> <div class="inside"> <table class="form-table" > <tr> <th align="left"><?php _e('Title'); ?> :</th> <th align="left"><input <?php nggGallery::current_user_can_form('NextGEN Edit gallery title'); ?> type="text" size="50" name="title" value="<?php echo $gallery->title; ?> " /></th> <th align="right"><?php _e('Page Link to', 'nggallery'); ?> :</th> <th align="left"> <select <?php nggGallery::current_user_can_form('NextGEN Edit gallery page id'); ?> name="pageid" style="width:95%"> <option value="0" ><?php _e('Not linked', 'nggallery'); ?> </option> <?php parent_dropdown($gallery->pageid); ?> </select> </th> </tr> <tr> <th align="left"><?php _e('Description'); ?> :</th> <th align="left"><textarea <?php nggGallery::current_user_can_form('NextGEN Edit gallery description'); ?> name="gallerydesc" cols="30" rows="3" style="width: 95%" ><?php echo $gallery->galdesc; ?> </textarea></th> <th align="right"><?php _e('Preview image', 'nggallery'); ?> :</th> <th align="left"> <select <?php nggGallery::current_user_can_form('NextGEN Edit gallery preview pic'); ?> name="previewpic" style="width:95%" > <option value="0" ><?php _e('No Picture', 'nggallery'); ?> </option> <?php if (is_array($picturelist)) { foreach ($picturelist as $picture) { if ($picture->exclude) { continue; } $selected = $picture->pid == $gallery->previewpic ? 'selected="selected" ' : ''; echo '<option value="' . $picture->pid . '" ' . $selected . '>' . $picture->pid . ' - ' . $picture->filename . '</option>' . "\n"; } } ?> </select> </th> </tr> <tr> <th align="left"><?php _e('Path', 'nggallery'); ?> :</th> <th align="left"><input <?php if (is_multisite()) { echo 'readonly = "readonly"'; } ?> <?php nggGallery::current_user_can_form('NextGEN Edit gallery path'); ?> type="text" size="50" name="path" value="<?php echo $gallery->path; ?> " /></th> <th align="right"><?php _e('Author', 'nggallery'); ?> :</th> <th align="left"> <?php $editable_ids = $ngg->manage_page->get_editable_user_ids($user_ID); if ($editable_ids && count($editable_ids) > 1 && nggGallery::current_user_can('NextGEN Edit gallery author')) { wp_dropdown_users(array('include' => $editable_ids, 'name' => 'author', 'selected' => empty($gallery->author) ? 0 : $gallery->author)); } else { echo $act_author_user->display_name; } ?> </th> </tr> <?php if (current_user_can('publish_pages')) { ?> <tr> <th align="left"> </th> <th align="left"> </th> <th align="right"><?php _e('Create new page', 'nggallery'); ?> :</th> <th align="left"> <select name="parent_id" style="width:95%"> <option value="0"><?php _e('Main page (No parent)', 'nggallery'); ?> </option> <?php parent_dropdown(); ?> </select> <input class="button-secondary action" type="submit" name="addnewpage" value="<?php _e('Add page', 'nggallery'); ?> " id="group"/> </th> </tr> <?php } ?> <?php do_action('ngg_manage_gallery_settings', $act_gid); ?> </table> <div class="submit"> <input type="submit" class="button-secondary" name="scanfolder" value="<?php _e("Scan Folder for new images", 'nggallery'); ?> " /> <input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes", 'nggallery'); ?> " /> </div> </div> </div> </div> <!-- poststuff --> <?php } ?> <?php } ?> <div class="tablenav ngg-tablenav"> <?php if ($page_links) { ?> <div class="tablenav-pages"><?php $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s–%s of %s') . '</span>%s', number_format_i18n(($_GET['paged'] - 1) * $nggdb->paged['objects_per_page'] + 1), number_format_i18n(min($_GET['paged'] * $nggdb->paged['objects_per_page'], $nggdb->paged['total_objects'])), number_format_i18n($nggdb->paged['total_objects']), $page_links); echo $page_links_text; ?> </div> <?php } ?> <div class="alignleft actions"> <select id="bulkaction" name="bulkaction"> <option value="no_action" ><?php _e("Bulk actions", 'nggallery'); ?> </option> <option value="set_watermark" ><?php _e("Set watermark", 'nggallery'); ?> </option> <option value="new_thumbnail" ><?php _e("Create new thumbnails", 'nggallery'); ?> </option> <option value="resize_images" ><?php _e("Resize images", 'nggallery'); ?> </option> <option value="recover_images" ><?php _e("Recover from backup", 'nggallery'); ?> </option> <option value="delete_images" ><?php _e("Delete images", 'nggallery'); ?> </option> <option value="import_meta" ><?php _e("Import metadata", 'nggallery'); ?> </option> <option value="rotate_cw" ><?php _e("Rotate images clockwise", 'nggallery'); ?> </option> <option value="rotate_ccw" ><?php _e("Rotate images counter-clockwise", 'nggallery'); ?> </option> <option value="copy_to" ><?php _e("Copy to...", 'nggallery'); ?> </option> <option value="move_to"><?php _e("Move to...", 'nggallery'); ?> </option> <option value="add_tags" ><?php _e("Add tags", 'nggallery'); ?> </option> <option value="delete_tags" ><?php _e("Delete tags", 'nggallery'); ?> </option> <option value="overwrite_tags" ><?php _e("Overwrite tags", 'nggallery'); ?> </option> </select> <input class="button-secondary" type="submit" name="showThickbox" value="<?php _e('Apply', 'nggallery'); ?> " onclick="if ( !checkSelected() ) return false;" /> <?php if ($ngg->options['galSort'] == "sortorder" && !$is_search) { ?> <input class="button-secondary" type="submit" name="sortGallery" value="<?php _e('Sort gallery', 'nggallery'); ?> " /> <?php } ?> <input type="submit" name="updatepictures" class="button-primary action" value="<?php _e('Save Changes', 'nggallery'); ?> " /> </div> </div> <table id="ngg-listimages" class="widefat fixed" cellspacing="0" > <thead> <tr> <?php print_column_headers('nggallery-manage-images'); ?> </tr> </thead> <tfoot> <tr> <?php print_column_headers('nggallery-manage-images', false); ?> </tr> </tfoot> <tbody> <?php if ($picturelist) { $thumbsize = ''; if ($ngg->options['thumbfix']) { $thumbsize = 'width="' . $ngg->options['thumbwidth'] . '" height="' . $ngg->options['thumbheight'] . '"'; } foreach ($picturelist as $picture) { //for search result we need to check the capatibiliy if (!nggAdmin::can_manage_this_gallery($picture->author) && $is_search) { continue; } $counter++; $pid = (int) $picture->pid; $alternate = !isset($alternate) || $alternate == 'alternate' ? '' : 'alternate'; $exclude = $picture->exclude ? 'checked="checked"' : ''; $date = mysql2date(get_option('date_format'), $picture->imagedate); $time = mysql2date(get_option('time_format'), $picture->imagedate); ?> <tr id="picture-<?php echo $pid; ?> " class="<?php echo $alternate; ?> iedit" valign="top"> <?php foreach ($image_columns as $image_column_key => $column_display_name) { $class = "class=\"{$image_column_key} column-{$image_column_key}\""; $style = ''; if (in_array($image_column_key, $hidden_columns)) { $style = ' style="display:none;"'; } $attributes = "{$class}{$style}"; switch ($image_column_key) { case 'cb': ?> <th <?php echo $attributes; ?> scope="row"><input name="doaction[]" type="checkbox" value="<?php echo $pid; ?> " /></th> <?php break; case 'id': ?> <td <?php echo $attributes; ?> scope="row" style=""><?php echo $pid; ?> <input type="hidden" name="pid[]" value="<?php echo $pid; ?> " /> </td> <?php break; case 'filename': ?> <td <?php echo $attributes; ?> > <strong><a href="<?php echo $picture->imageURL; ?> " class="thickbox" title="<?php echo $picture->filename; ?> "> <?php echo empty($picture->alttext) ? $picture->filename : stripslashes(nggGallery::i18n($picture->alttext)); ?> </a></strong> <br /><?php echo $date; ?> <?php if (!empty($picture->meta_data)) { ?> <br /><?php echo $picture->meta_data['width']; ?> x <?php echo $picture->meta_data['height']; ?> <?php _e('pixel', 'nggallery'); ?> <?php } ?> <p> <?php $actions = array(); $actions['view'] = '<a class="thickbox" href="' . $picture->imageURL . '" title="' . esc_attr(sprintf(__('View "%s"'), $picture->filename)) . '">' . __('View', 'nggallery') . '</a>'; $actions['meta'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/showmeta.php?id=' . $pid . '" title="' . __('Show Meta data', 'nggallery') . '">' . __('Meta', 'nggallery') . '</a>'; $actions['custom_thumb'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/edit-thumbnail.php?id=' . $pid . '" title="' . __('Customize thumbnail', 'nggallery') . '">' . __('Edit thumb', 'nggallery') . '</a>'; $actions['rotate'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/rotate.php?id=' . $pid . '" title="' . __('Rotate', 'nggallery') . '">' . __('Rotate', 'nggallery') . '</a>'; if (current_user_can('publish_posts')) { $actions['publish'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/publish.php?id=' . $pid . '&h=230" title="' . __('Publish this image', 'nggallery') . '">' . __('Publish', 'nggallery') . '</a>'; } if (file_exists($picture->imagePath . '_backup')) { $actions['recover'] = '<a class="confirmrecover" href="' . wp_nonce_url("admin.php?page=nggallery-manage-gallery&mode=recoverpic&gid=" . $act_gid . "&pid=" . $pid, 'ngg_recoverpicture') . '" title="' . __('Recover', 'nggallery') . '" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Recover "%s" ?', 'nggallery'), $picture->filename)) . '\');if(check==false) return false;">' . __('Recover', 'nggallery') . '</a>'; } $actions['delete'] = '<a class="submitdelete" href="' . wp_nonce_url("admin.php?page=nggallery-manage-gallery&mode=delpic&gid=" . $act_gid . "&pid=" . $pid, 'ngg_delpicture') . '" class="delete column-delete" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Delete "%s" ?', 'nggallery'), $picture->filename)) . '\');if(check==false) return false;">' . __('Delete') . '</a>'; $action_count = count($actions); $i = 0; echo '<div class="row-actions">'; foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; ?> </p> </td> <?php break; case 'thumbnail': // generate the thumbnail size if the meta data available if (is_array($size = $picture->meta_data['thumbnail'])) { $thumbsize = 'width="' . $size['width'] . '" height="' . $size['height'] . '"'; } ?> <td <?php echo $attributes; ?> ><a href="<?php echo $picture->imageURL; if (strpos($picture->imageURL, '?')) { echo '&'; } else { echo '?'; } echo mt_rand(); ?> " class="thickbox" title="<?php echo $picture->filename; ?> "> <img class="thumb" src="<?php echo $picture->thumbURL; if (strpos($picture->thumbURL, '?')) { echo '&'; } else { echo '?'; } echo mt_rand(); ?> " <?php echo $thumbsize; ?> id="thumb<?php echo $pid; ?> " /> </a> </td> <?php break; case 'alt_title_desc': ?> <td <?php echo $attributes; ?> > <input name="alttext[<?php echo $pid; ?> ]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo stripslashes($picture->alttext); ?> " /><br/> <textarea name="description[<?php echo $pid; ?> ]" style="width:95%; margin-top: 2px;" rows="2" ><?php echo stripslashes($picture->description); ?> </textarea> </td> <?php break; case 'exclude': ?> <td <?php echo $attributes; ?> ><input name="exclude[<?php echo $pid; ?> ]" type="checkbox" value="1" <?php echo $exclude; ?> /></td> <?php break; case 'tags': $picture->tags = wp_get_object_terms($pid, 'ngg_tag', 'fields=names'); if (is_array($picture->tags)) { $picture->tags = implode(', ', $picture->tags); } ?> <td <?php echo $attributes; ?> ><textarea name="tags[<?php echo $pid; ?> ]" style="width:95%;" rows="2"><?php echo $picture->tags; ?> </textarea></td> <?php break; default: ?> <td <?php echo $attributes; ?> ><?php do_action('ngg_manage_image_custom_column', $image_column_key, $pid); ?> </td> <?php break; } ?> <?php } ?> </tr> <?php } } // In the case you have no capaptibility to see the search result if ($counter == 0) { echo '<tr><td colspan="' . $num_columns . '" align="center"><strong>' . __('No entries found', 'nggallery') . '</strong></td></tr>'; } ?> </tbody> </table> <div class="tablenav"> <input type="submit" class="button-primary action" name="updatepictures" value="<?php _e('Save Changes', 'nggallery'); ?> " /> <?php if ($page_links) { ?> <div class="tablenav-pages"><?php $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s–%s of %s') . '</span>%s', number_format_i18n(($_GET['paged'] - 1) * $nggdb->paged['objects_per_page'] + 1), number_format_i18n(min($_GET['paged'] * $nggdb->paged['objects_per_page'], $nggdb->paged['total_objects'])), number_format_i18n($nggdb->paged['total_objects']), $page_links); echo $page_links_text; ?> </div> <?php } ?> </div> </form> <br class="clear"/> </div><!-- /#wrap --> <!-- #entertags --> <div id="entertags" style="display: none;" > <form id="form-tags" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <input type="hidden" id="entertags_imagelist" name="TB_imagelist" value="" /> <input type="hidden" id="entertags_bulkaction" name="TB_bulkaction" value="" /> <input type="hidden" name="page" value="manage-images" /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr> <th><?php _e("Enter the tags", 'nggallery'); ?> : <input name="taglist" type="text" style="width:90%" value="" /></th> </tr> <tr align="right"> <td class="submit"> <input class="button-primary" type="submit" name="TB_EditTags" value="<?php _e("OK", 'nggallery'); ?> " /> <input class="button-secondary dialog-cancel" type="reset" value=" <?php _e("Cancel", 'nggallery'); ?> " /> </td> </tr> </table> </form> </div> <!-- /#entertags --> <!-- #selectgallery --> <div id="selectgallery" style="display: none;" > <form id="form-select-gallery" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <input type="hidden" id="selectgallery_imagelist" name="TB_imagelist" value="" /> <input type="hidden" id="selectgallery_bulkaction" name="TB_bulkaction" value="" /> <input type="hidden" name="page" value="manage-images" /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr> <th> <?php _e('Select the destination gallery:', 'nggallery'); ?> <select name="dest_gid" style="width:90%" > <?php foreach ($gallerylist as $gallery) { if ($gallery->gid != $act_gid) { ?> <option value="<?php echo $gallery->gid; ?> " ><?php echo $gallery->gid; ?> - <?php echo stripslashes($gallery->title); ?> </option> <?php } } ?> </select> </th> </tr> <tr align="right"> <td class="submit"> <input type="submit" class="button-primary" name="TB_SelectGallery" value="<?php _e("OK", 'nggallery'); ?> " /> <input class="button-secondary dialog-cancel" type="reset" value="<?php _e("Cancel", 'nggallery'); ?> " /> </td> </tr> </table> </form> </div> <!-- /#selectgallery --> <!-- #resize_images --> <div id="resize_images" style="display: none;" > <form id="form-resize-images" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value="" /> <input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value="" /> <input type="hidden" name="page" value="manage-images" /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr valign="top"> <td> <strong><?php _e('Resize Images to', 'nggallery'); ?> :</strong> </td> <td> <input type="text" size="5" name="imgWidth" value="<?php echo $ngg->options['imgWidth']; ?> " /> x <input type="text" size="5" name="imgHeight" value="<?php echo $ngg->options['imgHeight']; ?> " /> <br /><small><?php _e('Width x height (in pixel). NextGEN Gallery will keep ratio size', 'nggallery'); ?> </small> </td> </tr> <tr align="right"> <td colspan="2" class="submit"> <input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'nggallery'); ?> " /> <input class="button-secondary dialog-cancel" type="reset" value=" <?php _e('Cancel', 'nggallery'); ?> " /> </td> </tr> </table> </form> </div> <!-- /#resize_images --> <!-- #new_thumbnail --> <div id="new_thumbnail" style="display: none;" > <form id="form-new-thumbnail" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <input type="hidden" id="new_thumbnail_imagelist" name="TB_imagelist" value="" /> <input type="hidden" id="new_thumbnail_bulkaction" name="TB_bulkaction" value="" /> <input type="hidden" name="page" value="manage-images" /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr valign="top"> <th align="left"><?php _e('Width x height (in pixel)', 'nggallery'); ?> </th> <td><input type="text" size="5" maxlength="5" name="thumbwidth" value="<?php echo $ngg->options['thumbwidth']; ?> " /> x <input type="text" size="5" maxlength="5" name="thumbheight" value="<?php echo $ngg->options['thumbheight']; ?> " /> <br /><small><?php _e('These values are maximum values ', 'nggallery'); ?> </small></td> </tr> <tr valign="top"> <th align="left"><?php _e('Set fix dimension', 'nggallery'); ?> </th> <td><input type="checkbox" name="thumbfix" value="1" <?php checked('1', $ngg->options['thumbfix']); ?> /> <br /><small><?php _e('Ignore the aspect ratio, no portrait thumbnails', 'nggallery'); ?> </small></td> </tr> <tr align="right"> <td colspan="2" class="submit"> <input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'nggallery'); ?> " /> <input class="button-secondary dialog-cancel" type="reset" value=" <?php _e('Cancel', 'nggallery'); ?> " /> </td> </tr> </table> </form> </div> <!-- /#new_thumbnail --> <script type="text/javascript"> /* <![CDATA[ */ jQuery(document).ready(function(){columns.init('nggallery-manage-images');}); /* ]]> */ </script> <?php }
function output() { global $wpdb, $nggdb; //TODO:Code MUST be optimized, how to flag a used gallery better ? $used_list = $this->get_used_galleries(); ?> <script type="text/javascript"> jQuery(document).ready( function() { jQuery("#previewpic").nggAutocomplete( { type: 'image',domain: "<?php echo home_url('index.php', is_ssl() ? 'https' : 'http'); ?> ",width: "95%" }); jQuery('#selectContainer').sortable( { items: '.groupItem', placeholder: 'sort_placeholder', opacity: 0.7, tolerance: 'intersect', distance: 2, forcePlaceholderSize: true , connectWith: ['#galleryContainer'] } ); jQuery('#galleryContainer').sortable( { items: '.groupItem', placeholder: 'sort_placeholder', opacity: 0.7, tolerance: 'intersect', distance: 2, forcePlaceholderSize: true , connectWith: ['#selectContainer', '#albumContainer'] } ); jQuery('#albumContainer').sortable( { items: '.groupItem', placeholder: 'sort_placeholder', opacity: 0.7, tolerance: 'intersect', distance: 2, forcePlaceholderSize: true , connectWith: ['#galleryContainer'] } ); jQuery('a.min').bind('click', toggleContent); // Hide used galleries jQuery('a#toggle_used').click(function() { jQuery('#selectContainer div.inUse').toggle(); return false; } ); // Maximize All Portlets (whole site, no differentiation) jQuery('a#all_max').click(function() { jQuery('div.itemContent:hidden').show(); return false; } ); // Minimize All Portlets (whole site, no differentiation) jQuery('a#all_min').click(function() { jQuery('div.itemContent:visible').hide(); return false; } ); // Auto Minimize if more than 4 (whole site, no differentiation) if(jQuery('a.min').length > 4) { jQuery('a.min').html('[+]'); jQuery('div.itemContent:visible').hide(); jQuery('#selectContainer div.inUse').toggle(); }; } ); var toggleContent = function(e) { var targetContent = jQuery('div.itemContent', this.parentNode.parentNode); if (targetContent.css('display') == 'none') { targetContent.slideDown(300); jQuery(this).html('[-]'); } else { targetContent.slideUp(300); jQuery(this).html('[+]'); } return false; } function ngg_serialize(s) { //serial = jQuery.SortSerialize(s); serial = jQuery('#galleryContainer').sortable('serialize'); jQuery('input[name=sortorder]').val(serial); } function showDialog() { jQuery( "#editalbum").dialog({ width: 640, resizable : false, modal: true, title: '<?php echo esc_js(__('Edit Album', 'nggallery')); ?> ' }); jQuery('#editalbum .dialog-cancel').click(function() { jQuery( "#editalbum" ).dialog("close"); }); } </script> <div class="wrap album" id="wrap" > <?php screen_icon('nextgen-gallery'); ?> <h2><?php esc_html_e('Manage Albums', 'nggallery'); ?> </h2> <form id="selectalbum" method="POST" onsubmit="ngg_serialize()" accept-charset="utf-8"> <?php wp_nonce_field('ngg_album'); ?> <input name="sortorder" type="hidden" /> <div class="albumnav tablenav"> <div class="alignleft actions"> <?php esc_html_e('Select album', 'nggallery'); ?> <select id="act_album" name="act_album" onchange="this.form.submit();"> <option value="0" ><?php esc_html_e('No album selected', 'nggallery'); ?> </option> <?php if (is_array($this->albums)) { foreach ($this->albums as $album) { $selected = $this->currentID == $album->id ? 'selected="selected" ' : ''; echo '<option value="' . $album->id . '" ' . $selected . '>' . $album->id . ' - ' . esc_attr($album->name) . '</option>' . "\n"; } } ?> </select> <?php if ($this->currentID > 0) { ?> <input class="button-primary" type="submit" name="update" value="<?php esc_attr_e('Update', 'nggallery'); ?> "/> <?php if (nggGallery::current_user_can('NextGEN Edit album settings')) { ?> <input class="button-secondary" type="submit" name="showThickbox" value="<?php esc_attr_e('Edit album', 'nggallery'); ?> " onclick="showDialog(); return false;" /> <?php } ?> <?php if (nggGallery::current_user_can('NextGEN Add/Delete album')) { ?> <input class="button-secondary action "type="submit" name="delete" value="<?php esc_attr_e('Delete', 'nggallery'); ?> " onclick="javascript:check=confirm('<?php echo esc_js('Delete album ?', 'nggallery'); ?> ');if(check==false) return false;"/> <?php } ?> <?php } else { ?> <?php if (nggGallery::current_user_can('NextGEN Add/Delete album')) { ?> <span><?php esc_html_e('Add new album', 'nggallery'); ?> </span> <input class="search-input" id="newalbum" name="newalbum" type="text" value="" /> <input class="button-secondary action" type="submit" name="add" value="<?php esc_attr_e('Add', 'nggallery'); ?> "/> <?php } ?> <?php } ?> </div> </div> </form> <br class="clear"/> <div> <div style="float:right;"> <a href="#" title="<?php esc_attr_e('Show / hide used galleries', 'nggallery'); ?> " id="toggle_used"><?php esc_html_e('[Show all]', 'nggallery'); ?> </a> | <a href="#" title="<?php esc_attr_e('Maximize the widget content', 'nggallery'); ?> " id="all_max"><?php esc_html_e('[Maximize]', 'nggallery'); ?> </a> | <a href="#" title="<?php esc_attr_e('Minimize the widget content', 'nggallery'); ?> " id="all_min"><?php esc_html_e('[Minimize]', 'nggallery'); ?> </a> </div> <?php esc_html_e('After you create and select a album, you can drag and drop a gallery or another album into your new album below', 'nggallery'); ?> </div> <br class="clear" /> <div class="container"> <!-- /#album container --> <div class="widget widget-right"> <div class="widget-top"> <h3><?php esc_html_e('Select album', 'nggallery'); ?> </h3> </div> <div id="albumContainer" class="widget-holder"> <?php if (is_array($this->albums)) { foreach ($this->albums as $album) { $this->get_container('a' . $album->id); } } ?> </div> </div> <!-- /#select container --> <div class="widget widget-right"> <div class="widget-top"> <h3><?php esc_html_e('Select gallery', 'nggallery'); ?> </h3> </div> <div id="selectContainer" class="widget-holder"> <?php if (is_array($this->galleries)) { //get the array of galleries $sort_array = $this->currentID > 0 ? (array) $this->albums[$this->currentID]->galleries : array(); foreach ($this->galleries as $gallery) { if (!in_array($gallery->gid, $sort_array)) { if (in_array($gallery->gid, $used_list)) { $this->get_container($gallery->gid, true); } else { $this->get_container($gallery->gid, false); } } } } ?> </div> </div> <!-- /#target-album --> <div class="widget target-album widget-left"> <?php if ($this->currentID > 0) { $album = $this->albums[$this->currentID]; ?> <div class="widget-top"> <h3><?php esc_html_e('Album ID', 'nggallery'); ?> <?php echo $album->id . ' : ' . esc_html($album->name); ?> </h3> </div> <div id="galleryContainer" class="widget-holder target"> <?php $sort_array = (array) $this->albums[$this->currentID]->galleries; foreach ($sort_array as $galleryid) { $this->get_container($galleryid, false); } } else { ?> <div class="widget-top"> <h3><?php esc_html_e('No album selected!', 'nggallery'); ?> </h3> </div> <div class="widget-holder target"> <?php } ?> </div> </div><!-- /#target-album --> </div><!-- /#container --> </div><!-- /#wrap --> <?php if ($this->currentID > 0) { ?> <!-- #editalbum --> <div id="editalbum" style="display: none;" > <form id="form-edit-album" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <input type="hidden" id="current_album" name="act_album" value="<?php echo $this->currentID; ?> " /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr> <th> <?php esc_html_e('Album name:', 'nggallery'); ?> <br /> <input class="search-input" id="album_name" name="album_name" type="text" value="<?php echo esc_attr($album->name); ?> " style="width:95%" /> </th> </tr> <tr> <th> <?php esc_html_e('Album description:', 'nggallery'); ?> <br /> <textarea class="search-input" id="album_desc" name="album_desc" cols="50" rows="2" style="width:95%" ><?php echo esc_attr($album->albumdesc); ?> </textarea> </th> </tr> <tr> <th> <?php esc_html_e('Select a preview image:', 'nggallery'); ?> <br /> <select id="previewpic" name="previewpic" style="width:95%" > <?php if ($album->previewpic == 0) { } ?> <option value="0"><?php esc_html_e('No picture', 'nggallery'); ?> </option> <?php if ($album->previewpic == 0) { echo '<option value="0" selected="selected">' . __('No picture', 'nggallery') . '</option>'; } else { $picture = nggdb::find_image($album->previewpic); echo '<option value="' . $picture->pid . '" selected="selected" >' . $picture->pid . ' - ' . (empty($picture->alltext) ? esc_attr($picture->filename) : esc_attr($picture->alltext)) . ' </option>' . "\n"; } ?> </select> </th> </tr> <tr> <th> <?php esc_html_e('Page Link to', 'nggallery'); ?> <br /> <select name="pageid" style="width:95%"> <option value="0" ><?php esc_html_e('Not linked', 'nggallery'); ?> </option> <?php if (!isset($album->pageid)) { $album->pageid = 0; } parent_dropdown($album->pageid); ?> </select> </th> </tr> <?php do_action('ngg_edit_album_settings', $this->currentID); ?> <tr align="right"> <td class="submit"> <input type="submit" class="button-primary" name="update_album" value="<?php esc_attr_e('OK', 'nggallery'); ?> " /> <input class="button-secondary dialog-cancel" type="reset" value="<?php esc_attr_e('Cancel', 'nggallery'); ?> "/> </td> </tr> </table> </form> </div> <!-- /#editalbum --> <?php } ?> <?php }
;"> <table class="form-table"> <tbody> <tr> <th><label for="wpfaqGroup.pp_parent"><?php _e('Page Parent', $this->plugin_name); ?> </label></th> <td> <select id="wpfaqGroup.pp_parent" name="wpfaqGroup[pp_parent]"> <option value="0">- <?php _e('Main (no parent)', $this->plugin_name); ?> -</option> <?php parent_dropdown($wpfaqHtml->field_value('wpfaqGroup.pp_parent')); ?> </select> </td> </tr> </tbody> </table> </div> </div> </div> <p class="submit"> <input type="submit" name="save" value="<?php _e('Save Group', $this->plugin_name); ?> " class="button-primary" />
function nggallery_picturelist() { // *** show picture list global $wpdb, $user_ID, $ngg; // GET variables $act_gid = $ngg->manage_page->gid; $showTags = $ngg->manage_page->showTags; $hideThumbs = $ngg->manage_page->hideThumbs; // Load the gallery metadata $gallery = nggdb::find_gallery($act_gid); if (!$gallery) { nggGallery::show_error(__('Gallery not found.', 'nggallery')); return; } // get picture values $picturelist = nggdb::get_gallery($act_gid, $ngg->options['galSort'], $ngg->options['galSortDir'], false); // get the current author $act_author_user = get_userdata((int) $gallery->author); // list all galleries $gallerylist = nggdb::find_all_galleries(); ?> <script type="text/javascript"> function showDialog( windowId ) { var form = document.getElementById('updategallery'); var elementlist = ""; for (i = 0, n = form.elements.length; i < n; i++) { if(form.elements[i].type == "checkbox") { if(form.elements[i].name == "doaction[]") if(form.elements[i].checked == true) if (elementlist == "") elementlist = form.elements[i].value else elementlist += "," + form.elements[i].value ; } } jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val()); jQuery("#" + windowId + "_imagelist").val(elementlist); // console.log (jQuery("#TB_imagelist").val()); tb_show("", "#TB_inline?width=640&height=120&inlineId=" + windowId + "&modal=true", false); } </script> <script type="text/javascript"> <!-- function checkAll(form) { for (i = 0, n = form.elements.length; i < n; i++) { if(form.elements[i].type == "checkbox") { if(form.elements[i].name == "doaction[]") { if(form.elements[i].checked == true) form.elements[i].checked = false; else form.elements[i].checked = true; } } } } function getNumChecked(form) { var num = 0; for (i = 0, n = form.elements.length; i < n; i++) { if(form.elements[i].type == "checkbox") { if(form.elements[i].name == "doaction[]") if(form.elements[i].checked == true) num++; } } return num; } // this function check for a the number of selected images, sumbmit false when no one selected function checkSelected() { var numchecked = getNumChecked(document.getElementById('updategallery')); if(numchecked < 1) { alert('<?php echo js_escape(__("No images selected", 'nggallery')); ?> '); return false; } //TODO: For copy to and move to we need some better way around if (jQuery('#bulkaction').val() == 'copy_to') { showDialog('selectgallery'); return false; } if (jQuery('#bulkaction').val() == 'move_to') { showDialog('selectgallery'); return false; } return confirm('<?php echo sprintf(js_escape(__("You are about to start the bulk edit for %s images \n \n 'Cancel' to stop, 'OK' to proceed.", 'nggallery')), "' + numchecked + '"); ?> '); } jQuery(document).ready( function() { // close postboxes that should be closed jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); if (typeof postboxes != "undefined") postboxes.add_postbox_toggles('ngg-manage-gallery'); // WP 2.7 else add_postbox_toggles('ngg-manage-gallery'); // WP 2.6 }); //--> </script> <div class="wrap"> <h2><?php echo __ngettext('Gallery', 'Galleries', 1, 'nggallery'); ?> : <?php echo $gallery->title; ?> </h2> <br style="clear: both;" /> <form id="updategallery" class="nggform" method="POST" action="<?php echo $ngg->manage_page->base_page . '&mode=edit&gid=' . $act_gid; ?> " accept-charset="utf-8"> <?php wp_nonce_field('ngg_updategallery'); ?> <?php if ($showTags) { ?> <input type="hidden" name="showTags" value="true" /><?php } if ($hideThumbs) { ?> <input type="hidden" name="hideThumbs" value="true" /><?php } ?> <div id="poststuff"> <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?> <div id="gallerydiv" class="postbox <?php echo postbox_classes('gallerydiv', 'ngg-manage-gallery'); ?> " > <h3><?php _e('Gallery settings', 'nggallery'); ?> <small> (<?php _e('Click here for more settings', 'nggallery'); ?> )</small></h3> <div class="inside"> <table class="form-table" > <tr> <th align="left"><?php _e('Title'); ?> :</th> <th align="left"><input type="text" size="50" name="title" value="<?php echo $gallery->title; ?> " /></th> <th align="right"><?php _e('Page Link to', 'nggallery'); ?> :</th> <th align="left"> <select name="pageid" style="width:95%"> <option value="0" ><?php _e('Not linked', 'nggallery'); ?> </option> <?php parent_dropdown($gallery->pageid); ?> </select> </th> </tr> <tr> <th align="left"><?php _e('Description'); ?> :</th> <th align="left"><textarea name="gallerydesc" cols="30" rows="3" style="width: 95%" ><?php echo $gallery->galdesc; ?> </textarea></th> <th align="right"><?php _e('Preview image', 'nggallery'); ?> :</th> <th align="left"> <select name="previewpic" style="width:95%" > <option value="0" ><?php _e('No Picture', 'nggallery'); ?> </option> <?php if (is_array($picturelist)) { foreach ($picturelist as $picture) { $selected = $picture->pid == $gallery->previewpic ? 'selected="selected" ' : ''; echo '<option value="' . $picture->pid . '" ' . $selected . '>' . $picture->pid . ' - ' . $picture->filename . '</option>' . "\n"; } } ?> </select> </th> </tr> <tr> <th align="left"><?php _e('Path', 'nggallery'); ?> :</th> <th align="left"><input <?php if (IS_WPMU) { echo 'readonly = "readonly"'; } ?> type="text" size="50" name="path" value="<?php echo $gallery->path; ?> " /></th> <th align="right"><?php _e('Author', 'nggallery'); ?> :</th> <th align="left"> <?php $editable_ids = $ngg->manage_page->get_editable_user_ids($user_ID); if ($editable_ids && count($editable_ids) > 1) { wp_dropdown_users(array('include' => $editable_ids, 'name' => 'author', 'selected' => empty($gallery->author) ? 0 : $gallery->author)); } else { echo $act_author_user->display_name; } ?> </th> </tr> <tr> <th align="left"> </th> <th align="left"> </th> <th align="right"><?php _e('Create new page', 'nggallery'); ?> :</th> <th align="left"> <select name="parent_id" style="width:95%"> <option value="0"><?php _e('Main page (No parent)', 'nggallery'); ?> </option> <?php parent_dropdown(); ?> </select> <input class="button-secondary action" type="submit" name="addnewpage" value="<?php _e('Add page', 'nggallery'); ?> " id="group"/> </th> </tr> </table> <div class="submit"> <input type="submit" class="button-secondary" name="scanfolder" value="<?php _e("Scan Folder for new images", 'nggallery'); ?> " /> <input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes", 'nggallery'); ?> " /> </div> </div> </div> </div> <!-- poststuff --> <div class="tablenav ngg-tablenav"> <div class="alignleft actions" style="float: left;"> <select id="bulkaction" name="bulkaction"> <option value="no_action" ><?php _e("No action", 'nggallery'); ?> </option> <?php if (!$showTags) { ?> <option value="set_watermark" ><?php _e("Set watermark", 'nggallery'); ?> </option> <option value="new_thumbnail" ><?php _e("Create new thumbnails", 'nggallery'); ?> </option> <option value="resize_images" ><?php _e("Resize images", 'nggallery'); ?> </option> <option value="delete_images" ><?php _e("Delete images", 'nggallery'); ?> </option> <option value="import_meta" ><?php _e("Import metadata", 'nggallery'); ?> </option> <option value="copy_to" ><?php _e("Copy to...", 'nggallery'); ?> </option> <option value="move_to"><?php _e("Move to...", 'nggallery'); ?> </option> <?php } else { ?> <option value="add_tags" ><?php _e("Add tags", 'nggallery'); ?> </option> <option value="delete_tags" ><?php _e("Delete tags", 'nggallery'); ?> </option> <option value="overwrite_tags" ><?php _e("Overwrite tags", 'nggallery'); ?> </option> <?php } ?> </select> <?php if (!$showTags) { ?> <input class="button-secondary" type="submit" name="doaction" value="<?php _e("OK", 'nggallery'); ?> " onclick="if ( !checkSelected() ) return false;" /> <?php } else { ?> <input class="button-secondary" type="submit" name="showThickbox" value="<?php _e("OK", 'nggallery'); ?> " onclick="showDialog('tags'); return false;" /> <?php } ?> <?php if (!$hideThumbs) { ?> <input class="button-secondary" type="submit" name="togglethumbs" value="<?php _e("Hide thumbnails ", 'nggallery'); ?> " /> <?php } else { ?> <input class="button-secondary" type="submit" name="togglethumbs" value="<?php _e("Show thumbnails ", 'nggallery'); ?> " /> <?php } ?> <?php if (!$showTags) { ?> <input class="button-secondary" type="submit" name="toggletags" value="<?php _e("Show tags", 'nggallery'); ?> " /> <?php } else { ?> <input class="button-secondary" type="submit" name="toggletags" value="<?php _e("Hide tags", 'nggallery'); ?> " /> <?php } ?> <?php if ($ngg->options['galSort'] == "sortorder") { ?> <input class="button-secondary" type="submit" name="sortGallery" value="<?php _e("Sort gallery", 'nggallery'); ?> " /> <?php } ?> </div> <span style="float:right; padding:2px 8px 0 0;"><input type="submit" name="updatepictures" class="button-primary action" value="<?php _e("Save Changes", 'nggallery'); ?> " /></span> </div> <table id="ngg-listimages" class="widefat" > <thead> <tr> <?php $gallery_columns = ngg_manage_gallery_columns(); ?> <?php foreach ($gallery_columns as $gallery_column_key => $column_display_name) { switch ($gallery_column_key) { case 'cb': $class = ' class="check-column;"'; break; case 'tags': $class = ' style="width:70%;"'; break; case 'action': $class = ' colspan="3" style="text-align: center;"'; break; default: $class = ' style="text-align: center;"'; } ?> <th scope="col"<?php echo $class; ?> ><?php echo $column_display_name; ?> </th> <?php } ?> </tr> </thead> <tfoot> <tr> <?php foreach ($gallery_columns as $gallery_column_key => $column_display_name) { switch ($gallery_column_key) { case 'cb': $class = ' class="check-column;"'; break; case 'tags': $class = ' style="width:70%;"'; break; case 'action': $class = ' colspan="3" style="text-align: center;"'; break; default: $class = ' style="text-align: center;"'; } ?> <th scope="col"<?php echo $class; ?> ><?php echo $column_display_name; ?> </th> <?php } ?> </tr> </tfoot> <tbody> <?php if ($picturelist) { $thumbsize = ""; if ($ngg->options['thumbfix']) { $thumbsize = 'width="' . $ngg->options['thumbwidth'] . '" height="' . $ngg->options['thumbheight'] . '"'; } if ($ngg->options['thumbcrop']) { $thumbsize = 'width="' . $ngg->options['thumbwidth'] . '" height="' . $ngg->options['thumbwidth'] . '"'; } foreach ($picturelist as $picture) { $pid = (int) $picture->pid; $class = $class == 'class="alternate"' ? '' : 'class="alternate"'; $exclude = $picture->exclude ? 'checked="checked"' : ''; $date = mysql2date(get_option('date_format'), $picture->imagedate); $time = mysql2date(get_option('time_format'), $picture->imagedate); ?> <tr id="picture-<?php echo $pid; ?> " <?php echo $class; ?> style="text-align:center"> <?php foreach ($gallery_columns as $gallery_column_key => $column_display_name) { switch ($gallery_column_key) { case 'cb': ?> <td class="check-column" scope="row"><input name="doaction[]" type="checkbox" value="<?php echo $pid; ?> " /></td> <?php break; case 'id': ?> <td class="id column-id" scope="row" style="text-align: center"><?php echo $pid; ?> </td> <?php break; case 'filename': ?> <td class="media-icon" style="text-align: left;"> <a href="<?php echo $picture->imageURL; ?> " class="thickbox" title="<?php echo $picture->filename; ?> "> <?php echo $picture->filename; ?> </a> <br /><?php echo $date; ?> </td> <?php break; case 'thumbnail': ?> <td class="thumbnail column-thumbnail"><a href="<?php echo $picture->imageURL; ?> " class="thickbox" title="<?php echo $picture->filename; ?> "> <img class="thumb" src="<?php echo $picture->thumbURL; ?> " <?php echo $thumbsize; ?> /> </a> <br /><?php echo $date; ?> </td> <?php break; case 'alt_title_desc': ?> <td class="altdesc column-altdesc" style="width:500px"> <input name="alttext[<?php echo $pid; ?> ]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo stripslashes($picture->alttext); ?> " /><br/> <textarea name="description[<?php echo $pid; ?> ]" style="width:95%; margin-top: 2px;" rows="2" ><?php echo stripslashes($picture->description); ?> </textarea> </td> <?php break; case 'description': ?> <td class="description column-description"><textarea name="description[<?php echo $pid; ?> ]" class="textarea1" cols="42" rows="2" ><?php echo stripslashes($picture->description); ?> </textarea></td> <?php break; case 'alt_title_text': ?> <td class="alttext column-alttext"><input name="alttext[<?php echo $pid; ?> ]" type="text" size="30" value="<?php echo stripslashes($picture->alttext); ?> " /></td> <?php break; case 'exclude': ?> <td class="exclude column-exclude"><input name="exclude[<?php echo $pid; ?> ]" type="checkbox" value="1" <?php echo $exclude; ?> /></td> <?php break; case 'tags': $picture->tags = wp_get_object_terms($pid, 'ngg_tag', 'fields=names'); if (is_array($picture->tags)) { $picture->tags = implode(', ', $picture->tags); } ?> <td class="tags column-tags" style="width:500px;"><textarea name="tags[<?php echo $pid; ?> ]" style="width:95%;" rows="2"><?php echo $picture->tags; ?> </textarea></td> <?php break; case 'action': ?> <td><a href="<?php echo NGGALLERY_URLPATH . "admin/showmeta.php?id=" . $pid; ?> " class="thickbox" title="<?php _e("Show Meta data", 'nggallery'); ?> " ><?php _e('Meta'); ?> </a></td> <td><a href="<?php echo wp_nonce_url("admin.php?page=nggallery-manage-gallery&mode=delpic&gid=" . $act_gid . "&pid=" . $pid, 'ngg_delpicture'); ?> " class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this file ?", 'nggallery'); ?> ');if(check==false) return false;" ><?php _e('Delete'); ?> </a></td> <?php break; default: ?> <td><?php do_action('ngg_manage_gallery_custom_column', $gallery_column_key, $pid); ?> </td> <?php break; } ?> <?php } ?> </tr> <?php } } else { echo '<tr><td colspan="8" align="center"><strong>' . __('No entries found', 'nggallery') . '</strong></td></tr>'; } ?> </tbody> </table> <p class="submit"><input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes", 'nggallery'); ?> " /></p> </form> <br class="clear"/> </div><!-- /#wrap --> <!-- #entertags --> <div id="tags" style="display: none;" > <form id="form-tags" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <?php if ($showTags) { ?> <input type="hidden" name="showTags" value="true" /><?php } ?> <?php if ($hideThumbs) { ?> <input type="hidden" name="hideThumbs" value="true" /><?php } ?> <input type="hidden" id="tags_imagelist" name="TB_imagelist" value="" /> <input type="hidden" id="tags_bulkaction" name="TB_bulkaction" value="" /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr> <th><?php _e("Enter the tags", 'nggallery'); ?> : <input name="taglist" type="text" style="width:90%" value="" /></th> </tr> <tr align="right"> <td class="submit"> <input class="button-primary" type="submit" name="TB_EditTags" value="<?php _e("OK", 'nggallery'); ?> " onclick="var numchecked = getNumChecked(document.getElementById('updategallery')); if(numchecked < 1) { alert('<?php echo js_escape(__("No images selected", 'nggallery')); ?> '); tb_remove(); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to start the bulk edit for %s images \n \n 'Cancel' to stop, 'OK' to proceed.", 'nggallery')), "' + numchecked + '"); ?> ')" /> <input class="button-secondary" type="reset" value=" <?php _e("Cancel", 'nggallery'); ?> " onclick="tb_remove()"/> </td> </tr> </table> </form> </div> <!-- /#entertags --> <!-- #selectgallery --> <div id="selectgallery" style="display: none;" > <form id="form-select-gallery" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <?php if ($showTags) { ?> <input type="hidden" name="showTags" value="true" /><?php } ?> <?php if ($hideThumbs) { ?> <input type="hidden" name="hideThumbs" value="true" /><?php } ?> <input type="hidden" id="selectgallery_imagelist" name="TB_imagelist" value="" /> <input type="hidden" id="selectgallery_bulkaction" name="TB_bulkaction" value="" /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr> <th> <?php _e("Select the destination gallery:", 'nggallery'); ?> <select name="dest_gid" style="width:90%" > <?php foreach ($gallerylist as $gallery) { if ($gallery->gid != $act_gid) { ?> <option value="<?php echo $gallery->gid; ?> " ><?php echo $gallery->gid; ?> - <?php echo stripslashes($gallery->title); ?> </option> <?php } } ?> </select> </th> </tr> <tr align="right"> <td class="submit"> <input type="submit" class="button-primary" name="TB_SelectGallery" value="<?php _e("OK", 'nggallery'); ?> " onclick="var numchecked = getNumChecked(document.getElementById('updategallery')); if(numchecked < 1) { alert('<?php echo js_escape(__("No images selected", 'nggallery')); ?> '); tb_remove(); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to copy or move %s images \n \n 'Cancel' to stop, 'OK' to proceed.", 'nggallery')), "' + numchecked + '"); ?> ')" /> <input class="button-secondary" type="reset" value="<?php _e("Cancel", 'nggallery'); ?> " onclick="tb_remove()"/> </td> </tr> </table> </form> </div> <!-- /#selectgallery --> <?php }
<th scope="row"> <?php _e('Community Page:', $this->ID); ?> </th> <td> <?php if ($this->allowAdmin('page_id')) { ?> <select name="settings[page_id]"> <option value="0">-- <?php _e('Not set', $this->ID); ?> --</option> <?php parent_dropdown($settings['page_id']); ?> </select><br /> <span class="setting-description"><?php _e('The page where to show all community outputs. <strong>You have to create this page first.</strong>', $this->ID); ?> </span> <?php } ?> </td> </tr> </table> </dd> </dl>
function page_parent_meta_box($post){ ?> <label class="hidden" for="parent_id"><?php _e('Page Parent') ?></label> <select name="parent_id" id="parent_id"> <option value='0'><?php _e('Main Page (no parent)'); ?></option> <?php parent_dropdown($post->post_parent); ?> </select> <p><?php _e('You can arrange your pages in hierarchies, for example you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how deeply nested you can make pages.'); ?></p> <?php }
echo $wpfaqHtml->field_value('wpfaqQuestion.pp') == "page" ? 'block' : 'none'; ?> ;"> <!-- Page Parent --> <p> <label style="font-weight:bold;" for="wpfaqQuestion.pp_parent"><?php _e('Page Parent', $this->plugin_name); ?> </label><br/> <select id="wpfaqQuestion.pp_parent" name="wpfaqQuestion[pp_parent]"> <option value="0">- <?php _e('Main (no parent)', $this->plugin_name); ?> -</option> <?php parent_dropdown($wpfaqHtml->field_value('wpfaqQuestion.pp_parent')); ?> </select> </p> </div> <!-- Post/Page Title --> <p> <label style="font-weight:bold;" for="wpfaqQuestion.pp_title"><?php _e('Post/Page Title', $this->plugin_name); ?> </label><br/> <?php /*<input type="text" name="wpfaqQuestion[pp_title]" value="<?php echo esc_attr(stripslashes($wpfaqHtml -> field_value('wpfaqQuestion.pp_title'))); ?>" id="wpfaqQuestion.pp_title" />*/ ?> <?php
function nggallery_picturelist() { // *** show picture list global $wpdb, $nggdb, $user_ID, $ngg; // Look if its a search result $is_search = isset($_GET['s']) ? true : false; $counter = 0; $wp_list_table = new _NGG_Images_List_Table('nggallery-manage-images'); if ($is_search) { // fetch the imagelist $picturelist = $ngg->manage_page->search_result; // we didn't set a gallery or a pagination $act_gid = 0; $_GET['paged'] = 1; $page_links = false; } else { // GET variables $act_gid = $ngg->manage_page->gid; // Load the gallery metadata $gallery = $nggdb->find_gallery($act_gid); if (!$gallery) { nggGallery::show_error(__('Gallery not found.', 'nggallery')); return; } // Check if you have the correct capability if (!nggAdmin::can_manage_this_gallery($gallery->author)) { nggGallery::show_error(__('Sorry, you have no access here', 'nggallery')); return; } // look for pagination $_GET['paged'] = isset($_GET['paged']) && $_GET['paged'] > 0 ? absint($_GET['paged']) : 1; $start = ($_GET['paged'] - 1) * 50; // get picture values $picturelist = $nggdb->get_gallery($act_gid, $ngg->options['galSort'], $ngg->options['galSortDir'], false, 50, $start); // get the current author $act_author_user = get_userdata((int) $gallery->author); } // list all galleries $gallerylist = $nggdb->find_all_galleries(); //get the columns $image_columns = $wp_list_table->get_columns(); $hidden_columns = get_hidden_columns('nggallery-manage-images'); $num_columns = count($image_columns) - count($hidden_columns); $attr = nggGallery::current_user_can('NextGEN Edit gallery options') ? '' : 'disabled="disabled"'; ?> <script type="text/javascript"> <!-- function showDialog( windowId, title ) { var form = document.getElementById('updategallery'); var elementlist = ""; for (i = 0, n = form.elements.length; i < n; i++) { if(form.elements[i].type == "checkbox") { if(form.elements[i].name == "doaction[]") if(form.elements[i].checked == true) if (elementlist == "") elementlist = form.elements[i].value else elementlist += "," + form.elements[i].value ; } } jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val()); jQuery("#" + windowId + "_imagelist").val(elementlist); // now show the dialog jQuery( "#" + windowId ).dialog({ width: 640, resizable : false, modal: true, title: title }); jQuery("#" + windowId + ' .dialog-cancel').click(function() { jQuery( "#" + windowId ).dialog("close"); }); } jQuery(function (){ //Format for mysql: yy-mm-dd 00:00:00 //Load up the datepicker jQuery(".datepicker").datepicker({ dateFormat:"MM dd, yy", showOn:"focus", onSelect: function(date) { //Turn date into mysql and move things around var mydate = jQuery.datepicker.formatDate("yy-mm-dd 00:00:00", new Date(date)); jQuery(this).siblings('.rawdate').attr('value',mydate); jQuery(this).siblings(".date").html(date); jQuery(this).siblings(".date").toggle(); jQuery(this).toggle(); jQuery(".change").toggle(); jQuery(this).datepicker("hide"); //Hide the datepicker in case user pressed enter } }); //When the user clicks change jQuery(".change").click(function() { //Show the input and hide the span jQuery(this).siblings(".date").toggle(); jQuery(this).siblings(".datepicker").toggle(); //jQuery(this).toggle(); jQuery(".change").toggle(); //All buttons disabled }); // load a content via ajax jQuery('a.ngg-dialog').click(function() { if ( jQuery( "#spinner" ).length == 0) jQuery("body").append('<div id="spinner"></div>'); var $this = jQuery(this); jQuery('#spinner').fadeIn(); var dialog = jQuery('<div style="display:hidden"></div>').appendTo('body'); // load the remote content dialog.load( this.href, {}, function () { jQuery('#spinner').hide(); dialog.dialog({ title: ($this.attr('title')) ? $this.attr('title') : '', width: 'auto', height: 'auto', modal: true, resizable: true, position: { my: "center", at: "center", of: window }, close: function() { dialog.remove(); } }); } ); //prevent the browser to follow the link return false; }); }); function checkAll(form) { for (i = 0, n = form.elements.length; i < n; i++) { if(form.elements[i].type == "checkbox") { if(form.elements[i].name == "doaction[]") { if(form.elements[i].checked == true) form.elements[i].checked = false; else form.elements[i].checked = true; } } } } function getNumChecked(form) { var num = 0; for (i = 0, n = form.elements.length; i < n; i++) { if(form.elements[i].type == "checkbox") { if(form.elements[i].name == "doaction[]") if(form.elements[i].checked == true) num++; } } return num; } // this function check for a the number of selected images, sumbmit false when no one selected function checkSelected() { var numchecked = getNumChecked(document.getElementById('updategallery')); if (typeof document.activeElement == "undefined" && document.addEventListener) { document.addEventListener("focus", function (e) { document.activeElement = e.target; }, true); } if ( document.activeElement.name == 'post_paged' ) return true; if(numchecked < 1) { alert('<?php echo esc_js(__('No images selected', 'nggallery')); ?> '); return false; } actionId = jQuery('#bulkaction').val(); switch (actionId) { case "copy_to": showDialog('selectgallery', '<?php echo esc_js(__('Copy image to...', 'nggallery')); ?> '); return false; break; case "move_to": showDialog('selectgallery', '<?php echo esc_js(__('Move image to...', 'nggallery')); ?> '); return false; break; case "add_tags": showDialog('entertags', '<?php echo esc_js(__('Add new tags', 'nggallery')); ?> '); return false; break; case "delete_tags": showDialog('entertags', '<?php echo esc_js(__('Delete tags', 'nggallery')); ?> '); return false; break; case "overwrite_tags": showDialog('entertags', '<?php echo esc_js(__('Overwrite', 'nggallery')); ?> '); return false; break; case "resize_images": showDialog('resize_images', '<?php echo esc_js(__('Resize images', 'nggallery')); ?> '); return false; break; case "new_thumbnail": showDialog('new_thumbnail', '<?php echo esc_js(__('Create new thumbnails', 'nggallery')); ?> '); return false; break; } return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s images \n \n 'Cancel' to stop, 'OK' to proceed.", 'nggallery')), "' + numchecked + '"); ?> '); } jQuery(document).ready( function() { // close postboxes that should be closed jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); postboxes.add_postbox_toggles('ngg-manage-gallery'); }); //--> </script> <div class="wrap"> <?php screen_icon('nextgen-gallery'); if ($is_search) { ?> <h2><?php printf(__('Search results for “%s”', 'nggallery'), esc_html(get_search_query())); ?> </h2> <form class="search-form" action="" method="get"> <p class="search-box"> <label class="hidden" for="media-search-input"><?php _e('Search Images', 'nggallery'); ?> :</label> <input type="hidden" id="page-name" name="page" value="nggallery-manage-gallery" /> <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?> " /> <input type="submit" value="<?php _e('Search Images', 'nggallery'); ?> " class="button" /> </p> </form> <br style="clear: both;" /> <form id="updategallery" class="nggform" method="POST" action="<?php echo $ngg->manage_page->base_page . '&mode=edit&s=' . get_search_query(); ?> " accept-charset="utf-8"> <?php wp_nonce_field('ngg_updategallery'); ?> <input type="hidden" name="page" value="manage-images" /> <?php } else { ?> <h2><?php echo _e('Gallery', 'nggallery'); ?> <?php echo esc_html(nggGallery::i18n($gallery->title)); ?> </h2> <br style="clear: both;" /> <form id="updategallery" class="nggform" method="POST" action="<?php echo $ngg->manage_page->base_page . '&mode=edit&gid=' . $act_gid . '&paged=' . $_GET['paged']; ?> " accept-charset="utf-8"> <?php wp_nonce_field('ngg_updategallery'); ?> <input type="hidden" name="page" value="manage-images" /> <?php if (nggGallery::current_user_can('NextGEN Edit gallery options')) { ?> <div id="poststuff"> <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?> <div id="gallerydiv" class="postbox <?php echo postbox_classes('gallerydiv', 'ngg-manage-gallery'); ?> " > <h3 class="hndle"><?php _e('Gallery settings', 'nggallery'); ?> <small> (<?php _e('Click here for more settings', 'nggallery'); ?> )</small></h3> <div class="inside"> <table class="form-table" id="gallery-properties"> <tr> <td align="left"><label for="title"><?php _e('Title'); ?> :</label></td> <td align="left"><input <?php nggGallery::current_user_can_form('NextGEN Edit gallery title'); ?> type="text" size="50" id="title" name="title" value="<?php echo $gallery->title; ?> " /></td> <td align="right"><label for="pageid"><?php _e('Page Link to', 'nggallery'); ?> :</label></td> <td align="left"> <select <?php nggGallery::current_user_can_form('NextGEN Edit gallery page id'); ?> id="pageid" name="pageid" style="width:95%"> <option value="0" ><?php _e('Not linked', 'nggallery'); ?> </option> <?php $err = error_reporting(0); ?> <?php parent_dropdown(intval($gallery->pageid)); ?> <?php error_reporting($err); ?> </select> </td> </tr> <tr> <td align="left"><label for="gallerydesc"><?php _e('Description'); ?> :</label></td> <td align="left"><textarea <?php nggGallery::current_user_can_form('NextGEN Edit gallery description'); ?> name="gallerydesc" id="gallerydesc" cols="50" rows="3" style="width: 95%" ><?php echo $gallery->galdesc; ?> </textarea></td> <td align="right"><label for="previewpic"><?php _e('Preview image', 'nggallery'); ?> :</label></td> <td align="left"> <select <?php nggGallery::current_user_can_form('NextGEN Edit gallery preview pic'); ?> name="previewpic" id="previewpic" style="width:95%" > <option value="0" ><?php _e('No Picture', 'nggallery'); ?> </option> <?php // ensure that a preview pic from a other page is still shown here if (intval($gallery->previewpic) != 0) { if (!array_key_exists($gallery->previewpic, $picturelist)) { $previewpic = $nggdb->find_image($gallery->previewpic); if ($previewpic) { echo '<option value="' . $previewpic->pid . '" selected="selected" >' . $previewpic->pid . ' - ' . esc_attr($previewpic->filename) . '</option>' . "\n"; } } } if (is_array($picturelist)) { foreach ($picturelist as $picture) { if ($picture->exclude) { continue; } $selected = $picture->pid == $gallery->previewpic ? 'selected="selected" ' : ''; echo '<option value="' . $picture->pid . '" ' . $selected . '>' . $picture->pid . ' - ' . esc_attr($picture->filename) . '</option>' . "\n"; } } ?> </select> </td> </tr> <tr> <td align="left"><label for="path"><?php _e('Path', 'nggallery'); ?> :</label></td> <td align="left"><input <?php if (is_multisite()) { echo 'readonly = "readonly"'; } ?> <?php nggGallery::current_user_can_form('NextGEN Edit gallery path'); ?> type="text" size="50" name="path" id="path" value="<?php echo $gallery->path; ?> " /></td> <td align="right"><label for="author"><?php _e('Author', 'nggallery'); ?> :</label></td> <td align="left"> <?php $editable_ids = $ngg->manage_page->get_editable_user_ids($user_ID); if ($editable_ids && count($editable_ids) > 1 && nggGallery::current_user_can('NextGEN Edit gallery author')) { wp_dropdown_users(array('include' => $editable_ids, 'name' => 'author', 'id' => 'author', 'selected' => empty($gallery->author) ? 0 : $gallery->author)); } else { echo $act_author_user->display_name; } ?> </td> </tr> <?php if (current_user_can('publish_pages')) { ?> <tr> <td align="left"><?php _e('Gallery ID', 'nggallery'); ?> :</td> <td align="right"><?php echo $gallery->gid; ?> </td> <td align="right"><label for="parent_id"><?php _e('Create new page', 'nggallery'); ?> :</label></td> <td align="left"> <select name="parent_id" id="parent_id" style="width:95%"> <option value="0"><?php _e('Main page (No parent)', 'nggallery'); ?> </option> <?php if (get_post()) { ?> <?php parent_dropdown(); ?> <?php } ?> </select> <input class="button-secondary action" type="submit" name="addnewpage" value="<?php _e('Add page', 'nggallery'); ?> " id="group"/> </td> </tr> <?php } ?> <?php do_action('ngg_manage_gallery_settings', $act_gid); ?> </table> <div class="submit"> <!-- To remove in future versions --> <input type="submit" onclick="return confirm('<?php _e("This will change folder and file names (e.g. remove spaces, special characters, ...)", "nggallery"); ?> \n\n<?php _e("You will need to update your URLs if you link directly to the images.", "nggallery"); ?> \n\n<?php _e("Press OK to proceed, and Cancel to stop.", "nggallery"); ?> ')" class="button-secondary" name="scanfolder" value="<?php _e("Scan folder for new images", 'nggallery'); ?> " /> <input type="submit" class="button-secondary" name="oldscanfolder" value="<?php _e("Old scanning", 'nggallery'); ?> " /> <input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes", 'nggallery'); ?> " /> </div> </div> </div> </div> <!-- poststuff --> <?php } ?> <?php } ?> <div class="tablenav top ngg-tablenav"> <?php $ngg->manage_page->pagination('top', $_GET['paged'], $nggdb->paged['total_objects'], $nggdb->paged['objects_per_page']); ?> <div class="alignleft actions"> <select id="bulkaction" name="bulkaction"> <option value="no_action" ><?php _e("Actions", 'nggallery'); ?> </option> <option value="set_watermark" ><?php _e("Set watermark", 'nggallery'); ?> </option> <option value="new_thumbnail" ><?php _e("Create new thumbnails", 'nggallery'); ?> </option> <option value="resize_images" ><?php _e("Resize images", 'nggallery'); ?> </option> <option value="recover_images" ><?php _e("Recover from backup", 'nggallery'); ?> </option> <option value="delete_images" ><?php _e("Delete images", 'nggallery'); ?> </option> <option value="import_meta" ><?php _e("Import metadata", 'nggallery'); ?> </option> <option value="rotate_cw" ><?php _e("Rotate images clockwise", 'nggallery'); ?> </option> <option value="rotate_ccw" ><?php _e("Rotate images counter-clockwise", 'nggallery'); ?> </option> <option value="copy_to" ><?php _e("Copy to...", 'nggallery'); ?> </option> <option value="move_to"><?php _e("Move to...", 'nggallery'); ?> </option> <option value="add_tags" ><?php _e("Add tags", 'nggallery'); ?> </option> <option value="delete_tags" ><?php _e("Delete tags", 'nggallery'); ?> </option> <option value="overwrite_tags" ><?php _e("Overwrite tags", 'nggallery'); ?> </option> </select> <input class="button-secondary" type="submit" name="showThickbox" value="<?php _e('Apply', 'nggallery'); ?> " onclick="if ( !checkSelected() ) return false;" /> <?php if (!$is_search) { $disabled = ""; $title = ""; if ($ngg->options['galSort'] != "sortorder") { //Disable sort button and provide feedback why is disabled $disabled = "disabled"; $title = "title='" . __('To enable manual Sort set Custom Order Sort.See Settings->Gallery Settings->Sort Options', 'nggallery') . "'"; } $button = "<input class='button-secondary' type='submit' {$disabled} {$title} name='sortGallery' value='" . __('Sort gallery', 'nggallery') . "' />"; echo $button; } ?> <input type="submit" name="updatepictures" class="button-primary action" value="<?php _e('Save Changes', 'nggallery'); ?> " /> </div> </div> <table id="ngg-listimages" class="widefat fixed" cellspacing="0" > <thead> <tr> <?php $wp_list_table->print_column_headers(true); ?> </tr> </thead> <tfoot> <tr> <?php $wp_list_table->print_column_headers(false); ?> </tr> </tfoot> <tbody id="the-list"> <?php if ($picturelist) { $thumbsize = ''; if ($ngg->options['thumbfix']) { $thumbsize = 'width="' . $ngg->options['thumbwidth'] . '" height="' . $ngg->options['thumbheight'] . '"'; } foreach ($picturelist as $picture) { //for search result we need to check the capatibiliy if (!nggAdmin::can_manage_this_gallery($picture->author) && $is_search) { continue; } $counter++; $pid = (int) $picture->pid; $alternate = !isset($alternate) || $alternate == 'alternate' ? '' : 'alternate'; $exclude = $picture->exclude ? 'checked="checked"' : ''; $date = mysql2date(get_option('date_format'), $picture->imagedate); $rawdate = $picture->imagedate; $time = mysql2date(get_option('time_format'), $picture->imagedate); ?> <tr id="picture-<?php echo $pid; ?> " class="<?php echo $alternate; ?> iedit" valign="top"> <?php foreach ($image_columns as $image_column_key => $column_display_name) { $class = "class='{$image_column_key} column-{$image_column_key}'"; $style = ''; if (in_array($image_column_key, $hidden_columns)) { $style = ' style="display:none;"'; } $attributes = $class . $style; switch ($image_column_key) { case 'cb': $attributes = 'class="column-cb check-column"' . $style; ?> <th <?php echo $attributes; ?> scope="row"><input name="doaction[]" type="checkbox" value="<?php echo $pid; ?> " /></th> <?php break; case 'id': ?> <td <?php echo $attributes; ?> style=""><?php echo $pid; ?> <input type="hidden" name="pid[]" value="<?php echo $pid; ?> " /> </td> <?php break; case 'filename': $attributes = 'class="title column-filename column-title"' . $style; ?> <td <?php echo $attributes; ?> > <strong><a href="<?php echo esc_url($picture->imageURL); ?> " class="thickbox" title="<?php echo esc_attr($picture->filename); ?> "> <?php echo empty($picture->alttext) ? esc_html($picture->filename) : esc_html(stripslashes(nggGallery::i18n($picture->alttext))); ?> </a></strong> <br /><?php echo '<span class="date">' . $date . '</span>'; ?> <input type="text" class="datepicker" value="<?php echo $date; ?> "/><span class="change"> <?php _e('Change Date', 'nggallery'); ?> </span> <input type="hidden" class="rawdate" name="date[<?php echo $pid; ?> ]" value="<?php echo $rawdate; ?> " /> <?php if (!empty($picture->meta_data)) { ?> <br /><?php echo $picture->meta_data['width']; ?> x <?php echo $picture->meta_data['height']; ?> <?php _e('pixel', 'nggallery'); ?> <?php } ?> <p> <?php $actions = array(); $actions['view'] = '<a class="shutter" href="' . esc_url($picture->imageURL) . '" title="' . esc_attr(sprintf(__('View "%s"'), sanitize_title($picture->filename))) . '">' . __('View', 'nggallery') . '</a>'; $actions['meta'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/showmeta.php?id=' . $pid . '" title="' . __('Show Meta data', 'nggallery') . '">' . __('Meta', 'nggallery') . '</a>'; $actions['custom_thumb'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/edit-thumbnail.php?id=' . $pid . '" title="' . __('Customize thumbnail', 'nggallery') . '">' . __('Edit thumb', 'nggallery') . '</a>'; $actions['rotate'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/rotate.php?id=' . $pid . '" title="' . __('Rotate', 'nggallery') . '">' . __('Rotate', 'nggallery') . '</a>'; if (current_user_can('publish_posts')) { $actions['publish'] = '<a class="ngg-dialog" href="' . NGGALLERY_URLPATH . 'admin/publish.php?id=' . $pid . '&h=230" title="' . __('Publish this image', 'nggallery') . '">' . __('Publish', 'nggallery') . '</a>'; } if (file_exists($picture->imagePath . '_backup')) { $actions['recover'] = '<a class="confirmrecover" href="' . wp_nonce_url("admin.php?page=nggallery-manage-gallery&mode=recoverpic&gid=" . $act_gid . "&pid=" . $pid, 'ngg_recoverpicture') . '" title="' . __('Recover', 'nggallery') . '" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Recover "%s" ?', 'nggallery'), $picture->filename)) . '\');if(check==false) return false;">' . __('Recover', 'nggallery') . '</a>'; } $actions['delete'] = '<a class="submitdelete" href="' . wp_nonce_url("admin.php?page=nggallery-manage-gallery&mode=delpic&gid=" . $act_gid . "&pid=" . $pid, 'ngg_delpicture') . '" class="delete column-delete" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Delete "%s" ?', 'nggallery'), $picture->filename)) . '\');if(check==false) return false;">' . __('Delete') . '</a>'; $action_count = count($actions); $i = 0; echo '<div class="row-actions">'; foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; ?> </p> </td> <?php break; case 'thumbnail': $attributes = 'class="id column-thumbnail media-icon"' . $style; ?> <td <?php echo $attributes; ?> ><a href="<?php echo esc_url(add_query_arg('i', mt_rand(), $picture->imageURL)); ?> " class="shutter" title="<?php echo $picture->filename; ?> "> <img class="thumb" src="<?php echo esc_url(add_query_arg('i', mt_rand(), $picture->thumbURL)); ?> " id="thumb<?php echo $pid; ?> " /> </a> </td> <?php break; case 'alt_title_desc': $img_alt_text = nggGallery::suppress_injection($picture->alttext); $img_description = nggGallery::suppress_injection($picture->description); ?> <td <?php echo $attributes; ?> > <input placeholder="<?php _e("Alt & title text", 'nggallery'); ?> " name="alttext[<?php echo $pid; ?> ]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo $img_alt_text; ?> " /><br/> <textarea placeholder="<?php _e("Description", 'nggallery'); ?> " name="description[<?php echo $pid; ?> ]" style="width:95%; margin: 1px;" rows="2" ><?php echo $img_description; ?> </textarea> </td> <?php break; case 'exclude': ?> <td <?php echo $attributes; ?> ><input name="exclude[<?php echo $pid; ?> ]" type="checkbox" value="1" <?php echo $exclude; ?> /></td> <?php break; case 'tags': $picture->tags = wp_get_object_terms($pid, 'ngg_tag', 'fields=names'); if (is_array($picture->tags)) { $picture->tags = implode(', ', $picture->tags); } ?> <td <?php echo $attributes; ?> ><textarea placeholder="<?php _e("Separated by commas", 'nggallery'); ?> "name="tags[<?php echo $pid; ?> ]" style="width:95%;" rows="2"><?php echo $picture->tags; ?> </textarea></td> <?php break; default: ?> <td <?php echo $attributes; ?> ><?php do_action('ngg_manage_image_custom_column', $image_column_key, $pid); ?> </td> <?php break; } ?> <?php } ?> </tr> <?php } } // In the case you have no capaptibility to see the search result if ($counter == 0) { echo '<tr><td colspan="' . $num_columns . '" align="center"><strong>' . __('No entries found', 'nggallery') . '</strong></td></tr>'; } ?> </tbody> </table> <div class="tablenav bottom"> <input type="submit" class="button-primary action" name="updatepictures" value="<?php _e('Save Changes', 'nggallery'); ?> " /> <?php $ngg->manage_page->pagination('bottom', $_GET['paged'], $nggdb->paged['total_objects'], $nggdb->paged['objects_per_page']); ?> </div> </form> <br class="clear"/> </div><!-- /#wrap --> <!-- #entertags --> <div id="entertags" style="display: none;" > <form id="form-tags" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <input type="hidden" id="entertags_imagelist" name="TB_imagelist" value="" /> <input type="hidden" id="entertags_bulkaction" name="TB_bulkaction" value="" /> <input type="hidden" name="page" value="manage-images" /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr> <th><?php _e("Enter the tags", 'nggallery'); ?> : <input name="taglist" type="text" style="width:90%" value="" /></th> </tr> <tr align="right"> <td class="submit"> <input class="button-primary" type="submit" name="TB_EditTags" value="<?php _e("OK", 'nggallery'); ?> " /> <input class="button-secondary dialog-cancel" type="reset" value=" <?php _e("Cancel", 'nggallery'); ?> " /> </td> </tr> </table> </form> </div> <!-- /#entertags --> <!-- #selectgallery --> <div id="selectgallery" style="display: none;" > <form id="form-select-gallery" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <input type="hidden" id="selectgallery_imagelist" name="TB_imagelist" value="" /> <input type="hidden" id="selectgallery_bulkaction" name="TB_bulkaction" value="" /> <input type="hidden" name="page" value="manage-images" /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr> <th> <?php _e('Select the destination gallery:', 'nggallery'); ?> <select name="dest_gid" style="width:90%" > <?php foreach ($gallerylist as $gallery) { if ($gallery->gid != $act_gid) { ?> <option value="<?php echo $gallery->gid; ?> " ><?php echo $gallery->gid; ?> - <?php echo esc_attr(stripslashes($gallery->title)); ?> </option> <?php } } ?> </select> </th> </tr> <tr align="right"> <td class="submit"> <input type="submit" class="button-primary" name="TB_SelectGallery" value="<?php _e("OK", 'nggallery'); ?> " /> <input class="button-secondary dialog-cancel" type="reset" value="<?php _e("Cancel", 'nggallery'); ?> " /> </td> </tr> </table> </form> </div> <!-- /#selectgallery --> <!-- #resize_images --> <div id="resize_images" style="display: none;" > <form id="form-resize-images" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value="" /> <input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value="" /> <input type="hidden" name="page" value="manage-images" /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr valign="top"> <td> <strong><?php _e('Resize Images to', 'nggallery'); ?> :</strong> </td> <td> <label for="imgWidth"><?php _e('Width', 'nggallery'); ?> </label> <input type="number" step="1" min="0" class="small-text" name="imgWidth" id="imgWidth" class="small-text" value="<?php echo $ngg->options['imgWidth']; ?> " /> <label for="imgHeight"><?php _e('Height', 'nggallery'); ?> </label> <input type="number" step="1" min="0" type="text" size="5" name="imgHeight" id="imgHeight" class="small-text" value="<?php echo $ngg->options['imgHeight']; ?> "> <p class="description"><?php _e('Width and height (in pixels). NextCellent Gallery will keep the ratio size.', 'nggallery'); ?> </p> </td> </tr> <tr align="right"> <td colspan="2" class="submit"> <input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'nggallery'); ?> " /> <input class="button-secondary dialog-cancel" type="reset" value=" <?php _e('Cancel', 'nggallery'); ?> " /> </td> </tr> </table> </form> </div> <!-- /#resize_images --> <!-- #new_thumbnail --> <div id="new_thumbnail" style="display: none;" > <form id="form-new-thumbnail" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <input type="hidden" id="new_thumbnail_imagelist" name="TB_imagelist" value="" /> <input type="hidden" id="new_thumbnail_bulkaction" name="TB_bulkaction" value="" /> <input type="hidden" name="page" value="manage-images" /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr valign="top"> <th align="left"><?php _e('Size', 'nggallery'); ?> </th> <td><label for="thumbwidth"><?php _e('Width', 'nggallery'); ?> </label><input class="small-text" type="number" step="1" min="0" name="thumbwidth" id="thumbwidth" value="<?php echo $ngg->options['thumbwidth']; ?> " /> <label for="thumbheight"><?php _e('Height', 'nggallery'); ?> </label><input class="small-text" type="number" step="1" min="0" name="thumbheight" id="thumbheight" value="<?php echo $ngg->options['thumbheight']; ?> " /> <p class="description"><?php _e('These values are maximum values ', 'nggallery'); ?> </p></td> </tr> <tr valign="top"> <th align="left"><?php _e('Fixed size', 'nggallery'); ?> </th> <td><input type="checkbox" name="thumbfix" id="thumbfix" value="1" <?php checked('1', $ngg->options['thumbfix']); ?> /> <label for="thumbfix"><?php _e('This will ignore the aspect ratio, so no portrait thumbnails', 'nggallery'); ?> </label></td> </tr> <tr align="right"> <td colspan="2" class="submit"> <input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'nggallery'); ?> " /> <input class="button-secondary dialog-cancel" type="reset" value=" <?php _e('Cancel', 'nggallery'); ?> " /> </td> </tr> </table> </form> </div> <!-- /#new_thumbnail --> <script type="text/javascript"> /* <![CDATA[ */ jQuery(document).ready(function(){columns.init('nggallery-manage-images');}); /* ]]> */ </script> <?php }
function output() { global $wpdb, $nggdb; //TODO:Code MUST be optimized, how to flag a used gallery better ? $used_list = $this->get_used_galleries(); ?> <script type="text/javascript"> jQuery(document).ready( function() { jQuery('#selectContainer').sortable( { items: '.groupItem', placeholder: 'sort_placeholder', opacity: 0.7, tolerance: 'intersect', distance: 2, forcePlaceholderSize: true , connectWith: ['#galleryContainer'] } ); jQuery('#galleryContainer').sortable( { items: '.groupItem', placeholder: 'sort_placeholder', opacity: 0.7, tolerance: 'intersect', distance: 2, forcePlaceholderSize: true , connectWith: ['#selectContainer', '#albumContainer'] } ); jQuery('#albumContainer').sortable( { items: '.groupItem', placeholder: 'sort_placeholder', opacity: 0.7, tolerance: 'intersect', distance: 2, forcePlaceholderSize: true , connectWith: ['#galleryContainer'] } ); jQuery('a.min').bind('click', toggleContent); // Hide used galleries jQuery('a#toggle_used').click(function() { jQuery('#selectContainer div.inUse').toggle(); return false; } ); // Maximize All Portlets (whole site, no differentiation) jQuery('a#all_max').click(function() { jQuery('div.itemContent:hidden').show(); return false; } ); // Minimize All Portlets (whole site, no differentiation) jQuery('a#all_min').click(function() { jQuery('div.itemContent:visible').hide(); return false; } ); // Auto Minimize if more than 4 (whole site, no differentiation) if(jQuery('a.min').length > 4) { jQuery('a.min').html('[+]'); jQuery('div.itemContent:visible').hide(); jQuery('#selectContainer div.inUse').toggle(); }; } ); var toggleContent = function(e) { var targetContent = jQuery('div.itemContent', this.parentNode.parentNode); if (targetContent.css('display') == 'none') { targetContent.slideDown(300); jQuery(this).html('[-]'); } else { targetContent.slideUp(300); jQuery(this).html('[+]'); } return false; } function ngg_serialize(s) { //serial = jQuery.SortSerialize(s); serial = jQuery('#galleryContainer').sortable('serialize'); jQuery('input[name=sortorder]').val(serial); } function showDialog() { tb_show("", "#TB_inline?width=640&height=305&inlineId=editalbum&modal=true", false); } </script> <div class="wrap album" id="wrap" > <h2><?php _e('Manage Albums', 'nggallery'); ?> </h2> <form id="selectalbum" method="POST" onsubmit="ngg_serialize()" accept-charset="utf-8"> <?php wp_nonce_field('ngg_album'); ?> <input name="sortorder" type="hidden" /> <div class="albumnav tablenav"> <div class="alignleft actions"> <?php _e('Select album', 'nggallery'); ?> <select id="act_album" name="act_album" onchange="this.form.submit();"> <option value="0" ><?php _e('No album selected', 'nggallery'); ?> </option> <?php if (is_array($this->albums)) { foreach ($this->albums as $album) { $selected = $this->currentID == $album->id ? 'selected="selected" ' : ''; echo '<option value="' . $album->id . '" ' . $selected . '>' . $album->name . '</option>' . "\n"; } } ?> </select> <?php if ($this->currentID > 0) { ?> <input class="button-primary" type="submit" name="update" value="<?php _e('Update', 'nggallery'); ?> "/> <input class="button-secondary" type="submit" name="showThickbox" value="<?php _e('Edit album', 'nggallery'); ?> " onclick="showDialog(); return false;" /> <input class="button-secondary action "type="submit" name="delete" value="<?php _e('Delete', 'nggallery'); ?> " onclick="javascript:check=confirm('<?php _e('Delete album ?', 'nggallery'); ?> ');if(check==false) return false;"/> <?php } else { ?> <span><?php _e('Add new album', 'nggallery'); ?> </span> <input class="search-input" id="newalbum" name="newalbum" type="text" value="" /> <input class="button-secondary action" type="submit" name="add" value="<?php _e('Add', 'nggallery'); ?> "/> <?php } ?> </div> </div> </form> <br class="clear"/> <div> <div style="float:right;"> <a href="#" title="<?php _e('Show / hide used galleries', 'nggallery'); ?> " id="toggle_used"><?php _e('[Show all]', 'nggallery'); ?> </a> | <a href="#" title="<?php _e('Maximize the widget content', 'nggallery'); ?> " id="all_max"><?php _e('[Maximize]', 'nggallery'); ?> </a> | <a href="#" title="<?php _e('Minimize the widget content', 'nggallery'); ?> " id="all_min"><?php _e('[Minimize]', 'nggallery'); ?> </a> </div> <?php _e('After you create and select a album, you can drag and drop a gallery or another album into your new album below', 'nggallery'); ?> </div> <br class="clear" /> <div class="container"> <!-- /#album container --> <div class="widget widget-right"> <div class="widget-top"> <h3><?php _e('Select album', 'nggallery'); ?> </h3> </div> <div id="albumContainer" class="widget-holder"> <?php if (is_array($this->albums)) { foreach ($this->albums as $album) { $this->get_container('a' . $album->id); } } ?> </div> </div> <!-- /#select container --> <div class="widget widget-right"> <div class="widget-top"> <h3><?php _e('Select gallery', 'nggallery'); ?> </h3> </div> <div id="selectContainer" class="widget-holder"> <?php if (is_array($this->galleries)) { //get the array of galleries $sort_array = (array) $this->albums[$this->currentID]->galleries; foreach ($this->galleries as $gallery) { if (!in_array($gallery->gid, $sort_array)) { if (in_array($gallery->gid, $used_list)) { $this->get_container($gallery->gid, true); } else { $this->get_container($gallery->gid, false); } } } } ?> </div> </div> <!-- /#target-album --> <div class="widget target-album widget-liquid-left"> <?php if ($this->currentID > 0) { $album = $this->albums[$this->currentID]; ?> <div class="widget-top"> <h3><?php _e('Album ID', 'nggallery'); ?> <?php echo $album->id . ' : ' . $album->name; ?> </h3> </div> <div id="galleryContainer" class="widget-holder target"> <?php $sort_array = (array) $this->albums[$this->currentID]->galleries; foreach ($sort_array as $galleryid) { $this->get_container($galleryid, false); } } else { ?> <div class="widget-top"> <h3><?php _e('No album selected!', 'nggallery'); ?> </h3> </div> <div class="widget-holder target"> <?php } ?> </div> </div><!-- /#target-album --> </div><!-- /#container --> </div><!-- /#wrap --> <!-- #editalbum --> <div id="editalbum" style="display: none;" > <form id="form-edit-album" method="POST" accept-charset="utf-8"> <?php wp_nonce_field('ngg_thickbox_form'); ?> <input type="hidden" id="current_album" name="act_album" value="<?php echo $this->currentID; ?> " /> <table width="100%" border="0" cellspacing="3" cellpadding="3" > <tr> <th> <?php _e('Album name:', 'nggallery'); ?> <br /> <input class="search-input" id="album_name" name="album_name" type="text" value="<?php echo esc_attr($album->name); ?> " style="width:95%" /> </th> </tr> <tr> <th> <?php _e('Album description:', 'nggallery'); ?> <br /> <textarea class="search-input" id="album_desc" name="album_desc" cols="50" rows="2" style="width:95%" ><?php echo esc_attr($album->albumdesc); ?> </textarea> </th> </tr> <tr> <th> <?php _e('Select a preview image:', 'nggallery'); ?> <br /> <select name="previewpic" style="width:95%" > <option value="0"><?php _e('No picture', 'nggallery'); ?> </option> <?php $picturelist = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 GROUP BY tt.galleryid ORDER by tt.galleryid"); if (is_array($picturelist)) { foreach ($picturelist as $picture) { echo '<option value="' . $picture->pid . '"' . ($picture->pid == $album->previewpic ? ' selected="selected"' : '') . ' >' . $picture->pid . ' - ' . $picture->filename . '</option>' . "\n"; } } ?> </select> </th> </tr> <tr> <th> <?php _e('Page Link to', 'nggallery'); ?> <br /> <select name="pageid" style="width:95%"> <option value="0" ><?php _e('Not linked', 'nggallery'); ?> </option> <?php if (!isset($album->pageid)) { $album->pageid = 0; } parent_dropdown($album->pageid); ?> </select> </th> </tr> <tr align="right"> <td class="submit"> <input type="submit" class="button-primary" name="update_album" value="<?php _e("OK", 'nggallery'); ?> " /> <input class="button-secondary" type="reset" value="<?php _e("Cancel", 'nggallery'); ?> " onclick="tb_remove()"/> </td> </tr> </table> </form> </div> <!-- /#editalbum --> <?php }
/** * Print out option HTML elements for the page parents drop-down. * * @since 1.5.0 * @since 4.4.0 `$post` argument was added. * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $default Optional. The default page ID to be pre-selected. Default 0. * @param int $parent Optional. The parent page ID. Default 0. * @param int $level Optional. Page depth level. Default 0. * @param int|WP_Post $post Post ID or WP_Post object. * * @return null|false Boolean False if page has no children, otherwise print out html elements */ function parent_dropdown($default = 0, $parent = 0, $level = 0, $post = null) { global $wpdb; $post = get_post($post); $items = $wpdb->get_results($wpdb->prepare("SELECT ID, post_parent, post_title FROM {$wpdb->posts} WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent)); if ($items) { foreach ($items as $item) { // A page cannot be its own parent. if ($post && $post->ID && $item->ID == $post->ID) { continue; } $pad = str_repeat(' ', $level * 3); $selected = selected($default, $item->ID, false); echo "\n\t<option class='level-{$level}' value='{$item->ID}' {$selected}>{$pad} " . esc_html($item->post_title) . "</option>"; parent_dropdown($default, $item->ID, $level + 1); } } else { return false; } }
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e('Allow Comments') ?></label> <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label> </div> </fieldset> <fieldset id="passworddiv" class="dbx-box"> <h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3> <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div> </fieldset> <fieldset id="pageparent" class="dbx-box"> <h3 class="dbx-handle"><?php _e('Page Parent') ?></h3> <div class="dbx-content"><p><select name="parent_id"> <option value='0'><?php _e('Main Page (no parent)'); ?></option> <?php parent_dropdown($post->post_parent); ?> </select></p> </div> </fieldset> <?php if ( 0 != count( get_page_templates() ) ) { ?> <fieldset id="pageparent" class="dbx-box"> <h3 class="dbx-handle"><?php _e('Page Template:') ?></h3> <div class="dbx-content"><p><select name="page_template"> <option value='default'><?php _e('Default Template'); ?></option> <?php page_template_dropdown($post->page_template); ?> </select></p> </div> </fieldset> <?php } ?>
function parent_dropdown($default = 0, $parent = 0, $level = 0) { global $wpdb, $post_ID; $items = $wpdb->get_results("SELECT ID, post_parent, post_title FROM {$wpdb->posts} WHERE post_parent = {$parent} AND post_status = 'static' ORDER BY menu_order"); if ($items) { foreach ($items as $item) { // A page cannot be it's own parent. if (!empty($post_ID)) { if ($item->ID == $post_ID) { continue; } } $pad = str_repeat(' ', $level * 3); if ($item->ID == $default) { $current = ' selected="selected"'; } else { $current = ''; } echo "\n\t<option value='{$item->ID}'{$current}>{$pad} {$item->post_title}</option>"; parent_dropdown($default, $item->ID, $level + 1); } } else { return false; } }
<th scope="row"> <?php _e('Global Activity Page:', $this->ID); ?> </th> <td> <?php if ($this->allowAdmin('global_wall')) { ?> <select name="settings[global_wall]"> <option value="0">-- <?php _e('Disabled', $this->ID); ?> --</option> <?php parent_dropdown($settings['global_wall']); ?> </select><br /> <span class="setting-description"><?php _e('The page where to show a global activity wall. <strong>You have to create this page first.</strong>', $this->ID); ?> </span> <?php } ?> </td> </tr> <tr> <th scope="row"><?php _e('Global template:', $this->PID); ?>