예제 #1
0
/**
 * Manages artists - adds, deletes, edits.
 *
 * @author Alex Andrews <*****@*****.**>
 * @return void
 **/
function ribcage_manage_artists()
{
    global $artists;
    global $artist;
    $index = false;
    // If we aren't on an artist page then we are on the index page.
    if (isset($_REQUEST['artist'])) {
        $artist_id = (int) $_REQUEST['artist'];
    } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'add_artist') {
        $index = false;
    } else {
        $index = true;
    }
    register_column_headers('ribcage-manage-artist', array('cb' => '<input type="checkbox" />', 'artist' => 'Artist'));
    if (isset($_REQUEST['ribcage_action'])) {
        global $wpdb;
        // Refactor, this is a terrible place for this to do this.
        if ($_REQUEST['ribcage_action'] !== 'add') {
            check_admin_referer('manage_artists');
        } else {
            check_admin_referer('add_artist');
        }
        unset($_POST['_wpnonce']);
        unset($_POST['_wp_http_referer']);
        unset($_POST['Submit']);
        //split apart associative array into different parts to prepare for implodes
        $post_keys = array_keys($_POST);
        $post_vals = array_values($_POST);
        //construct field name list and vals to post
        $string_keys = implode($post_keys, ",");
        $string_vals = "'" . implode($post_vals, "','") . "'";
        $wpdb->show_errors();
        switch ($_REQUEST['ribcage_action']) {
            case 'edit':
                $sql = "UPDATE " . $wpdb->prefix . "ribcage_artists\n\t\t\t\t\t\tSET ";
                $i = 0;
                foreach ($post_keys as $field) {
                    $sql .= $field . "='" . $post_vals[$i] . "', ";
                    $i++;
                }
                $sql .= " artist_id = " . $artist_id . " \n\t\t\t\t\t\tWHERE artist_id = " . $artist_id;
                $results = $wpdb->query($sql);
                $wpdb->hide_errors();
                $artist = get_artist($artist_id);
                $message = 'updated';
                break;
            case 'add':
                $sql = "INSERT INTO " . $wpdb->prefix . "ribcage_artists\n\t\t\t\t\t\t({$string_keys})\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t({$string_vals})";
                $results = $wpdb->query($sql);
                $wpdb->hide_errors();
                $artist = get_artist_by_slug($_POST['artist_slug']);
                $message = 'added';
                break;
            case 'delete':
                $del_artist = get_artistname_by_id($_REQUEST['artist']);
                delete_artist($_REQUEST['artist']);
                $message = "{$del_artist} deleted";
                $index = 1;
                break;
        }
        echo '<div id="message" class="updated fade"><p><strong>Artist ' . $message . '.</strong></p></div>';
    }
    if (!$index) {
        if (isset($_REQUEST['artist'])) {
            $artist = get_artist($_REQUEST['artist']);
        }
        ?>
	<div class="wrap">
			<div id="icon-options-general" class="icon32"><br /></div>
		<?php 
        if ($_REQUEST['page'] == 'add_artist') {
            ?>
			<h2>Add Artist</h2>
			<form action="<?php 
            echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']);
            ?>
&ribcage_action=add" method="post" id="ribcage_edit_artist" name="edit_artist">
			<?php 
            wp_nonce_field('add_artist');
            ?>
		<?php 
        }
        ?>
		<?php 
        if (isset($_REQUEST['artist'])) {
            ?>
			<h2>Managing <?php 
            artist_name();
            ?>
</h2>
			<form action="<?php 
            echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']);
            ?>
&ribcage_action=edit" method="post" id="ribcage_edit_artist" name="edit_artist">
			<?php 
            wp_nonce_field('manage_artists');
            ?>
		<?php 
        }
        ?>
					<table class="form-table">             
						<tr valign="top">
							<th scope="row"><label for="artist_name">Name</label></th> 
							<td>
								<input type="text" value="<?php 
        artist_name();
        ?>
" name="artist_name" id="artist_name" class="regular-text"/>												
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Sort Name</th> 
							<td>
								<input type="text" value="<?php 
        artist_name_sort();
        ?>
" name="artist_name_sort" id="artist_name_sort" class="regular-text" />
								<span class="description">The name of the artist to be alphabetized. For example, 'Butterfly, The'.</span>
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Artist Slug</th> 
							<td>
								<input type="text" style="width:320px;" class="regular-text code" value="<?php 
        artist_slug();
        ?>
" name="artist_slug" id="artist_slug" /><span class="description">The URL you want for the artist - for example <a href="<?php 
        echo home_url();
        ?>
/artists/artist_slug</span>
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Signup Date</th> 
							<td>
								<input type="text" style="width:100px;" class="regular-text code" value="<?php 
        echo $artist['artist_signed'];
        ?>
" name="artist_signed" id="artist_signed" maxlength="50" /><span class="description">The date the artist signed for your label</span>
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Creative Commons license</th> 
							<td>
								<?php 
        echo ribcage_cc_dropdown($artist_license_val);
        ?>
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Artist's Music Brainz ID</th> 
							<td>
								<input type="text" style="width:320px;" class="regular-text code" value="<?php 
        artist_musicbrainz();
        ?>
" name="artist_mbid" id="artist_mbid" maxlength="50" />
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Website URL</th> 
							<td>
								<input type="text" style="width:320px;" class="regular-text code" value="<?php 
        artist_website_link();
        ?>
" name="artist_link_website" id="artist_link_website" maxlength="200" />
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">MySpace URL</th> 
							<td>
								<input type="text" style="width:320px;" class="regular-text code" value="<?php 
        artist_myspace_link();
        ?>
" name="artist_link_myspace" id="artist_link_myspace" maxlength="200" />
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Facebook URL</th> 
							<td>
								<input type="text" style="width:320px;" class="regular-text code" value="<?php 
        artist_facebook_link();
        ?>
" name="artist_link_facebook" id="artist_link_facebook" maxlength="200" />
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Artist Biography</th> 
							<td>
								<textarea rows="5" cols="50" name="artist_bio" id="artist_bio" class="regular-text"><?php 
        echo $artist['artist_bio'];
        ?>
</textarea>
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Short One Paragraph Description of Artist</th> 
							<td>
								<textarea rows="5" cols="50" name="artist_blurb_tiny" id="artist_blurb_tiny" class="regular-text"><?php 
        echo $artist['artist_blurb_tiny'];
        ?>
</textarea>
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Artist Picture 1</th> 
							<td>
								<input type="text" style="width:320px;" class="regular-text code" value="<?php 
        artist_picture_1();
        ?>
" name="artist_picture_1" id="artist_picture_1" maxlength="200" />
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Artist Picture 2</th> 
							<td>
								<input type="text" style="width:320px;" class="regular-text code" value="<?php 
        artist_picture_2();
        ?>
" name="artist_picture_2" id="artist_picture_2" maxlength="200" />
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Artist Picture 3</th> 
							<td>
								<input type="text" style="width:320px;" class="regular-text code" value="<?php 
        artist_picture_3();
        ?>
" name="artist_picture_3" id="artist_picture_3" maxlength="200" />
							</td> 
						</tr>
						<tr valign="top">
							<th scope="row">Artist Picture HQ Zipfile URL</th> 
							<td>
								<input type="text" style="width:320px;" class="regular-text code" value="<?php 
        echo $artist_picture_zip_val;
        ?>
" name="artist_picture_zip" id="artist_picture_zip" maxlength="200" />
							</td> 
						</tr>
					</table>
					<p class="submit">
						<input type="submit" name="Submit" class="button-primary" value="Save Changes" />
					</p>
			</form>
	</div>
<?php 
    } else {
        ?>
	<?php 
        $artists = list_artists_blurb();
        $alt = 0;
        ?>
	<div class="wrap">
		<div id="icon-plugins" class="icon32"><br /></div>
		<h2>Manage Artists</h2>
			<form action="<?php 
        echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']);
        ?>
" method="post" id="ribcage_manage_artists" name="manage_artists"> 
				<table class="widefat post fixed" cellspacing="0">
						<thead>
						<tr>
						<?php 
        print_column_headers('ribcage-manage-artist');
        ?>
			
						</tr>
						</thead>
						<tfoot>
						<tr>			
						<?php 
        print_column_headers('ribcage-manage-artist', FALSE);
        ?>
	
						</tr>
						</tfoot>            
						<tbody>
							<?php 
        while (have_artists()) {
            the_artist();
            ?>
							<?php 
            $manage_link = wp_nonce_url('?page=ribcage&artist=' . artist_id(false), 'manage_artists');
            $delete_link = wp_nonce_url('?page=ribcage&artist=' . artist_id(false) . '&ribcage_action=delete', 'manage_artists');
            ?>
							<?php 
            echo $alt % 2 ? '<tr valign="top" class="">' : '<tr valign="top" class="alternate">';
            ++$alt;
            ?>
		
							<th scope="row" class="check-column"><input type="checkbox" name="artistcheck[]" value="2" /></th>
							<td class="column-name">
								<strong><a class="row-title" href="?page=manage_artists&artist=<?php 
            artist_id();
            ?>
" title="<?php 
            artist_name();
            ?>
" ><?php 
            artist_name();
            ?>
</strong></a><br /><div class="row-actions"><span class='edit'><a href="<?php 
            echo $manage_link;
            ?>
">Edit</a> | </span><span class='delete'><a class='submitdelete' href='<?php 
            echo $delete_link;
            ?>
' onclick="if ( confirm('You are about to delete \'<?php 
            artist_name();
            ?>
\'\n  \'Cancel\' to stop, \'OK\' to delete.') ) { return true;}return false;">Delete</a></span></div></td>
							</tr>
							<?php 
        }
        ?>
						</tbody>
					</table>
			</form>
	</div>
	<?php 
    }
}
예제 #2
0
<?php 
    wp_nonce_field('bulk-bookmarks');
    ?>
<table class="widefat fixed" cellspacing="0">
	<thead>
	<tr>
<?php 
    print_column_headers('link-manager');
    ?>
	</tr>
	</thead>

	<tfoot>
	<tr>
<?php 
    print_column_headers('link-manager', false);
    ?>
	</tr>
	</tfoot>

	<tbody>
<?php 
    $alt = 0;
    foreach ($links as $link) {
        $link = sanitize_bookmark($link);
        $link->link_name = esc_attr($link->link_name);
        $link->link_category = wp_get_link_cats($link->link_id);
        $short_url = str_replace('http://', '', $link->link_url);
        $short_url = preg_replace('/^www\\./i', '', $short_url);
        if ('/' == substr($short_url, -1)) {
            $short_url = substr($short_url, 0, -1);
예제 #3
0
function wpsc_options_checkout()
{
    global $wpdb;
    $form_types = array("Text" => "text", "Email Address" => "email", "Street Address" => "address", "City" => "city", "Country" => "country", "Delivery Address" => "delivery_address", "Delivery City" => "delivery_city", "Delivery Country" => "delivery_country", "Text Area" => "textarea", "Heading" => "heading", "Select" => "select", "Radio Button" => "radio", "Checkbox" => "checkbox");
    $unique_names = get_option('wpsc_unique_names');
    if (empty($unique_names)) {
        $unique_names = array('billingfirstname', 'billinglastname', 'billingaddress', 'billingcity', 'billingcountry', 'billingemail', 'billingphone', 'billingpostcode', 'delivertoafriend', 'shippingfirstname', 'shippinglastname', 'shippingaddress', 'shippingcity', 'shippingstate', 'shippingcountry', 'shippingpostcode');
        update_option('wpsc_unique_names', $unique_names);
    }
    $unique_names = apply_filters('wpsc_unique_names', $unique_names);
    update_option('wpsc_checkout_form_fields', $form_types);
    if (get_option('wpsc_checkout_form_fields') == '') {
        update_option('wpsc_checkout_form_fields', $form_types);
    }
    do_action('wpsc_checkout_form_fields_page');
    $columns = array('drag' => 'Drag', 'name' => 'Name', 'type' => 'Type', 'unique_names' => 'Unique Names', 'mandatory' => 'Mandatory', 'trash' => 'Trash');
    register_column_headers('display-checkout-list', $columns);
    $form_types = get_option('wpsc_checkout_form_fields');
    ?>

<form name='cart_options' id='cart_options' method='post' action=''>
	<div class="wrap">
  		<h2><?php 
    echo __('Checkout Options', 'wpsc');
    ?>
</h2>  
		<?php 
    /* wpsc_setting_page_update_notification displays the wordpress styled notifications */
    wpsc_settings_page_update_notification();
    ?>

		<form method='post' action='' id='chekcout_options_tbl'>
		<div class='metabox-holder' style='width:95%;'>
			<div class='postbox'>
			<input type='hidden' name='checkout_submits' value='true' />
			<h3 class='hndle'>Misc Checkout Options</h3>
			<div class='inside'>
			<table>
			<tr>
				<td><?php 
    echo __('Users must register before checking out', 'wpsc');
    ?>
:</td>
				<td>
					<?php 
    $require_register = get_option('require_register');
    $require_register1 = "";
    $require_register2 = "";
    switch ($require_register) {
        case 0:
            $require_register2 = "checked ='checked'";
            break;
        case 1:
            $require_register1 = "checked ='checked'";
            break;
    }
    ?>
						<input type='radio' value='1' name='wpsc_options[require_register]' id='require_register1' <?php 
    echo $require_register1;
    ?>
 /> 					<label for='require_register1'><?php 
    echo __('Yes', 'wpsc');
    ?>
</label> &nbsp;
						<input type='radio' value='0' name='wpsc_options[require_register]' id='require_register2' <?php 
    echo $require_register2;
    ?>
 /> 					<label for='require_register2'><?php 
    echo __('No', 'wpsc');
    ?>
</label>
					</td>
					<td>
						<a title='<?php 
    echo __('If yes then you must also turn on the wordpress option "Any one can register"', 'wpsc');
    ?>
' class='flag_email' href='#' ><img src='<?php 
    echo WPSC_URL;
    ?>
/images/help.png' alt='' /> </a>
					</td>
     		</tr>
     				<tr>
			<?php 
    $lock_tax = get_option('lock_tax');
    switch ($lock_tax) {
        case 1:
            $lock_tax1 = "checked ='checked'";
            break;
        case 0:
            $lock_tax2 = "checked ='checked'";
            break;
    }
    ?>
			<td scope="row"><?php 
    echo __('Lock Tax to Billing Country', 'wpsc');
    ?>
:</td>
			<td>
				<input type='radio' value='1' name='wpsc_options[lock_tax]' id='lock_tax1' <?php 
    echo $lock_tax1;
    ?>
 /> 
				<label for='lock_tax1'><?php 
    echo __('Yes', 'wpsc');
    ?>
</label> &nbsp;
				<input type='radio' value='0' name='wpsc_options[lock_tax]' id='lock_tax2' <?php 
    echo $lock_tax2;
    ?>
 /> 
				<label for='lock_tax2'><?php 
    echo __('No', 'wpsc');
    ?>
</label>
			</td>
			</tr>
		<tr>
			<!-- Disregard Billing State for Tax Calculations -->
			<?php 
    $lock_tax_to_shipping = get_option('lock_tax_to_shipping');
    switch ($lock_tax_to_shipping) {
        case 1:
            $lock_tax_to_shipping1 = "checked ='checked'";
            break;
        case 0:
            $lock_tax_to_shipping2 = "checked ='checked'";
            break;
    }
    ?>
			<td scope="row"><?php 
    echo __(' Disregard Billing State for Tax Calculations', 'wpsc');
    ?>
:</td>
			<td>
				<input type='radio' value='1' name='wpsc_options[lock_tax_to_shipping]' id='lock_tax1' <?php 
    echo $lock_tax_to_shipping1;
    ?>
 /> 
				<label for='lock_tax_to_shipping1'><?php 
    echo __('Yes', 'wpsc');
    ?>
</label> &nbsp;
				<input type='radio' value='0' name='wpsc_options[lock_tax_to_shipping]' id='lock_tax2' <?php 
    echo $lock_tax_to_shipping2;
    ?>
 /> 
				<label for='lock_tax_to_shipping2'><?php 
    echo __('No', 'wpsc');
    ?>
</label>
			</td>


			
		</tr>
		<tr>
					<?php 
    $shippingBilling = get_option('shippingsameasbilling');
    switch ($shippingBilling) {
        case 1:
            $shippingBilling1 = "checked ='checked'";
            break;
        case 0:
            $shippingBilling2 = "checked ='checked'";
            break;
    }
    ?>
			<td scope="row"><?php 
    echo __('Enable Shipping Same as Billing Option: ', 'wpsc');
    ?>
:</td>
			<td>
			<input type='radio' value='1' name='wpsc_options[shippingsameasbilling]' id='shippingsameasbilling1' <?php 
    echo $shippingBilling1;
    ?>
 /> 
			<label for='shippingsameasbilling1'><?php 
    echo __('Yes', 'wpsc');
    ?>
</label> &nbsp;
			<input type='radio' value='0' name='wpsc_options[shippingsameasbilling]' id='shippingsameasbilling2' <?php 
    echo $shippingBilling2;
    ?>
 /> 
			<label for='shippingsameasbilling2'><?php 
    echo __('No', 'wpsc');
    ?>
</label>
			</td>
		</tr>
		
		<tr>
			<?php 
    $billing_unless_shipping_setting = get_option('use_billing_unless_is_shipping');
    switch ($billing_unless_shipping_setting) {
        case 1:
            $billing_unless_shipping['on'] = "checked ='checked'";
            break;
        case 0:
            $billing_unless_shipping['off'] = "checked ='checked'";
            break;
    }
    ?>
			<td scope="row"><?php 
    echo __('Use The Billing country for Shipping unless a shipping form is present: ', 'wpsc');
    ?>
:</td>
			<td>
			<input type='radio' value='1' name='wpsc_options[use_billing_unless_is_shipping]' id='use_billing_unless_is_shipping1' <?php 
    echo $billing_unless_shipping['on'];
    ?>
 /> 
			<label for='use_billing_unless_is_shipping1'><?php 
    echo __('Yes', 'wpsc');
    ?>
</label> &nbsp;
			<input type='radio' value='0' name='wpsc_options[use_billing_unless_is_shipping]' id='use_billing_unless_is_shipping2' <?php 
    echo $billing_unless_shipping['off'];
    ?>
 /> 
			<label for='use_billing_unless_is_shipping2'><?php 
    echo __('No', 'wpsc');
    ?>
</label>
			</td>
		</tr>
		
			</table>
		</div>
		</div>
		</div>
			<h3>Form Fields</h3>
  			<p><?php 
    echo __('Here you can customise the forms to be displayed in your checkout page. The checkout page is where you collect important user information that will show up in your purchase logs i.e. the buyers address, and name...', 'wpsc');
    ?>
</p>
  			
				<p>
					<label for='wpsc_form_set'>Select a Form Set:</label>
					<select id='wpsc_form_set' name='wpsc_form_set'>
					<?php 
    $checkout_sets = get_option('wpsc_checkout_form_sets');
    foreach ((array) $checkout_sets as $key => $value) {
        $selected_state = "";
        if ($_GET['checkout-set'] == $key) {
            $selected_state = "selected='selected'";
        }
        echo "<option {$selected_state} value='{$key}'>" . stripslashes($value) . "</option>";
    }
    ?>
					</select>
					<input type='submit' value='Filter' name='wpsc_checkout_set_filter' class='button-secondary' />
					<a href='#' class='add_new_form_set'><?php 
    _e("+ Add New Form Set", 'wpsc');
    ?>
</a>
				</p>
				
				<p class='add_new_form_set_forms'>
					<label><?php 
    _e("Add new Form Set", 'wpsc');
    ?>
: <input type="text" value="" name="new_form_set" /></label>
					<input type="submit" value="<?php 
    _e('Add');
    ?>
" class="button-secondary" id="formset-add-sumbit"/>
				</p>
				
				<?php 
    if (!isset($_GET['checkout-set'])) {
        $filter = 0;
        $form_sql = "SELECT * FROM `" . WPSC_TABLE_CHECKOUT_FORMS . "` WHERE `active` = '1' AND `checkout_set` IN ('" . $filter . "') ORDER BY `order`;";
    } else {
        $filter = $wpdb->escape($_GET['checkout-set']);
        $form_sql = "SELECT * FROM `" . WPSC_TABLE_CHECKOUT_FORMS . "` WHERE `active` = '1' AND `checkout_set` IN ('" . $filter . "') ORDER BY `order`;";
    }
    $email_form_field = $wpdb->get_row("SELECT `id` FROM `" . WPSC_TABLE_CHECKOUT_FORMS . "` WHERE `type` IN ('email') AND `active` = '1' ORDER BY `order` ASC LIMIT 1", ARRAY_A);
    $form_data = $wpdb->get_results($form_sql, ARRAY_A);
    $selected_checkout_set = $_GET['checkout-set'];
    echo "<input type='hidden' name='selected_form_set' value='" . $selected_checkout_set . "' />";
    ?>
			<table id="wpsc_checkout_list" class="widefat page fixed"  cellspacing="0">
			<thead>
				<tr>
					<?php 
    print_column_headers('display-checkout-list');
    ?>
				</tr>
			</thead>
		
			<tfoot>
				<tr>
					<?php 
    print_column_headers('display-checkout-list', false);
    ?>
				</tr>
			</tfoot>
		
			<tbody id='wpsc_checkout_list_body'>
			<?php 
    foreach ((array) $form_data as $form_field) {
        echo "<tr id='checkout_" . $form_field['id'] . "' class='checkout_form_field'>\n\r";
        echo '<td class="drag"><a href="" onclick="return false;" title="Click and Drag to Order Checkout Fields"><img src="' . WPSC_URL . '/images/roll-over-drag.jpg" alt="roll-over-drag" /></a></td>';
        echo "<td class='namecol'><input type='text' name='form_name[" . $form_field['id'] . "]' value='" . htmlentities(stripslashes($form_field['name']), ENT_QUOTES, "UTF-8") . "' /></td>";
        echo "      <td class='typecol'>";
        echo "<select class='wpsc_checkout_selectboxes' name='form_type[" . $form_field['id'] . "]'>";
        foreach ($form_types as $form_type_name => $form_type) {
            $selected = '';
            if ($form_type === $form_field['type']) {
                $selected = "selected='selected'";
            }
            // define('__('Textarea', 'wpsc')', 'Textarea');
            echo "<option value='" . $form_type . "' " . $selected . ">" . __($form_type_name, 'wpsc') . "</option>";
        }
        echo "</select>";
        if (in_array($form_field['type'], array('select', 'radio', 'checkbox'))) {
            echo "<a class='wpsc_edit_checkout_options' rel='form_options[" . $form_field['id'] . "]' href=''>more options</a>";
        }
        echo "</td>";
        $checked = "";
        echo "<td><select name='unique_names[" . $form_field['id'] . "]'>";
        echo "<option value='-1'>Select a Unique Name</option>";
        foreach ($unique_names as $unique_name) {
            $selected = "";
            if ($unique_name == $form_field['unique_name']) {
                $selected = "selected='selected'";
            }
            echo "<option " . $selected . " value='" . $unique_name . "'>" . $unique_name . "</option>";
        }
        echo "</select></td>";
        if ($form_field['mandatory']) {
            $checked = "checked='checked'";
        }
        echo "      <td class='mandatorycol'><input {$checked} type='checkbox' name='form_mandatory[" . $form_field['id'] . "]' value='1' /></td>";
        echo "      <td><a class='image_link' href='#' onclick='return remove_form_field(\"checkout_" . $form_field['id'] . "\"," . $form_field['id'] . ");'><img src='" . WPSC_URL . "/images/trash.gif' alt='" . __('Delete', 'wpsc') . "' title='" . __('Delete', 'wpsc') . "' /></a>";
        if ($email_form_field['id'] == $form_field['id']) {
            echo "<a title='" . __('This will be the Email address that the Purchase Reciept is sent to.', 'wpsc') . "' class='flag_email' href='#' ><img src='" . WPSC_URL . "/images/help.png' alt='' /> </a>";
        }
        echo "</td>";
        echo "\n\t\t\t    </tr>";
    }
    ?>

			</tbody>
			</table>
		 <?php 
    ?>
	<p>
        <input type='hidden' name='wpsc_admin_action' value='checkout_settings' />
        
				<?php 
    wp_nonce_field('update-options', 'wpsc-update-options');
    ?>
        <input class='button-primary' type='submit' name='submit' value='<?php 
    echo __('Save Changes', 'wpsc');
    ?>
' />
        <a href='#' onclick='return add_form_field();'><?php 
    echo __('Add New Form Field', 'wpsc');
    ?>
</a>
  </p>
  </form>
</div>
</form>
		   <?php 
}
예제 #4
0
파일: users.php 프로젝트: blowery/wordpress
            }
            ?>

<table class="widefat fixed" cellspacing="0">
<thead>
<tr class="thead">
<?php 
            print_column_headers('users');
            ?>
</tr>
</thead>

<tfoot>
<tr class="thead">
<?php 
            print_column_headers('users', false);
            ?>
</tr>
</tfoot>

<tbody id="users" class="list:user user-list">
<?php 
            $style = '';
            foreach ($wp_user_search->get_results() as $userid) {
                $user_object = new WP_User($userid);
                $roles = $user_object->roles;
                $role = array_shift($roles);
                $style = ' class="alternate"' == $style ? '' : ' class="alternate"';
                echo "\n\t" . user_row($user_object, $style, $role);
            }
            ?>
// don't load directly
if ( !defined('ABSPATH') )
	die('-1');

if ( have_posts() ) { ?>
<table class="widefat fixed" cellspacing="0">
	<thead>
	<tr>
<?php print_column_headers('upload'); ?>
	</tr>
	</thead>

	<tfoot>
	<tr>
<?php print_column_headers('upload', false); ?>
	</tr>
	</tfoot>

	<tbody id="the-list" class="list:post">
<?php
add_filter('the_title','esc_html');
$alt = '';
$posts_columns = get_column_headers('upload');
$hidden = get_hidden_columns('upload');

while ( have_posts() ) : the_post();

if ( $is_trash && $post->post_status != 'trash' )
	continue;
elseif ( !$is_trash && $post->post_status == 'trash' )
예제 #6
0
<div class="clear"></div>

<table class="widefat fixed" cellspacing="0">
	<thead>
	<tr>
<?php 
        print_column_headers('categories');
        ?>
	</tr>
	</thead>

	<tfoot>
	<tr>
<?php 
        print_column_headers('categories', false);
        ?>
	</tr>
	</tfoot>

	<tbody id="the-list" class="list:cat">
<?php 
        cat_rows(0, 0, 0, $pagenum, $cats_per_page);
        ?>
	</tbody>
</table>

<div class="tablenav">
<?php 
        if ($page_links) {
            echo "<div class='tablenav-pages'>{$page_links}</div>";
예제 #7
0
function qs_config_hook($request_uri)
{
    global $q_config;
    ?>
<h3><?php 
    _e('qTranslate Services Settings', 'qtranslate');
    ?>
<span id="qtranslate-show-services" style="display:none"> (<a name="qtranslate_service_settings" href="#qtranslate_service_settings" onclick="showServices();"><?php 
    _e('Show', 'qtranslate');
    ?>
</a>)</span></h3>
<table class="form-table" id="qtranslate-services">
	<tr>
		<th scope="row"><?php 
    _e('qTranslate Services', 'qtranslate');
    ?>
</th>
		<td>
			<?php 
    if (!function_exists('openssl_get_publickey')) {
        printf(__('<div id="message" class="error fade"><p>qTranslate Services could not load <a href="%s">OpenSSL</a>!</p></div>'), 'http://www.php.net/manual/book.openssl.php');
    }
    ?>
			<label for="qtranslate_services"><input type="checkbox" name="qtranslate_services" id="qtranslate_services" value="1"<?php 
    echo $q_config['qtranslate_services'] ? ' checked="checked"' : '';
    ?>
/> <?php 
    _e('Enable qTranslate Services', 'qtranslate');
    ?>
</label>
			<br/>
			<?php 
    _e('With qTranslate Services, you will be able to use professional human translation services with a few clicks. (Requires OpenSSL)', 'qtranslate');
    ?>
<br />
			<?php 
    _e('Save after enabling to see more Configuration options.', 'qtranslate');
    ?>
		</td>
	</tr>
<?php 
    if ($q_config['qtranslate_services']) {
        $service_settings = get_option('qs_service_settings');
        $services = qs_queryQS(QS_GET_SERVICES);
        $orders = get_option('qs_orders');
        ?>
	<tr valign="top">
		<th scope="row"><h4><?php 
        _e('Open Orders', 'qtranslate');
        ?>
</h4></th>
		<td>
<?php 
        if (is_array($orders) && sizeof($orders) > 0) {
            ?>
			<table class="widefat">
				<thead>
				<tr>
<?php 
            print_column_headers('order');
            ?>
				</tr>
				</thead>

				<tfoot>
				<tr>
<?php 
            print_column_headers('order', false);
            ?>
				</tr>
				</tfoot>
<?php 
            foreach ($orders as $order) {
                $post =& get_post($order['post_id']);
                if (!$post) {
                    continue;
                }
                $post->post_title = wp_specialchars(qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($post->post_title));
                ?>
				<tr>
					<td class="qs_no-bottom-border"><a href="post.php?action=edit&post=<?php 
                echo $order['post_id'];
                ?>
" title="<?php 
                printf(__('Edit %s', 'qtranslate'), $post->post_title);
                ?>
"><?php 
                echo $post->post_title;
                ?>
</a></td>
					<td class="qs_no-bottom-border"><a href="<?php 
                echo $services[$order['service_id']]['service_url'];
                ?>
" title="<?php 
                _e('Website', 'qtranslate');
                ?>
"><?php 
                echo $services[$order['service_id']]['service_name'];
                ?>
</a></td>
					<td class="qs_no-bottom-border"><?php 
                echo $q_config['language_name'][$order['source_language']];
                ?>
</td>
					<td class="qs_no-bottom-border"><?php 
                echo $q_config['language_name'][$order['target_language']];
                ?>
</td>
					<td class="qs_no-bottom-border"><a class="delete" href="<?php 
                echo add_query_arg('qs_delete', $order['order']['order_id'], $request_uri);
                ?>
#qtranslate_service_settings">Delete</a></td>
				</tr>
<?php 
                if (isset($order['status'])) {
                    ?>
				<tr class="qs_status">
					<td colspan="5">
						<?php 
                    printf(__('Current Status: %s', 'qtranslate'), $order['status']);
                    ?>
					</td>
				</tr>
<?php 
                }
            }
            ?>
			</table>
			<p><?php 
            printf(__('qTranslate Services will automatically check every hour whether the translations are finished and update your posts accordingly. You can always <a href="%s">check manually</a>.', 'qtranslate'), 'options-general.php?page=qtranslate&qs_cron=true#qtranslate_service_settings');
            ?>
</p>
			<p><?php 
            _e('Deleting an open order doesn\'t cancel it. You will have to logon to the service homepage and cancel it there.', 'qtranslate');
            ?>
</p>
<?php 
        } else {
            ?>
			<p><?php 
            _e('No open orders.', 'qtranslate');
            ?>
</p>
<?php 
        }
        ?>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row" colspan="2">
			<h4><?php 
        _e('Service Configuration', 'qtranslate');
        ?>
</h4>
			<p class="description"><?php 
        _e('Below, you will find configuration settings for qTranslate Service Providers, which are required for them to operate.', 'qtranslate');
        ?>
</p>
		</th>
	</tr>
<?php 
        foreach ($services as $service) {
            if (sizeof($service['service_required_fields']) > 0) {
                ?>
	<tr valign="top">
		<th scope="row" colspan="2">
			<h5><?php 
                _e($service['service_name']);
                ?>
 ( <a name="qs_service_<?php 
                echo $service['service_id'];
                ?>
" href="<?php 
                echo $service['service_url'];
                ?>
"><?php 
                _e('Website', 'qtranslate');
                ?>
</a> )</h5>
			<p class="description"><?php 
                _e($service['service_description']);
                ?>
</p>
		</th>
	</tr>
<?php 
                foreach ($service['service_required_fields'] as $field) {
                    ?>
	<tr valign="top">
		<th scope="row"><?php 
                    echo $field['title'];
                    ?>
</th>
		<td>
			<input type="<?php 
                    echo $field['name'] == 'password' ? 'password' : 'text';
                    ?>
" name="<?php 
                    echo 'qs_' . $service['service_id'] . "_" . $field['name'];
                    ?>
" value="<?php 
                    echo isset($service_settings[$service['service_id']][$field['name']]) && $field['name'] != 'password' ? $service_settings[$service['service_id']][$field['name']] : '';
                    ?>
" style="width:100%"/>
		</td>
	</tr>
<?php 
                }
            }
        }
    }
    ?>
</table>
<script type="text/javascript">
// <![CDATA[
	function showServices() {
		document.getElementById('qtranslate-services').style.display='block';
		document.getElementById('qtranslate-show-services').style.display='none';
		return false;
	}
	
	if(location.hash!='#qtranslate_service_settings') {
	document.getElementById('qtranslate-show-services').style.display='inline';
	document.getElementById('qtranslate-services').style.display='none';
	}
// ]]>
</script>
<?php 
}
예제 #8
0
	</div>

	<div class="tablenav">
		<div class="alignleft actions">
			<a href="<?php echo esc_url(add_query_arg(array_merge(stripslashes_deep($_GET),array('page'=>$this->Admin->pagename('categories'),'a'=>null)),admin_url('admin.php'))); ?>" class="button add-new">&larr; <?php printf(__('Return to %s','Ecart'),$Category->name); ?></a>
		</div>
		<div class="clear"></div>
	</div>
	<div class="clear"></div>

	<table id="arrange-products" class="widefat" cellspacing="0">
		<thead>
		<tr><?php print_column_headers('ecart_page_ecart-categories'); ?></tr>
		</thead>
		<tfoot>
		<tr><?php print_column_headers('ecart_page_ecart-categories',false); ?></tr>
		</tfoot>
	<?php if (sizeof($products) > 0): ?>
		<tbody id="categories-table" class="list categories">
		<?php
		$hidden = array();
		$hidden = get_hidden_columns('ecart_page_ecart-categories');

		$even = false;
		foreach ($products as $Product):

		$editurl = esc_url(esc_attr(add_query_arg(array_merge(stripslashes_deep($_GET),
			array('page'=>$this->Admin->pagename('products'),
					'id'=>$Product->id)),
					admin_url('admin.php'))));
if ($comments) {
    ?>

<table class="widefat comments fixed" cellspacing="0">
<thead>
	<tr>
<?php 
    print_column_headers('edit-comments');
    ?>
	</tr>
</thead>

<tfoot>
	<tr>
<?php 
    print_column_headers('edit-comments', false);
    ?>
	</tr>
</tfoot>

<tbody id="the-comment-list" class="list:comment">
<?php 
    foreach ($comments as $comment) {
        _wp_comment_row($comment->comment_ID, $mode, $comment_status);
    }
    ?>
</tbody>
<tbody id="the-extra-comment-list" class="list:comment" style="display: none;">
<?php 
    foreach ($extra_comments as $comment) {
        _wp_comment_row($comment->comment_ID, $mode, $comment_status);
예제 #10
0
</a>
		</div>
		<div class="clear"></div>
	</div>
	<div class="clear"></div>

	<table id="arrange-categories" class="widefat" cellspacing="0">
		<thead>
		<tr><?php 
print_column_headers('shopp_page_shopp-categories');
?>
</tr>
		</thead>
		<tfoot>
		<tr><?php 
print_column_headers('shopp_page_shopp-categories', false);
?>
</tr>
		</tfoot>
	<?php 
if (sizeof($Categories) > 0) {
    ?>
		<tbody id="categories-table" class="list categories">
		<?php 
    $hidden = array();
    $hidden = get_hidden_columns('shopp_page_shopp-categories');
    $even = false;
    foreach ($Categories as $Category) {
        $editurl = esc_url(esc_attr(add_query_arg(array_merge(stripslashes_deep($_GET), array('page' => $this->Admin->pagename('categories'), 'id' => $Category->id)), admin_url('admin.php'))));
        $CategoryName = empty($Category->name) ? '(' . __('no category name', 'Shopp') . ')' : $Category->name;
        $membership = explode('/', $Category->uri);
예제 #11
0
    function orders_page()
    {
        //load single order view if id is set
        if (isset($_GET['order_id'])) {
            $this->single_order_page();
            return;
        }
        //force post type
        global $wpdb, $post_type, $wp_query, $wp_locale, $current_screen;
        $post_type = 'mp_order';
        $_GET['post_type'] = $post_type;
        $post_type_object = get_post_type_object($post_type);
        if (!current_user_can($post_type_object->cap->edit_posts)) {
            wp_die(__('Cheatin&#8217; uh?'));
        }
        $pagenum = isset($_GET['paged']) ? absint($_GET['paged']) : 0;
        if (empty($pagenum)) {
            $pagenum = 1;
        }
        $per_page = 'edit_' . $post_type . '_per_page';
        $per_page = (int) get_user_option($per_page);
        if (empty($per_page) || $per_page < 1) {
            $per_page = 15;
        }
        // @todo filter based on type
        $per_page = apply_filters('edit_posts_per_page', $per_page);
        // Handle bulk actions
        if (isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['bulk_edit']) || isset($_GET['action'])) {
            check_admin_referer('update-order-status');
            $sendback = remove_query_arg(array('received', 'paid', 'shipped', 'closed', 'ids'), wp_get_referer());
            if (($_GET['action'] != -1 || $_GET['action2'] != -1) && (isset($_GET['post']) || isset($_GET['ids']))) {
                $post_ids = isset($_GET['post']) ? array_map('intval', (array) $_GET['post']) : explode(',', $_GET['ids']);
                $doaction = $_GET['action'] != -1 ? $_GET['action'] : $_GET['action2'];
            }
            switch ($doaction) {
                case 'received':
                    $received = 0;
                    foreach ((array) $post_ids as $post_id) {
                        $this->update_order_status($post_id, 'received');
                        $received++;
                    }
                    $msg = sprintf(_n('%s order marked as Received.', '%s orders marked as Received.', $received, 'mp'), number_format_i18n($received));
                    break;
                case 'paid':
                    $paid = 0;
                    foreach ((array) $post_ids as $post_id) {
                        $this->update_order_status($post_id, 'paid');
                        $paid++;
                    }
                    $msg = sprintf(_n('%s order marked as Paid.', '%s orders marked as Paid.', $paid, 'mp'), number_format_i18n($paid));
                    break;
                case 'shipped':
                    $shipped = 0;
                    foreach ((array) $post_ids as $post_id) {
                        $this->update_order_status($post_id, 'shipped');
                        $shipped++;
                    }
                    $msg = sprintf(_n('%s order marked as Shipped.', '%s orders marked as Shipped.', $shipped, 'mp'), number_format_i18n($shipped));
                    break;
                case 'closed':
                    $closed = 0;
                    foreach ((array) $post_ids as $post_id) {
                        $this->update_order_status($post_id, 'closed');
                        $closed++;
                    }
                    $msg = sprintf(_n('%s order Closed.', '%s orders Closed.', $closed, 'mp'), number_format_i18n($closed));
                    break;
            }
        }
        $avail_post_stati = wp_edit_posts_query();
        $num_pages = $wp_query->max_num_pages;
        $mode = 'list';
        ?>

    <div class="wrap">
    <div class="icon32"><img src="<?php 
        echo $this->plugin_url . 'images/shopping-cart.png';
        ?>
" /></div>
    <h2><?php 
        _e('Manage Orders', 'mp');
        if (isset($_GET['s']) && $_GET['s']) {
            printf('<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query());
        }
        ?>
    </h2>

    <?php 
        if (isset($msg)) {
            ?>
    <div class="updated fade"><p>
    <?php 
            echo $msg;
            ?>
    </p></div>
    <?php 
        }
        ?>

    <form id="posts-filter" action="<?php 
        echo admin_url('edit.php');
        ?>
" method="get">

    <ul class="subsubsub">
    <?php 
        if (empty($locked_post_status)) {
            $status_links = array();
            $num_posts = wp_count_posts($post_type, 'readable');
            $class = '';
            $allposts = '';
            $total_posts = array_sum((array) $num_posts);
            // Subtract post types that are not included in the admin all list.
            foreach (get_post_stati(array('show_in_admin_all_list' => false)) as $state) {
                $total_posts -= $num_posts->{$state};
            }
            $class = empty($class) && empty($_GET['post_status']) ? ' class="current"' : '';
            $status_links[] = "<li><a href='edit.php?page=marketpress-orders&post_type=product{$allposts}'{$class}>" . sprintf(_nx('All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts'), number_format_i18n($total_posts)) . '</a>';
            foreach (get_post_stati(array(), 'objects') as $status) {
                $class = '';
                $status_name = $status->name;
                if (!in_array($status_name, $avail_post_stati)) {
                    continue;
                }
                if (empty($num_posts->{$status_name})) {
                    continue;
                }
                if (isset($_GET['post_status']) && $status_name == $_GET['post_status']) {
                    $class = ' class="current"';
                }
                $status_links[] = "<li><a href='edit.php?page=marketpress-orders&amp;post_status={$status_name}&amp;post_type=product'{$class}>" . sprintf(_n($status->label_count[0], $status->label_count[1], $num_posts->{$status_name}), number_format_i18n($num_posts->{$status_name})) . '</a>';
            }
            echo implode(" |</li>\n", $status_links) . '</li>';
            unset($status_links);
        }
        ?>
    </ul>

      <p class="search-box">
      	<label class="screen-reader-text" for="post-search-input"><?php 
        _e('Search Orders', 'mp');
        ?>
:</label>
      	<input type="text" id="post-search-input" name="s" value="<?php 
        the_search_query();
        ?>
" />
      	<input type="submit" value="<?php 
        _e('Search Orders', 'mp');
        ?>
" class="button" />
      </p>

      <input type="hidden" name="post_type" class="post_status_page" value="product" />
      <input type="hidden" name="page" class="post_status_page" value="marketpress-orders" />
      <?php 
        if (!empty($_GET['post_status'])) {
            ?>
      <input type="hidden" name="post_status" class="post_status_page" value="<?php 
            echo esc_attr($_GET['post_status']);
            ?>
" />
      <?php 
        }
        ?>

      <?php 
        if (have_posts()) {
            ?>

      <div class="tablenav">
      <?php 
            $page_links = paginate_links(array('base' => add_query_arg('paged', '%#%'), 'format' => '', 'prev_text' => __('&laquo;'), 'next_text' => __('&raquo;'), 'total' => $num_pages, 'current' => $pagenum));
            ?>

      <div class="alignleft actions">
      <select name="action">
      <option value="-1" selected="selected"><?php 
            _e('Change Status', 'mp');
            ?>
</option>
      <option value="received"><?php 
            _e('Received', 'mp');
            ?>
</option>
      <option value="paid"><?php 
            _e('Paid', 'mp');
            ?>
</option>
      <option value="shipped"><?php 
            _e('Shipped', 'mp');
            ?>
</option>
      <option value="closed"><?php 
            _e('Closed', 'mp');
            ?>
</option>
      </select>
      <input type="submit" value="<?php 
            esc_attr_e('Apply');
            ?>
" name="doaction" id="doaction" class="button-secondary action" />
      <?php 
            wp_nonce_field('update-order-status');
            ?>

      <?php 
            // view filters
            if (!is_singular()) {
                $arc_query = $wpdb->prepare("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM {$wpdb->posts} WHERE post_type = %s ORDER BY post_date DESC", $post_type);
                $arc_result = $wpdb->get_results($arc_query);
                $month_count = count($arc_result);
                if ($month_count && !(1 == $month_count && 0 == $arc_result[0]->mmonth)) {
                    $m = isset($_GET['m']) ? (int) $_GET['m'] : 0;
                    ?>
      <select name='m'>
      <option<?php 
                    selected($m, 0);
                    ?>
 value='0'><?php 
                    _e('Show all dates');
                    ?>
</option>
      <?php 
                    foreach ($arc_result as $arc_row) {
                        if ($arc_row->yyear == 0) {
                            continue;
                        }
                        $arc_row->mmonth = zeroise($arc_row->mmonth, 2);
                        if ($arc_row->yyear . $arc_row->mmonth == $m) {
                            $default = ' selected="selected"';
                        } else {
                            $default = '';
                        }
                        echo "<option{$default} value='" . esc_attr("{$arc_row->yyear}{$arc_row->mmonth}") . "'>";
                        echo $wp_locale->get_month($arc_row->mmonth) . " {$arc_row->yyear}";
                        echo "</option>\n";
                    }
                    ?>
      </select>
      <?php 
                }
                ?>

      <input type="submit" id="post-query-submit" value="<?php 
                esc_attr_e('Filter');
                ?>
" class="button-secondary" />
      <?php 
            }
            ?>
      </div>

      <?php 
            if ($page_links) {
                ?>
      <div class="tablenav-pages"><?php 
                $count_posts = $post_type_object->hierarchical ? $wp_query->post_count : $wp_query->found_posts;
                $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s&#8211;%s of %s') . '</span>%s', number_format_i18n(($pagenum - 1) * $per_page + 1), number_format_i18n(min($pagenum * $per_page, $count_posts)), number_format_i18n($count_posts), $page_links);
                echo $page_links_text;
                ?>
</div>
      <?php 
            }
            ?>

      <div class="clear"></div>
      </div>

      <div class="clear"></div>

      <table class="widefat <?php 
            echo $post_type_object->hierarchical ? 'page' : 'post';
            ?>
 fixed" cellspacing="0">
      	<thead>
      	<tr>
      <?php 
            print_column_headers($current_screen);
            ?>
      	</tr>
      	</thead>

      	<tfoot>
      	<tr>
      <?php 
            print_column_headers($current_screen, false);
            ?>
      	</tr>
      	</tfoot>

      	<tbody>
      <?php 
            if (function_exists('post_rows')) {
                post_rows();
            } else {
                $wp_list_table = _get_list_table('WP_Posts_List_Table');
                $wp_list_table->display_rows();
            }
            ?>
      	</tbody>
      </table>

      <div class="tablenav">

      <?php 
            if ($page_links) {
                echo "<div class='tablenav-pages'>{$page_links_text}</div>";
            }
            ?>

      <div class="alignleft actions">
      <select name="action2">
      <option value="-1" selected="selected"><?php 
            _e('Change Status', 'mp');
            ?>
</option>
      <option value="received"><?php 
            _e('Received', 'mp');
            ?>
</option>
      <option value="paid"><?php 
            _e('Paid', 'mp');
            ?>
</option>
      <option value="shipped"><?php 
            _e('Shipped', 'mp');
            ?>
</option>
      <option value="closed"><?php 
            _e('Closed', 'mp');
            ?>
</option>
      </select>
      <input type="submit" value="<?php 
            esc_attr_e('Apply');
            ?>
" name="doaction2" id="doaction2" class="button-secondary action" />
      <br class="clear" />
      </div>
      <br class="clear" />
      </div>

      <?php 
        } else {
            // have_posts()
            ?>
      <div class="clear"></div>
      <p><?php 
            _e('No Orders Yet', 'mp');
            ?>
</p>
      <?php 
        }
        ?>

      </form>

			<div class="icon32"><img src="<?php 
        echo $this->plugin_url . 'images/download.png';
        ?>
" /></div>
			<h2><?php 
        _e('Export Orders', 'mp');
        ?>
</h2>
			<form action="<?php 
        echo admin_url('admin-ajax.php?action=mp-orders-export');
        ?>
" method="post">
				<?php 
        $months = $wpdb->get_results($wpdb->prepare("\r\n\t\t\t\tSELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month\r\n\t\t\t\tFROM {$wpdb->posts}\r\n\t\t\t\tWHERE post_type = %s\r\n\t\t\t\tORDER BY post_date DESC\r\n\t\t\t", 'mp_order'));
        $month_count = count($months);
        if (!$month_count || 1 == $month_count && 0 == $months[0]->month) {
            return;
        }
        $m = isset($_GET['m']) ? (int) $_GET['m'] : 0;
        ?>
			<select name='m'>
				<option<?php 
        selected($m, 0);
        ?>
 value='0'><?php 
        _e('Show all dates');
        ?>
</option>
	<?php 
        foreach ($months as $arc_row) {
            if (0 == $arc_row->year) {
                continue;
            }
            $month = zeroise($arc_row->month, 2);
            $year = $arc_row->year;
            printf("<option %s value='%s'>%s</option>\n", selected($m, $year . $month, false), esc_attr($arc_row->year . $month), $wp_locale->get_month($month) . " {$year}");
        }
        $status = isset($_GET['post_status']) ? $_GET['post_status'] : 'all';
        ?>
			</select>
			<select name="order_status">
      <option<?php 
        selected($status, 'all');
        ?>
 value="all" selected="selected"><?php 
        _e('All Statuses', 'mp');
        ?>
</option>
      <option<?php 
        selected($status, 'order_received');
        ?>
 value="order_received"><?php 
        _e('Received', 'mp');
        ?>
</option>
      <option<?php 
        selected($status, 'order_paid');
        ?>
 value="order_paid"><?php 
        _e('Paid', 'mp');
        ?>
</option>
      <option<?php 
        selected($status, 'order_shipped');
        ?>
 value="order_shipped"><?php 
        _e('Shipped', 'mp');
        ?>
</option>
      <option<?php 
        selected($status, 'order_closed');
        ?>
 value="order_closed"><?php 
        _e('Closed', 'mp');
        ?>
</option>
      </select>
			<input type="submit" value="<?php 
        _e('Download &raquo;', 'mp');
        ?>
" name="export_orders" class="button-secondary" />
			</form>


      <br class="clear">
    </div>
    <?php 
    }
예제 #12
0
function wpsc_purchaselogs_displaylist()
{
    global $purchlogs;
    ?>
   <form method='post' action=''>
     <div class='wpsc_purchaselogs_options'>
      <select id='purchlog_multiple_status_change' name='purchlog_multiple_status_change' class='purchlog_multiple_status_change'>
         <option selected='selected' value='-1'><?php 
    _e('Bulk Actions', 'wpsc');
    ?>
</option>
         <?php 
    while (wpsc_have_purch_items_statuses()) {
        wpsc_the_purch_status();
        ?>
            <option value='<?php 
        echo wpsc_the_purch_status_id();
        ?>
' >
               <?php 
        echo wpsc_the_purch_status_name();
        ?>
            </option>
         <?php 
    }
    ?>
         <option value="delete"><?php 
    _e('Delete', 'wpsc');
    ?>
</option>
      </select>
      <input type='hidden' value='purchlog_bulk_modify' name='wpsc_admin_action2' />
      <input type="submit" value="<?php 
    _e('Apply', 'wpsc');
    ?>
" name="doaction" id="doaction" class="button-secondary action" />
      <?php 
    /* View functions for purchlogs */
    ?>
      <label for='view_purchlogs_by'><?php 
    _e('View:');
    ?>
</label>

      <select id='view_purchlogs_by' name='view_purchlogs_by'>
<?php 
    $date_is_selected['3mnths'] = '';
    $date_is_selected['all'] = '';
    if (!isset($_GET['view_purchlogs_by'])) {
        $_GET['view_purchlogs_by'] = '';
    }
    switch ($_GET['view_purchlogs_by']) {
        case 'all':
            $date_is_selected['all'] = 'selected="selected"';
            break;
        default:
        case '3mnths':
        case '':
            $date_is_selected['3mnths'] = 'selected="selected"';
            break;
    }
    ?>
         <option value='all' <?php 
    echo $date_is_selected['all'];
    ?>
><?php 
    echo _x('All', 'all sales', 'wpsc');
    ?>
</option>
            <option value='3mnths' <?php 
    echo $date_is_selected['3mnths'];
    ?>
><?php 
    _e('Three Months', 'wpsc');
    ?>
</option>
         <?php 
    echo wpsc_purchlogs_getfirstdates();
    ?>
      </select>
      <select id='view_purchlogs_by_status' name='view_purchlogs_by_status'>

         <?php 
    while (wpsc_have_purch_items_statuses()) {
        wpsc_the_purch_status();
        ?>

         <?php 
        $current_status = wpsc_the_purch_status_id();
        $is_selected = '';
        if (isset($_GET['view_purchlogs_by_status']) && $_GET['view_purchlogs_by_status'] == $current_status) {
            $is_selected = 'selected="selected"';
        }
        ?>
            <option value='<?php 
        echo $current_status;
        ?>
' <?php 
        echo $is_selected;
        ?>
 >
               <?php 
        echo wpsc_the_purch_status_name();
        ?>
            </option>
         <?php 
    }
    ?>
         <?php 
    if (empty($is_selected)) {
        $is_selected = 'selected="selected"';
    } else {
        $is_selected = '';
    }
    ?>
         <option <?php 
    echo $is_selected;
    ?>
 value='-1'><?php 
    _e('Status: All', 'wpsc');
    ?>
</option>
      </select>
      <input type='hidden' value='purchlog_filter_by' name='wpsc_admin_action' />
      <input type="submit" value="<?php 
    _e('Filter', 'wpsc');
    ?>
" name="doaction2" id="doaction2" class="button-secondary action" />
   </div>
      <?php 
    if (isset($_POST['purchlogs_searchbox']) && wpsc_have_purch_items() == false) {
        ?>
   <div class="updated settings-error"><p><?php 
        _e('There are no purchase logs for your selection, please try again.', 'wpsc');
        ?>
</p></div>
      <?php 
    }
    ?>
      <table class="widefat page fixed" cellspacing="0">
         <thead>
            <tr>
         <?php 
    print_column_headers('display-sales-list');
    ?>
            </tr>
         </thead>
         <tfoot>
            <tr>
         <?php 
    print_column_headers('display-sales-list', false);
    ?>
            </tr>
         </tfoot>
         <tbody>
         <?php 
    get_purchaselogs_content();
    ?>
         </tbody>
      </table>
      <p><strong><?php 
    _e('Total:', 'wpsc');
    ?>
</strong> <?php 
    echo wpsc_currency_display(wpsc_the_purch_total());
    ?>
</p>
<?php 
    if (!isset($purchlogs->current_start_timestamp) && !isset($purchlogs->current_end_timestamp)) {
        $purchlogs->current_start_timestamp = $purchlogs->earliest_timestamp;
        $purchlogs->current_end_timestamp = $purchlogs->current_timestamp;
    }
    $arr_params = array('wpsc_admin_action' => 'wpsc_downloadcsv', 'rss_key' => 'key', 'start_timestamp' => $purchlogs->current_start_timestamp, 'end_timestamp' => $purchlogs->current_end_timestamp);
    $piggy_url = 'http://www.bravenewcode.com/store/plugins/piggy/?utm_source=affiliate-6331&utm_medium=affiliates&utm_campaign=wpec#1';
    ?>
      <br />
      <p><a class='admin_download' href='<?php 
    echo htmlentities(add_query_arg($arr_params), ENT_QUOTES, 'UTF-8');
    ?>
' ><img class='wpsc_pushdown_img' src='<?php 
    echo WPSC_CORE_IMAGES_URL;
    ?>
/download.gif' alt='' title='' /> <span> <?php 
    _e('Download CSV', 'wpsc');
    ?>
</span></a>
       <a target="_blank" class='admin_download' href='<?php 
    echo htmlentities($piggy_url, ENT_QUOTES, 'UTF-8');
    ?>
'><img class='wpsc_pushdown_img' src='<?php 
    echo WPSC_CORE_IMAGES_URL;
    ?>
/mobile.png' alt='' title='' /> <span> <?php 
    _e('Mobile Sales App', 'wpsc');
    ?>
</span></a></p>
   </form>
   <br />
   <script type="text/javascript">
   /* <![CDATA[ */
   (function($){
      $(document).ready(function(){
         $('#doaction, #doaction2').click(function(){
            if ( $('select[name^="purchlog_multiple_status_change"]').val() == 'delete' ) {
               var m = '<?php 
    echo esc_js(__("You are about to delete the selected purchase logs.\n  'Cancel' to stop, 'OK' to delete.", "wpsc"));
    ?>
';
               return showNotice.warn(m);
            }
         });
      });
   })(jQuery);
   //columns.init('edit');
   /* ]]> */
   </script>

<?php 
    unset($_SESSION['newlogs']);
}
예제 #13
0
function powerpress_admin_mt()
{
    $results = powerpress_get_mt_episodes();
    $Settings = powerpress_get_settings('powerpress_general', false);
    if (!isset($Settings['custom_feeds']['podcast']) && !empty($Settings['custom_feeds'])) {
        $Settings['custom_feeds'] = array_merge(array('podcast' => __('Podcast Feed (default)', 'powerpress')), $Settings['custom_feeds']);
    } else {
        if (empty($Settings['custom_feeds'])) {
            $Settings['custom_feeds'] = array('podcast' => __('Podcast Feed (default)', 'powerpress'));
        }
    }
    if ($results) {
        if ($results['feeds_required'] > count($Settings['custom_feeds'])) {
            powerpress_page_message_add_error(sprintf(__('We found blog posts that have as many as %d media files. You may need to create %d more Custom Feeds in order to import all of the media.', 'powerpress'), $results['feeds_required'], $results['feeds_required'] - count($Settings['custom_feeds'])));
            powerpress_page_message_print();
        }
    }
    powerpressadmin_mt_import_print_log();
    ?>
<style type="text/css">
.column-exclude {
	width: 80px;
}
.column-post-date {
	width: 80px;
}
.error-mt {
	background-color: #ffebe8;
	border-color: #c00;
	border-width: 1px;
	border-style: solid;
	padding: 0 0.6em;
	margin: 5px 15px 2px;
	-moz-border-radius: 3px;
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
}
label {
	float: left;
	width: 160px;
}
</style>
<script language="javascript"><!--

function check_radio_selection(obj, PostID, FileIndex)
{
	if( obj.value == '' ) // Users can select the no feed option as much as they want
		return true;
	
	var Field = obj.id;
	while( Field.charAt( Field.length-1 ) >= "0" &&  Field.charAt( Field.length-1 ) <= "9" ) // ( chr < "0" ) || ( chr > "9" )
	{
		Field = Field.substring(0, Field.length-1);
	}
	
	var Pos = 0;
	var CheckObj = document.getElementsByName( "Import["+PostID+"]["+Pos+"]" );
	while( CheckObj )
	{
		if( CheckObj.length == 0 )
			break;
			
		if( Pos != FileIndex )
		{
			for (var i = 0; i < CheckObj.length; i++)
			{
				if (CheckObj[i].type == 'radio' && CheckObj[i].checked && CheckObj[i].value == obj.value )
				{
					alert("<?php 
    echo __('Sorry, you may only select one media file per post per feed.', 'powerpress');
    ?>
");
					return false;
				}
			}
		}
		Pos++;
		var CheckObj = document.getElementsByName( "Import["+PostID+"]["+Pos+"]" );
	}
	
	return true;
}

function no_import_all()
{
	if( !confirm('<?php 
    echo __('Select "No Import" option for all media files?', 'powerpress');
    ?>
') )
		return;
		
	var Inputs = document.getElementsByTagName('input');
	for (var i = 0; i < Inputs.length; i++)
	{
		var Elem = Inputs[i];
		if( Elem.type == 'radio' && Elem.value == '' )
			Elem.checked = true;
	}
}

function select_all(index,value)
{
	var NoImport = [];
	var Inputs = document.getElementsByTagName('input');
	for (var i = 0; i < Inputs.length; i++)
	{
		var Elem = Inputs[i];
		if( Elem.type == 'radio' && Elem.value == value )
		{
			ElemIndex = Elem.id.substring( Elem.id.lastIndexOf('_')+1);
			if( ElemIndex == index )
				Elem.checked = true;
			else if( Elem.checked && Elem.value != '' )
				NoImport.push( Elem.id );
		}
	}
	for (var i = 0; i < Inputs.length; i++)
	{
		var Elem = Inputs[i];
		if( Elem.type == 'radio' && Elem.value == '' )
		{
			for (var j = 0; j < NoImport.length; j++)
			{
				if( NoImport[j] == Elem.id )
					Elem.checked = true;
			}
		}
	}
}
//-->
</script>
<h2><?php 
    echo __('Import Episodes', 'powerpress');
    ?>
</h2>
<?php 
    if (count($results) == 0 || count($results) == 1) {
        ?>
	
	<p><?php 
        echo __('No episodes found to import.', 'powerpress');
        ?>
</p>
<?php 
    } else {
        ?>
<input type="hidden" name="action" value="powerpress-importmt" />
<p><?php 
        echo __('Select the media file under each feed for each episode you wish to import.', 'powerpress');
        ?>
</p>
<table class="widefat fixed" cellspacing="0">
	<thead>
	<tr>
<?php 
        print_column_headers('powerpressadmin_importmt');
        ?>
	</tr>
	</thead>

	<tfoot>
	<tr>
<?php 
        print_column_headers('powerpressadmin_importmt', false);
        ?>
	</tr>
	</tfoot>
	<tbody>
<?php 
        $StrandedEpisodes = 0;
        $ImportableEpisodes = 0;
        $MaxFileIndex = 1;
        $count = 0;
        while (list($post_id, $import_data) = each($results)) {
            $edit_link = get_edit_post_link($post_id);
            if ($post_id == 'feeds_required') {
                continue;
            }
            $columns = powerpressadmin_importmt_columns();
            $CurrentEnclosures = array();
            if (is_array($Settings['custom_feeds'])) {
                while (list($feed_slug, $value) = each($Settings['custom_feeds'])) {
                    if ($feed_slug == 'podcast') {
                        $enclosure_data = get_post_meta($post_id, 'enclosure', true);
                    } else {
                        $enclosure_data = get_post_meta($post_id, '_' . $feed_slug . ':enclosure', true);
                    }
                    if (!$enclosure_data) {
                        continue;
                    }
                    @(list($EnclosureURL, $EnclosureSize, $EnclosureType, $Serialized) = @explode("\n", $enclosure_data));
                    if ($EnclosureURL) {
                        $CurrentEnclosures[$feed_slug] = array();
                        $CurrentEnclosures[$feed_slug]['url'] = trim($EnclosureURL);
                        $CurrentEnclosures[$feed_slug]['imported'] = false;
                    }
                    $found = false;
                    while (list($episode_index, $episode_data) = each($import_data['enclosures'])) {
                        if ($episode_data['url'] == $CurrentEnclosures[$feed_slug]['url']) {
                            $import_data['enclosures'][$episode_index]['imported'] = true;
                            $CurrentEnclosures[$feed_slug]['imported'] = true;
                            $found = true;
                            break;
                        }
                    }
                    reset($import_data['enclosures']);
                    if ($found == false) {
                        // Add it to the media file list, prepend it...
                        $is_enclosure_data = array();
                        $is_enclosure_data['url'] = $CurrentEnclosures[$feed_slug]['url'];
                        $is_enclosure_data['imported'] = true;
                        array_push($import_data['enclosures'], $is_enclosure_data);
                        $CurrentEnclosures[$feed_slug]['imported'] = true;
                        $CurrentEnclosures[$feed_slug]['present'] = true;
                    }
                }
                reset($Settings['custom_feeds']);
            }
            $feed_title = '';
            if ($feed_slug == 'podcast') {
                $feed_title = __('Podcast Feed (default)', 'powerpress');
            }
            $feed_title = esc_html($feed_title);
            if ($count % 2 == 0) {
                echo '<tr valign="middle" class="alternate">';
            } else {
                echo '<tr valign="middle">';
            }
            $CheckedEpisodes = array();
            // key = file_index, value = feed-slug
            $feed_index = 0;
            foreach ($columns as $column_name => $column_display_name) {
                $class = "class=\"column-{$column_name}\"";
                switch ($column_name) {
                    case 'post-title':
                        echo '<td ' . $class . '><strong>';
                        if (current_user_can('edit_post', $post_id)) {
                            ?>
<a class="row-title" href="<?php 
                            echo $edit_link;
                            ?>
" title="<?php 
                            echo esc_attr(sprintf(__('Edit "%s"', 'powerpress'), $import_data['post_title']));
                            ?>
"><?php 
                            echo esc_attr($import_data['post_title']);
                            ?>
</a><?php 
                        } else {
                            echo $import_data['post_title'];
                        }
                        echo '</strong><br />';
                        echo '<div style="margin-left: 10px;">';
                        $index = 1;
                        while (list($episode_index, $episode_data) = each($import_data['enclosures'])) {
                            if ($index > $MaxFileIndex) {
                                $MaxFileIndex = $index;
                            }
                            $Parts = parse_url($episode_data['url']);
                            $filename = substr($Parts['path'], strrpos($Parts['path'], '/') + 1);
                            if ($filename == '') {
                                $filename = $episode_data['url'];
                            }
                            echo "File&nbsp;{$index}:&nbsp;";
                            echo '<input type="hidden" name="Media[' . $post_id . '][' . $episode_index . ']" value="' . htmlspecialchars($episode_data['url']) . '" />';
                            if (empty($episode_data['imported'])) {
                                echo '<span style="color: #CC0000; font-weight: bold; cursor:pointer;" onclick="alert(\'File: ' . $filename . '\\nURL: ' . $episode_data['url'] . '\')">';
                                $StrandedEpisodes++;
                            } else {
                                echo '<span style="color: green; font-weight: bold; cursor:pointer;" onclick="alert(\'File: ' . $filename . '\\nURL: ' . $episode_data['url'] . '\')">';
                            }
                            if (empty($episode_data['imported'])) {
                                echo '*';
                            }
                            echo $filename;
                            echo '</span>';
                            echo '<br/>';
                            $index++;
                        }
                        if ($index > 1) {
                            // Do we need the post title?
                            echo '<input type="hidden" name="Titles[' . $post_id . ']" value="' . htmlspecialchars($import_data['post_title']) . '" />';
                        }
                        reset($import_data['enclosures']);
                        echo '</div>';
                        echo '</td>';
                        break;
                    case 'post-date':
                        echo "<td {$class}>";
                        $timestamp = strtotime($import_data['post_date']);
                        echo date('Y/m/d', $timestamp);
                        echo "</td>";
                        break;
                    case 'feed-slug':
                        echo "<td {$class}>{$feed_slug}";
                        echo "</td>";
                        break;
                    default:
                        echo "<td {$class}>";
                        $feed_slug = substr($column_name, 5);
                        if ($column_name == 'exclude') {
                            $feed_slug = '';
                        }
                        $enclosure_data = false;
                        $EnclosureURL = '';
                        echo '<div class="">&nbsp;<br />';
                        if (isset($CurrentEnclosures[$feed_slug]) && $CurrentEnclosures[$feed_slug]['imported']) {
                            $index = 1;
                            while (list($episode_index, $episode_data) = each($import_data['enclosures'])) {
                                echo "File {$index}: ";
                                if ($CurrentEnclosures[$feed_slug]['url'] == $episode_data['url']) {
                                    if (!empty($CurrentEnclosures[$feed_slug]['present'])) {
                                        echo '<strong style="color: green;">' . __('present', 'powerpress') . '</strong>';
                                    } else {
                                        echo '<strong style="color: green;">' . __('imported', 'powerpress') . '</strong>';
                                    }
                                } else {
                                    echo 'X';
                                }
                                echo "<br/>\n";
                                $index++;
                            }
                            reset($import_data['enclosures']);
                        } else {
                            $index = 1;
                            while (list($episode_index, $episode_data) = each($import_data['enclosures'])) {
                                echo "File&nbsp;{$index}:&nbsp;";
                                if (!empty($episode_data['imported'])) {
                                    echo '&nbsp;X';
                                } else {
                                    $checked = '';
                                    if (!isset($CheckedEpisodes[$episode_index]) && !in_array($feed_slug, $CheckedEpisodes)) {
                                        $checked = 'checked';
                                        $CheckedEpisodes[$episode_index] = $feed_slug;
                                    }
                                    if (!isset($CheckedEpisodes[$episode_index]) && $feed_slug == '') {
                                        $checked = 'checked';
                                    }
                                    echo '<input type="radio" id="import_' . $post_id . '_' . $episode_index . '" name="Import[' . $post_id . '][' . $episode_index . ']" value="' . $feed_slug . '" ' . $checked . ' onclick="return check_radio_selection(this, ' . $post_id . ', ' . $episode_index . ')" />';
                                }
                                echo '<br/>';
                                $index++;
                            }
                            reset($import_data['enclosures']);
                        }
                        echo '</div>';
                        echo "</td>";
                        $feed_index++;
                        break;
                }
            }
            echo "\n    </tr>\n";
            $count++;
        }
        ?>
	</tbody>
</table>

<p><?php 
        echo sprintf(__('Importable episodes highlighted in %s with asterisks *.', 'powerpress'), '<span style="color: #CC0000; font-weight: bold;">' . __('red', 'powerpress') . '</span>');
        ?>
</p>
<p style="margin-bottom: 0; padding-bottom: 0;"><?php 
        echo __('Select Only:', 'powerpress');
        ?>
</p>
<?php 
        if ($results['feeds_required'] < 1) {
            $results['feeds_required'] = 1;
        }
        for ($number = 0; $number < $MaxFileIndex; $number++) {
            ?>
<p style="margin: 0 0 0 40px; padding: 0;">
 <?php 
            echo __('File', 'powerpress');
            ?>
 <?php 
            echo $number + 1;
            ?>
:
<?php 
            while (list($feed_slug, $feed_title) = each($Settings['custom_feeds'])) {
                echo '<a href="javascript:void()" onclick="select_all(' . $number . ',\'' . $feed_slug . '\');return false;">' . htmlspecialchars($feed_title) . '</a> | ';
            }
            reset($Settings['custom_feeds']);
            ?>
<a href="javascript:void()" onclick="select_all(<?php 
            echo $number;
            ?>
,'');return false;"><?php 
            echo __('No Import', 'powerpress');
            ?>
</a>
</p>
<?php 
        }
        ?>
<p><?php 
        echo __('Types of media found:', 'powerpress');
        ?>
 
<?php 
        $comma = false;
        global $g_import_mt_extensions;
        while (list($ext, $null) = each($g_import_mt_extensions)) {
            if ($comma) {
                echo ', ';
            }
            $comma = true;
            echo $ext;
        }
        ?>
</p>



<?php 
    }
    if ($StrandedEpisodes) {
        reset($results);
        ?>
<p><?php 
        echo sprintf(__('There are %d media files that can be imported with a total of %d blog post podcast episodes.', 'powerpress'), $StrandedEpisodes, count($results) - 1);
        ?>
</p>
<?php 
    }
    ?>
<p class="submit">
<input type="submit" name="Submit" id="powerpress_import_button" class="button-primary" value="Import Episodes" onclick="return confirm('Import selected episodes, are you sure?');" />
 &nbsp; <input type="checkbox" name="DetectDuration" value="1" /> <?php 
    echo __('Detect duration for mp3 media. (expect script to take a while with this option)', 'powerpress');
    ?>
</p>
</p>
</form>
<hr />
<form enctype="enctype" method="get" action="<?php 
    echo admin_url('admin.php');
    ?>
">
<input type="hidden" name="page" value="powerpress/powerpressadmin_tools.php" />
<input type="hidden" name="action" value="powerpress-mt-epiosdes" />
<h2><?php 
    echo __('Filter Results', 'powerpress');
    ?>
</h2>
<p><label><?php 
    echo __('Include Only', 'powerpress');
    ?>
</label><input type="text" name="include_only_ext" value="<?php 
    if (!empty($_GET['include_only_ext'])) {
        echo htmlspecialchars($_GET['include_only_ext']);
    }
    ?>
" style="width: 240px;" />
(<?php 
    echo __('leave blank for all media', 'powerpress');
    ?>
) <br />
<label>&nbsp;</label><?php 
    echo __('Specify the file extensions to include separated by commas (e.g. mp3, m4v).', 'powerpress');
    ?>
</p>
<p class="submit">
<input type="submit" name="Submit" class="button-primary" value="<?php 
    echo __('Filter Episodes', 'powerpress');
    ?>
" />
</p>
	<!-- start footer -->
<?php 
}
예제 #14
0
 /**
  * Metabox for showing the groups as a list
  *
  * @param $data
  */
 function metaboxCategoryGroupList($data)
 {
     echo '<form id="posts-filter" action="" method="get">';
     echo '<div class="clear"></div>';
     echo '<table class="widefat fixed" cellspacing="0">';
     echo '<thead>';
     echo '<tr>';
     print_column_headers('categories_group');
     echo '</tr>';
     echo '</thead>';
     echo '<tfoot>';
     echo '<tr>';
     print_column_headers('categories_group', false);
     echo '</tr>';
     echo '</tfoot>';
     echo '<tbody id="the-list" class="list:group">';
     $this->printCategoryGroupRows();
     echo '</tbody>';
     echo '</table>';
     echo '<br class="clear" />';
     echo '</form>';
     //echo '</div>';
 }
function powerpress_admin_posttypefeeds()
{
    $General = powerpress_get_settings('powerpress_general');
    $post_types = powerpress_admin_get_post_types(false);
    ?>
<h2><?php 
    echo __('Post Type Podcasting', 'powerpress');
    ?>
</h2>
<p>
	<?php 
    echo __('Post Type Podcasting adds custom podcast settings to specific Post Type feeds.', 'powerpress');
    ?>
</p>
<style type="text/css">
.column-url {
	width: 40%;
}
.column-name {
	width: 30%;
}
.column-feed-slug {
	width: 15%;
}
.column-post-type {
	width: 15%;
}
.column-episode-count {
	width: 15%;
}
.category-list {
	width: 100%;
}
.form-field select {
	width: 95%;
}
</style>
<div id="col-container">

<div id="col-right">
<table class="widefat fixed" cellspacing="0">
	<thead>
	<tr>
<?php 
    print_column_headers('powerpressadmin_posttypefeeds');
    ?>
	</tr>
	</thead>

	<tfoot>
	<tr>
<?php 
    print_column_headers('powerpressadmin_posttypefeeds', false);
    ?>
	</tr>
	</tfoot>
	<tbody>
<?php 
    $count = 0;
    while (list($null, $post_type) = each($post_types)) {
        $PostTypeSettingsArray = get_option('powerpress_posttype_' . $post_type);
        if (!$PostTypeSettingsArray) {
            continue;
        }
        while (list($feed_slug, $PostTypeSettings) = each($PostTypeSettingsArray)) {
            $feed_title = !empty($PostTypeSettings['title']) ? $PostTypeSettings['title'] : '(blank)';
            // $post_type
            // $feed_slug
            //global $wpdb;
            //	var_dump($term_info);
            //$category = get_category_to_edit($cat_ID);
            $columns = powerpress_admin_posttypefeeds_columns();
            $hidden = array();
            if ($count % 2 == 0) {
                echo '<tr valign="middle" class="alternate">';
            } else {
                echo '<tr valign="middle">';
            }
            $edit_link = admin_url('admin.php?page=powerpress/powerpressadmin_posttypefeeds.php&amp;action=powerpress-editposttypefeed&amp;feed_slug=' . $feed_slug . '&podcast_post_type=' . $post_type);
            $url = get_post_type_archive_feed_link($post_type, $feed_slug);
            $short_url = str_replace('http://', '', $url);
            $short_url = str_replace('www.', '', $short_url);
            if (strlen($short_url) > 35) {
                $short_url = substr($short_url, 0, 32) . '...';
            }
            foreach ($columns as $column_name => $column_display_name) {
                $class = "class=\"column-{$column_name}\"";
                switch ($column_name) {
                    case 'feed-slug':
                        echo "<td {$class}>{$feed_slug}";
                        echo "</td>";
                        break;
                    case 'name':
                        echo '<td ' . $class . '><strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit "%s"', 'powerpress'), $feed_title)) . '">' . $feed_title . '</a></strong><br />';
                        $actions = array();
                        $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit', 'powerpress') . '</a>';
                        $actions['remove'] = "<a class='submitdelete' href='" . admin_url() . wp_nonce_url("admin.php?page=powerpress/powerpressadmin_posttypefeeds.php&amp;action=powerpress-delete-posttype-feed&amp;podcast_post_type={$post_type}&amp;feed_slug={$feed_slug}", 'powerpress-delete-posttype-feed-' . $post_type . '_' . $feed_slug) . "' onclick=\"if ( confirm('" . esc_js(sprintf(__("You are about to remove podcast settings for Post Type '%s'\n  'Cancel' to stop, 'OK' to delete.", 'powerpress'), $feed_title)) . "') ) { return true;}return false;\">" . __('Remove', 'powerpress') . "</a>";
                        $action_count = count($actions);
                        $i = 0;
                        echo '<div class="row-actions">';
                        foreach ($actions as $action => $linkaction) {
                            ++$i;
                            $i == $action_count ? $sep = '' : ($sep = ' | ');
                            echo '<span class="' . $action . '">' . $linkaction . $sep . '</span>';
                        }
                        echo '</div>';
                        echo '</td>';
                        break;
                    case 'url':
                        echo "<td {$class}><a href='{$url}' title='" . esc_attr(sprintf(__('Visit %s', 'powerpress'), $feed_title)) . "' target=\"_blank\">{$short_url}</a>";
                        echo '<div class="row-actions">';
                        echo '<span class="' . $action . '"><a href="http://www.feedvalidator.org/check.cgi?url=' . urlencode(str_replace('&amp;', '&', $url)) . '" target="_blank">' . __('Validate Feed', 'powerpress') . '</a></span>';
                        echo '</div>';
                        echo "</td>";
                        break;
                    case 'episode-count':
                        echo "<td {$class}>{$episode_total}";
                        echo "</td>";
                        break;
                    case 'post-type':
                        echo "<td {$class}>{$post_type}";
                        echo "</td>";
                        break;
                    default:
                        break;
                }
            }
            echo "\n    </tr>\n";
            $count++;
        }
    }
    ?>
	</tbody>
</table>
</div> <!-- col-right -->

<div id="col-left">
<div class="col-wrap">
<div class="form-wrap">
<h3><?php 
    echo __('Add Podcasting to a custom Post Type', 'powerpress');
    ?>
</h3>
<input type="hidden" name="action" value="powerpress-addposttypefeed" />


<div class="form-field form-required">
<label  for="powerpress_post_type_select"><?php 
    echo __('Post Type', 'powerpress');
    ?>
</label>
<select id="powerpress_post_type_select" name="podcast_post_type" style="width: 95%;">
	<option value=""><?php 
    echo __('Select Post Type', 'powerpress');
    ?>
</option>
<?php 
    reset($post_types);
    while (list($null, $post_type) = each($post_types)) {
        if ($post_type == 'post') {
            continue;
        }
        $post_type = htmlspecialchars($post_type);
        echo "\t<option value=\"{$post_type}\">{$post_type}</option>\n";
    }
    ?>
</select>
</div>

<div class="form-field form-required">
	<label for="feed_title"><?php 
    echo __('Feed Title', 'powerpress');
    ?>
</label>
	<input name="feed_title" id="feed_title" type="text" value="" size="100" />
</div>

<div class="form-field">
	<label for="feed_slug"><?php 
    echo __('Feed Slug', 'powerpress');
    ?>
</label>
	<input name="feed_slug" id="feed_slug" type="text" value="" size="40" />
    <p><?php 
    echo __('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.', 'powerpress');
    ?>
</p>
</div>
<?php 
    wp_nonce_field('powerpress-add-posttype-feed');
    ?>
<p class="submit"><input type="submit" class="button" name="add_podcasting" value="<?php 
    echo __('Add Podcasting to Post Type', 'powerpress');
    ?>
" />  </p>


</div>
</div>

</div> <!-- col-left -->

</div> <!-- col-container -->

<?php 
}
예제 #16
0
function qtranxf_conf()
{
    global $q_config, $wpdb;
    //qtranxf_dbg_log('qtranxf_conf: POST: ',$_POST);
    // do redirection for dashboard
    if (isset($_GET['godashboard'])) {
        echo '<h2>' . __('Switching Language', 'qtranslate') . '</h2>' . sprintf(__('Switching language to %1$s... If the Dashboard isn\'t loading, use this <a href="%2$s" title="Dashboard">link</a>.', 'qtranslate'), $q_config['language_name'][qtranxf_getLanguage()], admin_url()) . '<script type="text/javascript">document.location="' . admin_url() . '";</script>';
        exit;
    }
    // init some needed variables
    $error = '';
    $original_lang = '';
    $language_code = '';
    $language_name = '';
    $language_locale = '';
    $language_date_format = '';
    $language_time_format = '';
    $language_na_message = '';
    $language_flag = '';
    $language_default = '';
    $altered_table = false;
    $message = apply_filters('qtranslate_configuration_pre', array());
    // check for action
    if (isset($_POST['qtranslate_reset']) && isset($_POST['qtranslate_reset2'])) {
        $message[] = __('qTranslate has been reset.', 'qtranslate');
    } elseif (isset($_POST['default_language'])) {
        qtranxf_updateSettings();
        //execute actions
        if (isset($_POST['update_mo_now']) && $_POST['update_mo_now'] == '1') {
            $result = qtranxf_updateGettextDatabases(true);
            if ($result === true) {
                $message[] = __('Gettext databases updated.', 'qtranslate');
            } elseif (is_wp_error($result)) {
                $message[] = __('Gettext databases <strong>not</strong> updated:', 'qtranslate') . ' ' . $result->get_error_message();
            }
        }
        foreach ($_POST as $key => $value) {
            if (!is_string($value)) {
                continue;
            }
            if (!qtranxf_endsWith($key, '-migration')) {
                continue;
            }
            $plugin = substr($key, 0, -strlen('-migration'));
            if ($value == 'import') {
                $nm = '<span style="color:blue"><strong>' . qtranxf_get_plugin_name($plugin) . '</strong></span>';
                $message[] = sprintf(__('Applicable options and taxonomy names from plugin %s have been imported. Note that the multilingual content of posts, pages and other objects has not been altered during this operation. There is no additional operation needed to import content, since its format is compatible with %s.', 'qtranslate'), $nm, 'qTranslate&#8209;X') . ' ' . sprintf(__('It might be a good idea to review %smigration instructions%s, if you have not yet done so.', 'qtranslate'), '<a href="https://qtranslatexteam.wordpress.com/2015/02/24/migration-from-other-multilingual-plugins/" target="_blank">', '</a>');
                $message[] = sprintf(__('%sImportant%s: Before you start making edits to post and pages, please, make sure that both, your front site and admin back-end, work under this configuration. It may help to review "%s" and see if any of conflicting plugins mentioned there are used here. While the current content, coming from %s, is compatible with this plugin, the newly modified posts and pages will be saved with a new square-bracket-only encoding, which has a number of advantages comparing to former %s encoding. However, the new encoding is not straightforwardly compatible with %s and you will need an additional step available under "%s" option if you ever decide to go back to %s. Even with this additional conversion step, the 3rd-party plugins custom-stored data will not be auto-converted, but manual editing will still work. That is why it is advisable to create a test-copy of your site before making any further changes. In case you encounter a problem, please give us a chance to improve %s, send the login information to the test-copy of your site to %s along with a detailed step-by-step description of what is not working, and continue using your main site with %s meanwhile. It would also help, if you share a success story as well, either on %sthe forum%s, or via the same e-mail as mentioned above. Thank you very much for trying %s.', 'qtranslate'), '<span style="color:red">', '</span>', '<a href="https://wordpress.org/plugins/qtranslate-x/other_notes/" target="_blank">' . 'Known Issues' . '</a>', $nm, 'qTranslate', $nm, '<span style="color:magenta">' . __('Convert Database', 'qtranslate') . '</span>', $nm, 'qTranslate&#8209;X', '<a href="mailto:qtranslateteam@gmail.com">qtranslateteam@gmail.com</a>', $nm, '<a href="https://wordpress.org/support/plugin/qtranslate-x">', '</a>', 'qTranslate&#8209;X') . '<br/><small>' . __('This is a one-time message, which you will not see again, unless the same import is repeated.', 'qtranslate') . '</small>';
                if ($plugin == 'mqtranslate') {
                    $message[] = sprintf(__('Option "%s" has also been turned on, as the most common case for importing configuration from %s. You may turn it off manually if your setup does not require it. Refer to %sFAQ%s for more information.', 'qtranslate'), '<span style="color:magenta">' . __('Compatibility Functions', 'qtranslate') . '</span>', $nm, '<a href="https://wordpress.org/plugins/qtranslate-x/faq/" target="_blank">', '</a>');
                }
            } elseif ($value == 'export') {
                $nm = '<span style="color:blue"><strong>' . qtranxf_get_plugin_name($plugin) . '</strong></span>';
                $message[] = sprintf(__('Applicable options have been exported to plugin %s. If you have done some post or page updates after migrating from %s, then "%s" operation is also required to convert the content to "dual language tag" style in order for plugin %s to function.', 'qtranslate'), $nm, $nm, '<span style="color:magenta">' . __('Convert Database', 'qtranslate') . '</span>', $nm);
            }
        }
        if (isset($_POST['convert_database'])) {
            $msg = qtranxf_convert_database($_POST['convert_database']);
            if ($msg) {
                $message[] = $msg;
            }
        }
    }
    if (isset($_POST['original_lang'])) {
        // validate form input
        $lang = sanitize_text_field($_POST['language_code']);
        if ($_POST['language_na_message'] == '') {
            $error = __('The Language must have a Not-Available Message!', 'qtranslate');
        }
        if (strlen($_POST['language_locale']) < 2) {
            $error = __('The Language must have a Locale!', 'qtranslate');
        }
        if ($_POST['language_name'] == '') {
            $error = __('The Language must have a name!', 'qtranslate');
        }
        if (strlen($lang) != 2) {
            $error = __('Language Code has to be 2 characters long!', 'qtranslate');
        }
        //$lang = strtolower($lang);
        //$language_names = qtranxf_language_configured('language_name');
        $langs = array();
        qtranxf_load_languages($langs);
        $language_names = $langs['language_name'];
        if ($_POST['original_lang'] == '' && $error == '') {
            // new language
            if (isset($language_names[$lang])) {
                $error = __('There is already a language with the same Language Code!', 'qtranslate');
            }
        }
        if ($_POST['original_lang'] != '' && $error == '') {
            // language update
            if ($lang != $_POST['original_lang'] && isset($language_names[$lang])) {
                $error = __('There is already a language with the same Language Code!', 'qtranslate');
            } else {
                if ($lang != $_POST['original_lang']) {
                    // remove old language
                    qtranxf_unsetLanguage($langs, $_POST['original_lang']);
                    qtranxf_unsetLanguage($q_config, $_POST['original_lang']);
                }
                if (in_array($_POST['original_lang'], $q_config['enabled_languages'])) {
                    // was enabled, so set modified one to enabled too
                    for ($i = 0; $i < sizeof($q_config['enabled_languages']); $i++) {
                        if ($q_config['enabled_languages'][$i] == $_POST['original_lang']) {
                            $q_config['enabled_languages'][$i] = $lang;
                        }
                    }
                }
                if ($_POST['original_lang'] == $q_config['default_language']) {
                    // was default, so set modified the default
                    $q_config['default_language'] = $lang;
                }
            }
        }
        /**
        	@since 3.2.9.5
        	In earlier versions the 'if' below used to work correctly, but magic_quotes has been removed from PHP for a while, and 'if(get_magic_quotes_gpc())' is now always 'false'.
        	However, WP adds magic quotes anyway via call to add_magic_quotes() in
        	./wp-includes/load.php:function wp_magic_quotes()
        	called from
        	./wp-settings.php: wp_magic_quotes()
        	Then it looks like we have to always 'stripslashes' now, although it is dangerous, since applying 'stripslashes' twice messes it up.
        	This problem reveals when, for example, '\a' format is in use.
        	Possible test for '\' character, instead of 'get_magic_quotes_gpc()' can be 'strpos($_POST['language_date_format'],'\\\\')' for this particular case.
        	If Wordpress ever decides to remove calls to wp_magic_quotes, then this place will be in trouble again.
        	Discussions:
        	http://wordpress.stackexchange.com/questions/21693/wordpress-and-magic-quotes
        */
        //if(get_magic_quotes_gpc()) {
        //qtranxf_dbg_log('get_magic_quotes_gpc: before REQUEST[language_date_format]=',$_REQUEST['language_date_format']);
        //qtranxf_dbg_log('get_magic_quotes_gpc: before POST[language_date_format]=',$_POST['language_date_format']);
        //qtranxf_dbg_log('pos=',strpos($_POST['language_date_format'],'\\\\'));//shows a number
        if (isset($_POST['language_date_format'])) {
            $_POST['language_date_format'] = stripslashes($_POST['language_date_format']);
        }
        if (isset($_POST['language_time_format'])) {
            $_POST['language_time_format'] = stripslashes($_POST['language_time_format']);
        }
        //qtranxf_dbg_log('pos=',strpos($_POST['language_date_format'],'\\\\'));//shows false
        //qtranxf_dbg_log('get_magic_quotes_gpc: after REQUEST[language_date_format]=',$_REQUEST['language_date_format']);
        //qtranxf_dbg_log('get_magic_quotes_gpc: after POST[language_date_format]=',$_POST['language_date_format']);
        //}
        if ($error == '') {
            // everything is fine, insert language
            $q_config['language_name'][$lang] = sanitize_text_field($_POST['language_name']);
            $q_config['flag'][$lang] = sanitize_text_field($_POST['language_flag']);
            $q_config['locale'][$lang] = sanitize_text_field($_POST['language_locale']);
            $q_config['date_format'][$lang] = sanitize_text_field($_POST['language_date_format']);
            $q_config['time_format'][$lang] = sanitize_text_field($_POST['language_time_format']);
            $q_config['not_available'][$lang] = wp_kses_data($_POST['language_na_message']);
            qtranxf_copyLanguage($langs, $q_config, $lang);
            qtranxf_save_languages($langs);
        }
        if ($error != '' || isset($_GET['edit'])) {
            // get old values in the form
            $original_lang = sanitize_text_field($_POST['original_lang']);
            $language_code = $lang;
            $language_name = sanitize_text_field($_POST['language_name']);
            $language_locale = sanitize_text_field($_POST['language_locale']);
            $language_date_format = sanitize_text_field($_POST['language_date_format']);
            $language_time_format = sanitize_text_field($_POST['language_time_format']);
            $language_na_message = wp_kses_data($_POST['language_na_message']);
            $language_flag = sanitize_text_field($_POST['language_flag']);
            $language_default = isset($_POST['language_default']) ? sanitize_text_field($_POST['language_default']) : $q_config['default_language'];
        }
    } elseif (isset($_GET['convert'])) {
        // update language tags
        global $wpdb;
        $wpdb->show_errors();
        $cnt = 0;
        //this will not work correctly if set of languages is different
        foreach ($q_config['enabled_languages'] as $lang) {
            $cnt += $wpdb->query('UPDATE ' . $wpdb->posts . ' set post_title = REPLACE(post_title, "[lang_' . $lang . ']","[:' . $lang . ']"),  post_content = REPLACE(post_content, "[lang_' . $lang . ']","[:' . $lang . ']")');
            $wpdb->query('UPDATE ' . $wpdb->posts . ' set post_title = REPLACE(post_title, "[/lang_' . $lang . ']","[:]"),  post_content = REPLACE(post_content, "[/lang_' . $lang . ']","[:]")');
        }
        if ($cnt > 0) {
            $message[] = sprintf(__('%d database entries have been converted.', 'qtranslate'), $cnt);
        } else {
            $message[] = __('No database entry has been affected while processing the conversion request.', 'qtranslate');
        }
    } elseif (isset($_GET['markdefault'])) {
        // update language tags
        global $wpdb;
        $wpdb->show_errors();
        $result = $wpdb->get_results('SELECT ID, post_content, post_title, post_excerpt, post_type FROM ' . $wpdb->posts . ' WHERE post_status = \'publish\' AND  (post_type = \'post\' OR post_type = \'page\') AND NOT (post_content LIKE \'%<!--:-->%\' OR post_title LIKE \'%<!--:-->%\' OR post_content LIKE \'%![:!]%\' ESCAPE \'!\' OR post_title LIKE \'%![:!]%\' ESCAPE \'!\')');
        if (is_array($result)) {
            $cnt_page = 0;
            $cnt_post = 0;
            foreach ($result as $post) {
                $title = qtranxf_mark_default($post->post_title);
                $content = qtranxf_mark_default($post->post_content);
                $excerpt = qtranxf_mark_default($post->post_excerpt);
                if ($title == $post->post_title && $content == $post->post_content && $excerpt == $post->post_excerpt) {
                    continue;
                }
                switch ($post->post_type) {
                    case 'post':
                        ++$cnt_post;
                        break;
                    case 'page':
                        ++$cnt_page;
                        break;
                }
                //qtranxf_dbg_log('markdefault:'. PHP_EOL .'title old: '.$post->post_title. PHP_EOL .'title new: '.$title. PHP_EOL .'content old: '.$post->post_content. PHP_EOL .'content new: '.$content); continue;
                $wpdb->query($wpdb->prepare('UPDATE ' . $wpdb->posts . ' set post_content = %s, post_title = %s, post_excerpt = %s WHERE ID = %d', $content, $title, $excerpt, $post->ID));
            }
            if ($cnt_page > 0) {
                $message[] = sprintf(__('%d pages have been processed to set the default language.', 'qtranslate'), $cnt_page);
            } else {
                $message[] = __('No initially untranslated pages found to set the default language', 'qtranslate');
            }
            if ($cnt_post > 0) {
                $message[] = sprintf(__('%d posts have been processed to set the default language.', 'qtranslate'), $cnt_post);
            } else {
                $message[] = __('No initially untranslated posts found to set the default language.', 'qtranslate');
            }
            $message[] = sprintf(__('Post types other than "post" or "page", as well as unpublished entries, will have to be adjusted manually as needed, since there is no common way to automate setting the default language otherwise. It can be done with a custom script though. You may request a %spaid support%s for this.', 'qtranslate'), '<a href="https://qtranslatexteam.wordpress.com/contact-us/">', '</a>');
        }
    } elseif (isset($_GET['edit'])) {
        $lang = $_GET['edit'];
        $original_lang = $lang;
        $language_code = $lang;
        //$langs = $q_config;
        $langs = array();
        qtranxf_languages_configured($langs);
        $language_name = isset($langs['language_name'][$lang]) ? $langs['language_name'][$lang] : '';
        $language_locale = isset($langs['locale'][$lang]) ? $langs['locale'][$lang] : '';
        $language_date_format = isset($langs['date_format'][$lang]) ? $langs['date_format'][$lang] : '';
        $language_time_format = isset($langs['time_format'][$lang]) ? $langs['time_format'][$lang] : '';
        $language_na_message = isset($langs['not_available'][$lang]) ? $langs['not_available'][$lang] : '';
        $language_flag = isset($langs['flag'][$lang]) ? $langs['flag'][$lang] : '';
    } elseif (isset($_GET['delete'])) {
        $lang = $_GET['delete'];
        // validate delete (protect code)
        //if($q_config['default_language']==$lang) $error = 'Cannot delete Default Language!';
        //if(!isset($q_config['language_name'][$lang])||strtolower($lang)=='code') $error = __('No such language!', 'qtranslate');
        if (empty($error)) {
            // everything seems fine, delete language
            $error = qtranxf_deleteLanguage($lang);
        }
    } elseif (isset($_GET['enable'])) {
        $lang = $_GET['enable'];
        // enable validate
        if (!qtranxf_enableLanguage($lang)) {
            $error = __('Language is already enabled or invalid!', 'qtranslate');
        }
    } elseif (isset($_GET['disable'])) {
        $lang = $_GET['disable'];
        // enable validate
        if ($lang == $q_config['default_language']) {
            $error = __('Cannot disable Default Language!', 'qtranslate');
        }
        if (!qtranxf_isEnabled($lang)) {
            if (!isset($q_config['language_name'][$lang])) {
                $error = __('No such language!', 'qtranslate');
            }
        }
        // everything seems fine, disable language
        if ($error == '' && !qtranxf_disableLanguage($lang)) {
            $error = __('Language is already disabled!', 'qtranslate');
        }
    } elseif (isset($_GET['moveup'])) {
        $languages = qtranxf_getSortedLanguages();
        $msg = __('No such language!', 'qtranslate');
        foreach ($languages as $key => $language) {
            if ($language != $_GET['moveup']) {
                continue;
            }
            if ($key == 0) {
                $msg = __('Language is already first!', 'qtranslate');
                break;
            }
            $languages[$key] = $languages[$key - 1];
            $languages[$key - 1] = $language;
            $q_config['enabled_languages'] = $languages;
            $msg = __('New order saved.', 'qtranslate');
            break;
        }
        $message[] = $msg;
    } elseif (isset($_GET['movedown'])) {
        $languages = qtranxf_getSortedLanguages();
        $msg = __('No such language!', 'qtranslate');
        foreach ($languages as $key => $language) {
            if ($language != $_GET['movedown']) {
                continue;
            }
            if ($key == sizeof($languages) - 1) {
                $msg = __('Language is already last!', 'qtranslate');
                break;
            }
            $languages[$key] = $languages[$key + 1];
            $languages[$key + 1] = $language;
            $q_config['enabled_languages'] = $languages;
            $msg = __('New order saved.', 'qtranslate');
            break;
        }
        $message[] = $msg;
    }
    $everything_fine = (isset($_POST['submit']) || isset($_GET['delete']) || isset($_GET['enable']) || isset($_GET['disable']) || isset($_GET['moveup']) || isset($_GET['movedown'])) && $error == '';
    if ($everything_fine) {
        // settings might have changed, so save
        qtranxf_saveConfig();
        if (empty($message)) {
            $message[] = __('Options saved.', 'qtranslate');
        }
    }
    if ($q_config['auto_update_mo']) {
        if (!is_dir(WP_LANG_DIR) || !($ll = @fopen(trailingslashit(WP_LANG_DIR) . 'qtranslate.test', 'a'))) {
            $error = sprintf(__('Could not write to "%s", Gettext Databases could not be downloaded!', 'qtranslate'), WP_LANG_DIR);
        } else {
            @fclose($ll);
            @unlink(trailingslashit(WP_LANG_DIR) . 'qtranslate.test');
        }
    }
    // don't accidentally delete/enable/disable twice
    $clean_uri = preg_replace("/&(delete|enable|disable|convert|markdefault|moveup|movedown)=[^&#]*/i", "", $_SERVER['REQUEST_URI']);
    $clean_uri = apply_filters('qtranslate_clean_uri', $clean_uri);
    // Generate XHTML
    $plugindir = dirname(plugin_basename(QTRANSLATE_FILE));
    $pluginurl = WP_PLUGIN_URL . '/' . $plugindir;
    if (!empty($message)) {
        foreach ($message as $msg) {
            ?>
<div id="message" class="updated fade"><p><strong><?php 
            echo $msg;
            ?>
</strong></p></div>
<?php 
        }
    }
    if ($error != '') {
        ?>
<div id="message" class="error fade"><p><strong><?php 
        echo $error;
        ?>
</strong></p></div>
<?php 
    }
    ?>

<?php 
    if (isset($_GET['edit'])) {
        ?>
<div class="wrap">
<h2><?php 
        _e('Edit Language', 'qtranslate');
        ?>
</h2>
<form action="" method="post" id="qtranxs-edit-language">
<?php 
        qtranxf_language_form($language_code, $language_code, $language_name, $language_locale, $language_date_format, $language_time_format, $language_flag, $language_na_message, $language_default, $original_lang);
        ?>
<p class="submit"><input type="submit" name="submit" value="<?php 
        _e('Save Changes &raquo;', 'qtranslate');
        ?>
" /></p>
</form>
<p><small><a href="<?php 
        echo admin_url('options-general.php?page=qtranslate-x');
        ?>
"><?php 
        _e('back to configuration page', 'qtranslate');
        ?>
</a></small></p>
</div>
<?php 
    } else {
        ?>
<div class="wrap">
<h2><?php 
        _e('Language Management (qTranslate Configuration)', 'qtranslate');
        ?>
</h2>
<small><?php 
        printf(__('For help on how to configure qTranslate correctly, take a look at the <a href="%1$s">qTranslate FAQ</a> and the <a href="%2$s">Support Forum</a>.', 'qtranslate'), 'https://qtranslatexteam.wordpress.com/faq/', 'https://wordpress.org/support/plugin/qtranslate-x');
        ?>
</small>
	<form action="<?php 
        echo $clean_uri;
        ?>
" method="post">
	<?php 
        qtranxf_admin_section_start(__('General Settings', 'qtranslate'), 'general');
        //id="qtranslate-admin-general"
        ?>
		<table class="form-table">
			<tr>
				<th scope="row"><?php 
        _e('Default Language / Order', 'qtranslate');
        ?>
</th>
				<td>
					<fieldset id="qtranxs-languages-menu"><legend class="hidden"><?php 
        _e('Default Language', 'qtranslate');
        ?>
</legend>
				<?php 
        $flag_location = qtranxf_flag_location();
        foreach (qtranxf_getSortedLanguages() as $key => $language) {
            echo '<label title="' . $q_config['language_name'][$language] . '"><input type="radio" name="default_language" value="' . $language . '"';
            checked($language, $q_config['default_language']);
            echo ' />';
            echo ' <a href="' . add_query_arg('moveup', $language, $clean_uri) . '"><img src="' . $pluginurl . '/arrowup.png" alt="up" /></a>';
            echo ' <a href="' . add_query_arg('movedown', $language, $clean_uri) . '"><img src="' . $pluginurl . '/arrowdown.png" alt="down" /></a>';
            echo ' <img src="' . $flag_location . $q_config['flag'][$language] . '" alt="' . $q_config['language_name'][$language] . '" /> ';
            echo ' ' . $q_config['language_name'][$language] . '</label><br/>' . PHP_EOL;
        }
        ?>
					<small><?php 
        printf(__('Choose the default language of your blog. This is the language which will be shown on %s. You can also change the order the languages by clicking on the arrows above.', 'qtranslate'), get_bloginfo('url'));
        ?>
</small>
					</fieldset>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        _e('Untranslated Content', 'qtranslate');
        ?>
</th>
				<td>
					<p><?php 
        printf(__('The choices below define how to handle untranslated content at front-end of the site. A content of a page or a post is considered untranslated if the main text (%s) is empty for a given language, regardless of other fields like title, excerpt, etc. All three options are independent of each other.', 'qtranslate'), 'post_content');
        ?>
</p>
					<br/>
					<label for="hide_untranslated"><input type="checkbox" name="hide_untranslated" id="hide_untranslated" value="1"<?php 
        checked($q_config['hide_untranslated']);
        ?>
/> <?php 
        _e('Hide Content which is not available for the selected language.', 'qtranslate');
        ?>
</label>
					<br/>
					<small><?php 
        _e('When checked, posts will be hidden if the content is not available for the selected language. If unchecked, a message will appear showing all the languages the content is available in.', 'qtranslate');
        ?>
					<?php 
        _e('The message about available languages for the content of a post or a page may also appear if a single post display with an untranslated content if viewed directly.', 'qtranslate');
        ?>
					<?php 
        printf(__('This function will not work correctly if you installed %s on a blog with existing entries. In this case you will need to take a look at option "%s" under "%s" section.', 'qtranslate'), 'qTranslate', __('Convert Database', 'qtranslate'), __('Import', 'qtranslate') . '/' . __('Export', 'qtranslate'));
        ?>
</small>
					<br/><br/>
					<label for="show_displayed_language_prefix"><input type="checkbox" name="show_displayed_language_prefix" id="show_displayed_language_prefix" value="1"<?php 
        checked($q_config['show_displayed_language_prefix']);
        ?>
/> <?php 
        _e('Show displayed language prefix when content is not available for the selected language.', 'qtranslate');
        ?>
</label>
					<br/>
					<small><?php 
        _e('This is relevant to all fields other than the main content of posts and pages. Such untranslated fields are always shown in an alternative available language, and will be prefixed with the language name in parentheses, if this option is on.', 'qtranslate');
        ?>
</small>
					<br/><br/>
					<label for="show_alternative_content"><input type="checkbox" name="show_alternative_content" id="show_alternative_content" value="1"<?php 
        checked($q_config['show_alternative_content']);
        ?>
/> <?php 
        _e('Show content in an alternative language when translation is not available for the selected language.', 'qtranslate');
        ?>
</label>
					<br/>
					<small><?php 
        printf(__('When a page or a post with an untranslated content is viewed, a message with a list of other available languages is displayed, in which languages are ordered as defined by option "%s". If this option is on, then the content in default language will also be shown, instead of the expected language, for the sake of user convenience. If default language is not available for the content, then the content in the first available language is shown.', 'qtranslate'), __('Default Language / Order', 'qtranslate'));
        ?>
</small>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        _e('Detect Browser Language', 'qtranslate');
        ?>
</th>
				<td>
					<label for="detect_browser_language"><input type="checkbox" name="detect_browser_language" id="detect_browser_language" value="1"<?php 
        checked($q_config['detect_browser_language']);
        ?>
/> <?php 
        _e('Detect the language of the browser and redirect accordingly.', 'qtranslate');
        ?>
</label>
					<br/>
					<small><?php 
        _e('When the frontpage is visited via bookmark/external link/type-in, the visitor will be forwarded to the correct URL for the language specified by his browser.', 'qtranslate');
        ?>
</small>
				</td>
			</tr>
		</table>
	<?php 
        qtranxf_admin_section_end('general');
        ?>
	<?php 
        qtranxf_admin_section_start(__('Advanced Settings', 'qtranslate'), 'advanced');
        //id="qtranslate-admin-advanced"
        $permalink_is_query = qtranxf_is_permalink_structure_query();
        //qtranxf_dbg_echo('$permalink_is_query: ',$permalink_is_query);
        $url_mode = $q_config['url_mode'];
        ?>
		<table class="form-table">
			<tr>
				<th scope="row"><?php 
        _e('URL Modification Mode', 'qtranslate');
        ?>
</th>
				<td>
					<fieldset><legend class="hidden"><?php 
        _e('URL Modification Mode', 'qtranslate');
        ?>
</legend>
						<label title="Query Mode"><input type="radio" name="url_mode" value="<?php 
        echo QTX_URL_QUERY;
        ?>
" <?php 
        checked($url_mode, QTX_URL_QUERY);
        ?>
 /> <?php 
        echo __('Use Query Mode (?lang=en)', 'qtranslate') . '. ' . __('Most SEO unfriendly, not recommended.', 'qtranslate');
        ?>
</label><br/>
					<?php 
        /*
        							if($permalink_is_query) {
        								echo '<br/>'.PHP_EOL;
        								printf(__('No other URL Modification Modes are available if permalink structure is set to "Default" on configuration page %sPermalink Setting%s. It is SEO advantageous to use some other permalink mode, which will enable more URL Modification Modes here as well.', 'qtranslate'),'<a href="'.admin_url('options-permalink.php').'">', '</a>');
        								echo PHP_EOL.'<br/><br/>'.PHP_EOL;
        							}else{ */
        ?>
						<label title="Pre-Path Mode"><input type="radio" name="url_mode" value="<?php 
        echo QTX_URL_PATH;
        ?>
" <?php 
        checked($url_mode, QTX_URL_PATH);
        disabled($permalink_is_query);
        ?>
 /> <?php 
        echo __('Use Pre-Path Mode (Default, puts /en/ in front of URL)', 'qtranslate') . '. ' . __('SEO friendly.', 'qtranslate');
        ?>
</label><br/>
						<label title="Pre-Domain Mode"><input type="radio" name="url_mode" value="<?php 
        echo QTX_URL_DOMAIN;
        ?>
" <?php 
        checked($url_mode, QTX_URL_DOMAIN);
        ?>
 /> <?php 
        echo __('Use Pre-Domain Mode (uses http://en.yoursite.com)', 'qtranslate') . '. ' . __('You will need to configure DNS sub-domains on your site.', 'qtranslate');
        ?>
</label><br/>
					<?php 
        /*
        						<small><?php _e('Pre-Path and Pre-Domain mode will only work with mod_rewrite/pretty permalinks. Additional Configuration is needed for Pre-Domain mode or Per-Domain mode.', 'qtranslate'); ?></small><br/><br/>
        							} */
        ?>
						<label for="hide_default_language"><input type="checkbox" name="hide_default_language" id="hide_default_language" value="1"<?php 
        checked($q_config['hide_default_language']);
        ?>
/> <?php 
        _e('Hide URL language information for default language.', 'qtranslate');
        ?>
</label><br/>
						<small><?php 
        _e('This is only applicable to Pre-Path and Pre-Domain mode.', 'qtranslate');
        ?>
</small><br/><br/>
					<?php 
        //if(!$permalink_is_query) {
        do_action('qtranslate_url_mode_choices', $permalink_is_query);
        ?>
						<label title="Per-Domain Mode"><input type="radio" name="url_mode" value="<?php 
        echo QTX_URL_DOMAINS;
        ?>
" <?php 
        checked($url_mode, QTX_URL_DOMAINS);
        ?>
 /> <?php 
        echo __('Use Per-Domain mode: specify separate user-defined domain for each language.', 'qtranslate');
        ?>
</label>
					<?php 
        //}
        ?>
					</fieldset>
				</td>
			</tr>
	<?php 
        /*
        			<tr valign="top">
        				<td style="text-align: right"><?php echo __('Hide Default Language', 'qtranslate').':'; ?></td>
        				<td>
        				</td>
        			</tr>
        */
        if ($url_mode == QTX_URL_DOMAINS) {
            $homeinfo = qtranxf_get_home_info();
            $home_host = $homeinfo['host'];
            //parse_url(get_option('home'),PHP_URL_HOST);
            foreach ($q_config['enabled_languages'] as $lang) {
                $id = 'language_domain_' . $lang;
                $domain = isset($q_config['domains'][$lang]) ? $q_config['domains'][$lang] : $lang . '.' . $home_host;
                echo '<tr><td style="text-align: right">' . __('Domain for', 'qtranslate') . ' <a href="' . $clean_uri . '&edit=' . $lang . '">' . $q_config['language_name'][$lang] . '</a>&nbsp;(' . $lang . '):</td><td><input type="text" name="' . $id . '" id="' . $id . '" value="' . $domain . '" style="width:100%"/></td></tr>' . PHP_EOL;
            }
        }
        ?>
			<tr valign="top">
				<th scope="row"><?php 
        _e('Post Types', 'qtranslate');
        ?>
</th>
				<td>
					<label for="post_types"><?php 
        _e('Post types enabled for translation:', 'qtranslate');
        ?>
</label><p>
					<?php 
        $post_types = get_post_types();
        foreach ($post_types as $post_type) {
            if (!qtranxf_post_type_optional($post_type)) {
                continue;
            }
            $post_type_off = isset($q_config['post_type_excluded']) && in_array($post_type, $q_config['post_type_excluded']);
            ?>
					<span style="margin-right: 12pt"><input type="checkbox" name="post_types[<?php 
            echo $post_type;
            ?>
]" id="post_type_<?php 
            echo $post_type;
            ?>
" value="1"<?php 
            checked(!$post_type_off);
            ?>
 />&nbsp;<?php 
            echo $post_type;
            ?>
</span>
					<?php 
        }
        ?>
					</p><p><small><?php 
        _e('If a post type unchecked, no fields in a post of that type are treated as translatable on editing pages. However, the manual raw multilingual entries with language tags may still get translated in a usual way at front-end.', 'qtranslate');
        ?>
</small></p>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        _e('Flag Image Path', 'qtranslate');
        ?>
</th>
				<td>
					<?php 
        echo trailingslashit(WP_CONTENT_URL);
        ?>
<input type="text" name="flag_location" id="flag_location" value="<?php 
        echo $q_config['flag_location'];
        ?>
" style="width:100%"/>
					<br/>
					<small><?php 
        printf(__('Path to the flag images under wp-content, with trailing slash. (Default: %s, clear the value above to reset it to the default)', 'qtranslate'), qtranxf_flag_location_default());
        ?>
</small>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        _e('Ignore Links', 'qtranslate');
        ?>
</th>
				<td>
					<input type="text" name="ignore_file_types" id="ignore_file_types" value="<?php 
        echo implode(',', array_diff($q_config['ignore_file_types'], explode(',', QTX_IGNORE_FILE_TYPES)));
        ?>
" style="width:100%"/>
					<br/>
					<small><?php 
        printf(__('Don\'t convert links to files of the given file types. (Always included: %s)', 'qtranslate'), implode(', ', explode(',', QTX_IGNORE_FILE_TYPES)));
        ?>
</small>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        _e('Head inline CSS', 'qtranslate');
        ?>
</th>
				<td>
					<label for="header_css_on"><input type="checkbox" name="header_css_on" id="header_css_on" value="1"<?php 
        checked($q_config['header_css_on']);
        ?>
 />&nbsp;<?php 
        _e('CSS code added by plugin in the head of front-end pages:', 'qtranslate');
        ?>
</label>
					<br />
					<textarea id="header_css" name="header_css" style="width:100%"><?php 
        echo esc_textarea($q_config['header_css']);
        ?>
</textarea>
					<br />
					<small><?php 
        echo __('To reset to default, clear the text.', 'qtranslate') . ' ' . __('To disable this inline CSS, clear the check box.', 'qtranslate');
        ?>
</small>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        _e('Cookie Settings', 'qtranslate');
        ?>
</th>
				<td>
					<label for="disable_client_cookies"><input type="checkbox" name="disable_client_cookies" id="disable_client_cookies" value="1"<?php 
        checked($q_config['disable_client_cookies']);
        disabled($url_mode == QTX_URL_DOMAIN || $url_mode == QTX_URL_DOMAINS);
        ?>
 /> <?php 
        printf(__('Disable language client cookie "%s" (not recommended).', 'qtranslate'), QTX_COOKIE_NAME_FRONT);
        ?>
</label>
					<br />
					<small><?php 
        echo sprintf(__('Language cookie is auto-disabled for "%s" "Pre-Domain" and "Per-Domain", as language is always unambiguously defined by a url in those modes.', 'qtranslate'), __('URL Modification Mode', 'qtranslate')) . ' ' . sprintf(__('Otherwise, use this option with a caution, for simple enough sites only. If checked, the user choice of browsing language will not be saved between sessions and some AJAX calls may deliver unexpected language, as well as some undesired language switching during browsing may occur under certain themes (%sRead More%s).', 'qtranslate'), '<a href="https://qtranslatexteam.wordpress.com/2015/02/26/browser-redirection-based-on-language/" target="_blank">', '</a>');
        ?>
</small>
					<br /><br />
					<label for="use_secure_cookie"><input type="checkbox" name="use_secure_cookie" id="use_secure_cookie" value="1"<?php 
        checked($q_config['use_secure_cookie']);
        ?>
 /><?php 
        printf(__('Make %s cookies available only through HTTPS connections.', 'qtranslate'), 'qTranslate&#8209;X');
        ?>
</label>
					<br />
					<small><?php 
        _e("Don't check this if you don't know what you're doing!", 'qtranslate');
        ?>
</small>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        _e('Update Gettext Databases', 'qtranslate');
        ?>
</th>
				<td>
					<label for="auto_update_mo"><input type="checkbox" name="auto_update_mo" id="auto_update_mo" value="1"<?php 
        checked($q_config['auto_update_mo']);
        ?>
/> <?php 
        _e('Automatically check for .mo-Database Updates of installed languages.', 'qtranslate');
        ?>
</label>
					<br/>
					<label for="update_mo_now"><input type="checkbox" name="update_mo_now" id="update_mo_now" value="1" /> <?php 
        _e('Update Gettext databases now.', 'qtranslate');
        ?>
</label>
					<br/>
					<small><?php 
        _e('qTranslate will query the Wordpress Localisation Repository every week and download the latest Gettext Databases (.mo Files).', 'qtranslate');
        ?>
</small>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        _e('Date / Time Conversion', 'qtranslate');
        ?>
</th>
				<td>
					<label><input type="radio" name="use_strftime" value="<?php 
        echo QTX_DATE;
        ?>
" <?php 
        checked($q_config['use_strftime'], QTX_DATE);
        ?>
/> <?php 
        _e('Use emulated date function.', 'qtranslate');
        ?>
</label><br/>
					<label><input type="radio" name="use_strftime" value="<?php 
        echo QTX_DATE_OVERRIDE;
        ?>
" <?php 
        checked($q_config['use_strftime'], QTX_DATE_OVERRIDE);
        ?>
/> <?php 
        _e('Use emulated date function and replace formats with the predefined formats for each language.', 'qtranslate');
        ?>
</label><br/>
					<label><input type="radio" name="use_strftime" value="<?php 
        echo QTX_STRFTIME;
        ?>
" <?php 
        checked($q_config['use_strftime'], QTX_STRFTIME);
        ?>
/> <?php 
        _e('Use strftime instead of date.', 'qtranslate');
        ?>
</label><br/>
					<label><input type="radio" name="use_strftime" value="<?php 
        echo QTX_STRFTIME_OVERRIDE;
        ?>
" <?php 
        checked($q_config['use_strftime'], QTX_STRFTIME_OVERRIDE);
        ?>
/> <?php 
        _e('Use strftime instead of date and replace formats with the predefined formats for each language.', 'qtranslate');
        ?>
</label><br/>
					<small><?php 
        _e('Depending on the mode selected, additional customizations of the theme may be needed.', 'qtranslate');
        ?>
</small>
					<?php 
        /*
        <br/><br/>
        <label><?php _e('If one of the above options "... replace formats with the predefined formats for each language" is in use, then exclude the following formats from being overridden:', 'qtranslate'); ?></label><br/>
        <input type="text" name="ex_date_formats" id="qtranxs_ex_date_formats" value="<?php echo isset($q_config['ex_date_formats']) ? implode(' ',$q_config['ex_date_formats']) : QTX_EX_DATE_FORMATS_DEFAULT; ?>" style="width:100%"><br/>
        */
        ?>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        _e('Translation of options', 'qtranslate');
        ?>
</th>
				<td>
					<label for="filter_options_mode_all"><input type="radio" name="filter_options_mode" id="filter_options_mode_all" value=<?php 
        echo '"' . QTX_FILTER_OPTIONS_ALL . '"';
        checked($q_config['filter_options_mode'], QTX_FILTER_OPTIONS_ALL);
        ?>
 /> <?php 
        _e('Filter all WordPress options for translation at front-end. It may hurt performance of the site, but ensures that all options are translated.', 'qtranslate');
        ?>
 <?php 
        _e('Starting from version 3.2.5, only options with multilingual content get filtered, which should help on performance issues.', 'qtranslate');
        ?>
</label>
					<br />
					<label for="filter_options_mode_list"><input type="radio" name="filter_options_mode" id="filter_options_mode_list" value=<?php 
        echo '"' . QTX_FILTER_OPTIONS_LIST . '"';
        checked($q_config['filter_options_mode'], QTX_FILTER_OPTIONS_LIST);
        ?>
 /> <?php 
        _e('Translate only options listed below (for experts only):', 'qtranslate');
        ?>
 </label>
					<br />
					<input type="text" name="filter_options" id="qtranxs_filter_options" value="<?php 
        echo isset($q_config['filter_options']) ? implode(' ', $q_config['filter_options']) : QTX_FILTER_OPTIONS_DEFAULT;
        ?>
" style="width:100%"><br/>
					<small><?php 
        printf(__('By default, all options are filtered to be translated at front-end for the sake of simplicity of configuration. However, for a developed site, this may cause a considerable performance degradation. Normally, there are very few options, which actually need a translation. You may simply list them above to minimize the performance impact, while still getting translations needed. Options names must match the field "%s" of table "%s" of WordPress database. A minimum common set of option, normally needed a translation, is already entered in the list above as a default example. Option names in the list may contain wildcard with symbol "%s".', 'qtranslate'), 'option_name', 'options', '%');
        ?>
</small>
				</td>
			</tr>
			<tr valign="top" id="option_editor_mode">
				<th scope="row"><?php 
        _e('Editor Mode', 'qtranslate');
        ?>
</th>
				<td>
					<label for="qtranxs_editor_mode_lsb"><input type="radio" name="editor_mode" id="qtranxs_editor_mode_lsb" value="<?php 
        echo QTX_EDITOR_MODE_LSB;
        ?>
"<?php 
        checked($q_config['editor_mode'], QTX_EDITOR_MODE_LSB);
        ?>
/>&nbsp;<?php 
        _e('Use Language Switching Buttons (LSB).', 'qtranslate');
        ?>
</label><br/>
					<small><?php 
        echo __('This is the default mode.', 'qtranslate') . ' ' . __('Pages with translatable fields have Language Switching Buttons, which control what language is being edited, while admin language stays the same.', 'qtranslate');
        ?>
</small><br/><br/>
					<label for="qtranxs_editor_mode_raw"><input type="radio" name="editor_mode" id="qtranxs_editor_mode_raw" value="<?php 
        echo QTX_EDITOR_MODE_RAW;
        ?>
"<?php 
        checked($q_config['editor_mode'], QTX_EDITOR_MODE_RAW);
        ?>
/>&nbsp;<?php 
        _e('Editor Raw Mode', 'qtranslate');
        ?>
. <?php 
        _e('Do not use Language Switching Buttons to edit multi-language text entries.', 'qtranslate');
        ?>
</label><br/>
					<small><?php 
        _e('Some people prefer to edit the raw entries containing all languages together separated by language defining tags, as they are stored in database.', 'qtranslate');
        ?>
</small><br/><br/>
					<label for="qtranxs_editor_mode_single"><input type="radio" name="editor_mode" id="qtranxs_editor_mode_single" value="<?php 
        echo QTX_EDITOR_MODE_SINGLGE;
        ?>
"<?php 
        checked($q_config['editor_mode'], QTX_EDITOR_MODE_SINGLGE);
        ?>
/>&nbsp;<?php 
        echo __('Single Language Mode.', 'qtranslate') . ' ' . __('The language edited is the same as admin language.', 'qtranslate');
        ?>
</label><br/>
					<small><?php 
        echo __('Edit language cannot be switched without page re-loading. Try this mode, if some of the advanced translatable fields do not properly respond to the Language Switching Buttons due to incompatibility with a plugin, which severely alters the default WP behaviour. This mode is the most compatible with other themes and plugins.', 'qtranslate') . ' ' . __('One may find convenient to use the default Editor Mode, while remembering not to switch edit languages on custom advanced translatable fields, where LSB do not work.', 'qtranslate');
        ?>
</small>
				</td>
			</tr>
			<?php 
        $options = qtranxf_fetch_file_selection(dirname(__FILE__) . '/css/opLSBStyle');
        if ($options) {
            ?>
			<tr valign="top" id="option_lsb_style">
				<th scope="row"><?php 
            _e('LSB Style', 'qtranslate');
            ?>
</th>
				<td>
					<fieldset>
						<legend class="hidden"><?php 
            _e('LSB Style', 'qtranslate');
            ?>
</legend>
						<label><?php 
            printf(__('Choose CSS style for how Language Switching Buttons are rendered:', 'qtranslate'));
            ?>
</label>
						<br/><?php 
            printf(__('LSB %s-wrap classes:', 'qtranslate'), 'ul');
            ?>
&nbsp;<input type="text" name="lsb_style_wrap_class" id="lsb_style_wrap_class" value="<?php 
            echo $q_config['lsb_style_wrap_class'];
            ?>
" size="50" >
						<br/><?php 
            _e('Active button class:', 'qtranslate');
            ?>
&nbsp;<input type="text" name="lsb_style_active_class" id="lsb_style_active_class" value="<?php 
            echo $q_config['lsb_style_active_class'];
            ?>
" size="40" >
						<br/><small><?php 
            _e('The above is reset to an appropriate default, if the below is changed.', 'qtranslate');
            ?>
</small>
						<br/><?php 
            _e('CSS set:', 'qtranslate');
            ?>
&nbsp;<select name="lsb_style" id="lsb_style"><?php 
            foreach ($options as $nm => $val) {
                echo '<option value="' . $val . '"' . selected($val, $q_config['lsb_style']) . '>' . $nm . '</option>';
            }
            echo '<option value="custom"' . selected('custom', $q_config['lsb_style']) . '>' . __('Use custom CSS', 'qtranslate') . '</option>';
            ?>
</select>
						<br/><small><?php 
            printf(__('Choice "%s" disables this option and allows one to use its own custom CSS provided by other means.', 'qtranslate'), __('Use custom CSS', 'qtranslate'));
            ?>
</small>
					</fieldset>
				</td>
			</tr>
			<?php 
        }
        ?>
			<tr valign="top" id="option_highlight_mode">
				<?php 
        $highlight_mode = $q_config['highlight_mode'];
        // reset default custom CSS when the field is empty, or when the "custom" option is not checked
        if (empty($q_config['highlight_mode_custom_css']) || $highlight_mode != QTX_HIGHLIGHT_MODE_CUSTOM_CSS) {
            $highlight_mode_custom_css = qtranxf_get_admin_highlight_css($highlight_mode);
        } else {
            $highlight_mode_custom_css = $q_config['highlight_mode_custom_css'];
        }
        ?>
				<th scope="row"><?php 
        _e('Highlight Style', 'qtranslate');
        ?>
</th>
				<td>
					<p><?php 
        _e('When there are many integrated or customized translatable fields, it may become confusing to know which field has multilingual value. The highlighting of translatable fields may come handy then:', 'qtranslate');
        ?>
</p>
					<fieldset>
						<legend class="hidden"><?php 
        _e('Highlight Style', 'qtranslate');
        ?>
</legend>
						<label title="<?php 
        _e('Do not highlight the translatable fields.', 'qtranslate');
        ?>
">
							<input type="radio" name="highlight_mode" value="<?php 
        echo QTX_HIGHLIGHT_MODE_NONE;
        ?>
" <?php 
        checked($highlight_mode, QTX_HIGHLIGHT_MODE_NONE);
        ?>
 />
							<?php 
        _e('Do not highlight the translatable fields.', 'qtranslate');
        ?>
						</label><br/>
						<label title="<?php 
        _e('Show a line on the left border of translatable fields.', 'qtranslate');
        ?>
">
							<input type="radio" name="highlight_mode" value="<?php 
        echo QTX_HIGHLIGHT_MODE_LEFT_BORDER;
        ?>
" <?php 
        checked($highlight_mode, QTX_HIGHLIGHT_MODE_LEFT_BORDER);
        ?>
 />
							<?php 
        _e('Show a line on the left border of translatable fields.', 'qtranslate');
        ?>
						</label><br/>
						<label title="<?php 
        _e('Draw a border around translatable fields.', 'qtranslate');
        ?>
">
							<input type="radio" name="highlight_mode" value="<?php 
        echo QTX_HIGHLIGHT_MODE_BORDER;
        ?>
" <?php 
        checked($highlight_mode, QTX_HIGHLIGHT_MODE_BORDER);
        ?>
 />
							<?php 
        _e('Draw a border around translatable fields.', 'qtranslate');
        ?>
						</label><br/>
						<label title="<?php 
        _e('Use custom CSS', 'qtranslate');
        ?>
">
							<input type="radio" name="highlight_mode" value="<?php 
        echo QTX_HIGHLIGHT_MODE_CUSTOM_CSS;
        ?>
" <?php 
        checked($highlight_mode, QTX_HIGHLIGHT_MODE_CUSTOM_CSS);
        ?>
/>
							<?php 
        echo __('Use custom CSS', 'qtranslate') . ':';
        ?>
						</label><br/>
					</fieldset><br />
					<textarea id="highlight_mode_custom_css" name="highlight_mode_custom_css" style="width:100%"><?php 
        echo esc_textarea($highlight_mode_custom_css);
        ?>
</textarea>
					<br />
					<small><?php 
        echo __('To reset to default, clear the text.', 'qtranslate') . ' ';
        printf(__('The color in use is taken from your profile option %s, the third color.', 'qtranslate'), '"<a href="' . admin_url('/profile.php') . '">' . qtranxf_translate_wp('Admin Color Scheme') . '</a>"');
        ?>
</small>
				</td>
			</tr>
<?php 
        /*
        			<tr>
        				<th scope="row"><?php _e('Debugging Information', 'qtranslate');?></th>
        				<td>
        					<p><?php printf(__('If you encounter any problems and you are unable to solve them yourself, you can visit the <a href="%s">Support Forum</a>. Posting the following Content will help other detect any misconfigurations.', 'qtranslate'), 'https://wordpress.org/support/plugin/qtranslate-x'); ?></p>
        					<textarea readonly="readonly" id="qtranxs_debug"><?php
        						$q_config_copy = $q_config;
        						// remove information to keep data anonymous and other not needed things
        						unset($q_config_copy['url_info']);
        						unset($q_config_copy['js']);
        						unset($q_config_copy['windows_locale']);
        						//unset($q_config_copy['pre_domain']);
        						unset($q_config_copy['term_name']);
        						echo htmlspecialchars(print_r($q_config_copy, true));
        					?></textarea>
        				</td>
        			</tr>
        */
        ?>
		</table>
	<?php 
        qtranxf_admin_section_end('advanced');
        ?>
	<?php 
        qtranxf_admin_section_start(__('Custom Integration', 'qtranslate'), 'integration');
        ?>
		<table class="form-table">
			<tr valign="top">
				<th scope="row"><?php 
        echo __('Custom Fields', 'qtranslate');
        ?>
</th>
				<td>
					<?php 
        printf(__('Enter "%s" or "%s" attribute of text fields from your theme, which you wish to translate. This applies to post, page and media editors (%s). To lookup "%s" or "%s", right-click on the field in the post or the page editor and choose "%s". Look for an attribute of the field named "%s" or "%s". Enter it below, as many as you need, space- or comma-separated. After saving configuration, these fields will start responding to the language switching buttons, and you can enter different text for each language. The input fields of type %s will be parsed using %s syntax, while single line text fields will use %s syntax. If you need to override this behaviour, prepend prefix %s or %s to the name of the field to specify which syntax to use. For more information, read %sFAQ%s.', 'qtranslate'), 'id', 'class', '/wp-admin/post*', 'id', 'class', _x('Inspect Element', 'browser option', 'qtranslate'), 'id', 'class', '\'textarea\'', esc_html('<!--:-->'), '[:]', '\'<\'', '\'[\'', '<a href="https://wordpress.org/plugins/qtranslate-x/faq/">', '</a>');
        ?>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row" style="text-align: right">id</th>
				<td>
					<input type="text" name="custom_fields" id="qtranxs_custom_fields" value="<?php 
        echo implode(' ', $q_config['custom_fields']);
        ?>
" style="width:100%"><br/>
					<small><?php 
        _e('The value of "id" attribute is normally unique within one page, otherwise the first field found, having an id specified, is picked up.', 'qtranslate');
        ?>
</small>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row" style="text-align: right">class</th>
				<td>
					<input type="text" name="custom_field_classes" id="qtranxs_custom_field_classes" value="<?php 
        echo implode(' ', $q_config['custom_field_classes']);
        ?>
" style="width:100%"><br/>
					<small><?php 
        printf(__('All the fields of specified classes will respond to Language Switching Buttons. Be careful not to include a class, which would affect language-neutral fields. If you cannot uniquely identify a field needed neither by %s, nor by %s attribute, report the issue on %sSupport Forum%s', 'qtranslate'), '"id"', '"class"', '<a href="https://wordpress.org/support/plugin/qtranslate-x">', '</a>');
        ?>
</small>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        echo __('Custom Filters', 'qtranslate');
        ?>
</th>
				<td>
					<input type="text" name="text_field_filters" id="qtranxs_text_field_filters" value="<?php 
        echo implode(' ', $q_config['text_field_filters']);
        ?>
" style="width:100%"><br/>
					<small><?php 
        printf(__('Names of filters (which are enabled on theme or other plugins via %s function) to add translation to. For more information, read %sFAQ%s.', 'qtranslate'), 'apply_filters()', '<a href="https://wordpress.org/plugins/qtranslate-x/faq/">', '</a>');
        ?>
</small>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        echo __('Custom Admin Pages', 'qtranslate');
        ?>
</th>
				<td><input type="text" name="custom_pages" id="qtranxs_custom_pages" value="<?php 
        echo implode(' ', $q_config['custom_pages']);
        ?>
" style="width:100%"><br/>
					<small><?php 
        printf(__('List the custom admin page paths for which you wish Language Switching Buttons to show up. The Buttons will then control fields configured in "Custom Fields" section. You may only include part of the full URL after %s, including a distinctive query string if needed. As many as desired pages can be listed space/comma separated. For more information, read %sFAQ%s.', 'qtranslate'), '/wp-admin/', '<a href="https://wordpress.org/plugins/qtranslate-x/faq/">', '</a>');
        ?>
</small>
				</td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
        _e('Compatibility Functions', 'qtranslate');
        ?>
</th>
				<td>
					<label for="qtranxs_qtrans_compatibility"><input type="checkbox" name="qtrans_compatibility" id="qtranxs_qtrans_compatibility" value="1"<?php 
        checked($q_config['qtrans_compatibility']);
        ?>
/>&nbsp;<?php 
        printf(__('Enable function name compatibility (%s).', 'qtranslate'), 'qtrans_convertURL, qtrans_generateLanguageSelectCode, qtrans_getLanguage, qtrans_getLanguageName, qtrans_getSortedLanguages, qtrans_join, qtrans_split, qtrans_use, qtrans_useCurrentLanguageIfNotFoundShowAvailable, qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage, qtrans_useDefaultLanguage, qtrans_useTermLib');
        ?>
</label><br/>
					<small><?php 
        printf(__('Some plugins and themes use direct calls to the functions listed, which are defined in former %s plugin and some of its forks. Turning this flag on will enable those function to exists, which will make the dependent plugins and themes to work. WordPress policy prohibits to define functions with the same names as in other plugins, since it generates user-unfriendly fatal errors, when two conflicting plugins are activated simultaneously. Before turning this option on, you have to make sure that there are no other plugins active, which define those functions.', 'qtranslate'), '<a href="https://wordpress.org/plugins/qtranslate/" target="_blank">qTranslate</a>');
        ?>
</small>
				</td>
			</tr>
			<?php 
        /* if ( defined( 'WPB_VC_VERSION' ) ) { ?>
        			<tr valign="top">
        				<th scope="row"><?php _e('3rd-party plugins', 'qtranslate') ?></th>
        				<td><?php _e('Below is a list of plugins which have a way to auto-integrate with qTranslate-X.', 'qtranslate') ?>
        				</td>
        			</tr>
        			<tr valign="top">
        				<th scope="row" style="text-align: right"><a href="http://vc.wpbakery.com/" target="_blank">WPBakery Visual Composer</a></th>
        				<td>
        					<label for="plugin_js_composer"><input type="checkbox" name="plugin_js_composer" id="plugin_js_composer" value="1"<?php checked(!(isset($q_config['plugin_js_composer_off']) && $q_config['plugin_js_composer_off'])); ?>/>&nbsp;<?php printf(__('Enable built-in integration for "%s".', 'qtranslate'), 'WPBakery Visual Composer'); echo ' '.__('Experimental feature.', 'qtranslate'); ?></label>
        					<p><small><?php printf(__('If %s implements its own integration, this will need to be turned off.', 'qtranslate'), 'WPBakery'); ?></small></p>
        				</td>
        			</tr>
        			<?php } */
        ?>
		</table>
	<?php 
        qtranxf_admin_section_end('integration');
        do_action('qtranslate_configuration', $clean_uri);
        ?>
	</form>

</div>
<div class="wrap">

<?php 
        qtranxf_admin_section_start(__('Languages', 'qtranslate'), 'languages');
        //id="qtranslate-admin-languages"
        ?>
<div id="col-container">

<div id="col-right">
<div class="col-wrap">
<h3><?php 
        _e('List of Configured Languages', 'qtranslate');
        ?>
</h3>
<p><small><?php 
        $language_names = qtranxf_language_configured('language_name');
        $flags = qtranxf_language_configured('flag');
        //$windows_locales = qtranxf_language_configured('windows_locale');
        printf(__('Only enabled languages are loaded at front-end, while all %d configured languages are listed here.', 'qtranslate'), count($language_names));
        echo ' ';
        _e('The table below contains both pre-defined and manually added or modified languages.', 'qtranslate');
        echo ' ';
        printf(__('You may %s or %s a language, or %s manually added language, or %s previous modifications of a pre-defined language.', 'qtranslate'), '"' . __('Enable', 'qtranslate') . '"', '"' . __('Disable', 'qtranslate') . '"', '"' . __('Delete', 'qtranslate') . '"', '"' . __('Reset', 'qtranslate') . '"');
        echo ' ';
        printf(__('Click %s to modify language properties.', 'qtranslate'), '"' . __('Edit', 'qtranslate') . '"');
        ?>
</small></p>
<table class="widefat">
	<thead>
	<tr>
<?php 
        print_column_headers('language');
        ?>
	</tr>
	</thead>

	<tfoot>
	<tr>
<?php 
        print_column_headers('language', false);
        ?>
	</tr>
	</tfoot>

	<tbody id="the-list" class="qtranxs-language-list" class="list:cat">
<?php 
        $languages_stored = get_option('qtranslate_language_names', array());
        $languages_predef = qtranxf_default_language_name();
        $flag_location_url = qtranxf_flag_location();
        $flag_location_dir = trailingslashit(WP_CONTENT_DIR) . $q_config['flag_location'];
        $flag_location_dir_def = dirname(QTRANSLATE_FILE) . '/flags/';
        $flag_location_url_def = trailingslashit(WP_CONTENT_URL) . '/plugins/' . basename(dirname(QTRANSLATE_FILE)) . '/flags/';
        foreach ($language_names as $lang => $language) {
            if ($lang == 'code') {
                continue;
            }
            $flag = $flags[$lang];
            if (file_exists($flag_location_dir . $flag)) {
                $flag_url = $flag_location_url . $flag;
            } else {
                $flag_url = $flag_location_url_def . $flag;
            }
            ?>
	<tr>
		<td><?php 
            echo $lang;
            ?>
</td>
		<td><img src="<?php 
            echo $flag_url;
            ?>
" alt="<?php 
            echo sprintf(__('%s Flag', 'qtranslate'), $language);
            ?>
"></td>
		<td><?php 
            echo $language;
            ?>
</td>
		<td><?php 
            if (in_array($lang, $q_config['enabled_languages'])) {
                if ($q_config['default_language'] == $lang) {
                    _e('Default', 'qtranslate');
                } else {
                    ?>
<a class="edit" href="<?php 
                    echo $clean_uri;
                    ?>
&disable=<?php 
                    echo $lang;
                    ?>
"><?php 
                    _e('Disable', 'qtranslate');
                    ?>
</a><?php 
                }
            } else {
                ?>
<a class="edit" href="<?php 
                echo $clean_uri;
                ?>
&enable=<?php 
                echo $lang;
                ?>
"><?php 
                _e('Enable', 'qtranslate');
                ?>
</a><?php 
            }
            ?>
</td>
		<td><a class="edit" href="<?php 
            echo $clean_uri;
            ?>
&edit=<?php 
            echo $lang;
            ?>
"><?php 
            _e('Edit', 'qtranslate');
            ?>
</a></td>
		<td><?php 
            if (!isset($languages_stored[$lang])) {
                _e('Pre-Defined', 'qtranslate');
            } else {
                ?>
<a class="delete" href="<?php 
                echo $clean_uri;
                ?>
&delete=<?php 
                echo $lang;
                ?>
"><?php 
                if (isset($languages_predef[$lang])) {
                    _e('Reset', 'qtranslate');
                } else {
                    _e('Delete', 'qtranslate');
                }
                ?>
</a><?php 
            }
            ?>
</td>
	</tr>
<?php 
        }
        /*
        <td><?php if($q_config['default_language']==$lang){ _e('Default', 'qtranslate'); } else { ?><a class="delete" href="<?php echo $clean_uri; ?>&delete=<?php echo $lang; ?>"><?php _e('Delete', 'qtranslate'); ?></a><?php } ?></td>
        */
        ?>
	</tbody>
</table>
<p><?php 
        _e('Enabling a language will cause qTranslate to update the Gettext-Database for the language, which can take a while depending on your server\'s connection speed.', 'qtranslate');
        ?>
</p>
</div>
</div><!-- /col-right -->

<div id="col-left">
<div class="col-wrap">
<div class="form-wrap">
<h3><?php 
        _e('Add Language', 'qtranslate');
        ?>
</h3>
<form name="addcat" id="addcat" method="post" class="add:the-list: validate">
<?php 
        qtranxf_language_form($language_code, $language_code, $language_name, $language_locale, $language_date_format, $language_time_format, $language_flag, $language_na_message, $language_default);
        ?>
<p class="submit"><input type="submit" name="submit" value="<?php 
        _e('Add Language &raquo;', 'qtranslate');
        ?>
" /></p>
</form></div>
</div>
</div><!-- /col-left -->

</div><!-- /col-container -->
</div><!-- /qtranslate-admin-languages in qtranxf_admin_section_start -->
<script type="text/javascript">
//<![CDATA[
	qtranxj_readShowHideCookie('qtranslate-admin-languages');
// ]]>
</script>
</div><!-- /wrap -->
<?php 
    }
}
예제 #17
0
    public function display()
    {
        global $wpdb;
        //not to sure if we still need these any more - $form_types, $unique_names
        $form_types = get_option('wpsc_checkout_form_fields');
        $unique_names = get_option('wpsc_checkout_unique_names');
        do_action('wpsc_checkout_form_fields_page');
        ?>

		<div class='metabox-holder' style='width:95%;'>
			<div class='postbox'>
				<input type='hidden' name='checkout_submits' value='true' />
				<h3 class='hndle'><?php 
        _e('Misc Checkout Options', 'wpsc');
        ?>
</h3>
				<div class='inside'>
					<table>
						<tr>
							<td><?php 
        _e('Users must register before checking out', 'wpsc');
        ?>
:</td>
							<td>
							<input type='radio' value='1' name='wpsc_options[require_register]' id='require_register1' <?php 
        checked($this->require_register, 1);
        ?>
 />
							<label for='require_register1'><?php 
        _e('Yes', 'wpsc');
        ?>
</label> &nbsp;
							<input type='radio' value='0' name='wpsc_options[require_register]' id='require_register2' <?php 
        checked($this->require_register, 0);
        ?>
 />
							<label for='require_register2'><?php 
        _e('No', 'wpsc');
        ?>
</label>
							</td>
							<td>
							<a title='<?php 
        _e('If yes then you must also turn on the wordpress option "Any one can register"', 'wpsc');
        ?>
' class='flag_email' href='#' ><img src='<?php 
        echo WPSC_CORE_IMAGES_URL;
        ?>
/help.png' alt='' /> </a>
							</td>
						</tr>

						<tr>
							<td scope="row"><?php 
        _e('Enable Shipping Same as Billing Option', 'wpsc');
        ?>
:</td>
							<td>
								<input type='radio' value='1' name='wpsc_options[shippingsameasbilling]' id='shippingsameasbilling1' <?php 
        checked($this->shipping_same_as_billing, 1);
        ?>
 />
								<label for='shippingsameasbilling1'><?php 
        _e('Yes', 'wpsc');
        ?>
</label> &nbsp;
								<input type='radio' value='0' name='wpsc_options[shippingsameasbilling]' id='shippingsameasbilling2' <?php 
        checked($this->shipping_same_as_billing, 0);
        ?>
 />
								<label for='shippingsameasbilling2'><?php 
        _e('No', 'wpsc');
        ?>
</label>
							</td>
						</tr>
						<tr>
							<td><?php 
        _e('Force users to use SSL', 'wpsc');
        ?>
:</td>
							<td>
								<input type='radio' value='1' name='wpsc_options[wpsc_force_ssl]' id='wpsc_force_ssl1' <?php 
        checked($this->force_ssl, 1);
        ?>
 />
								<label for='wpsc_force_ssl1'><?php 
        _e('Yes', 'wpsc');
        ?>
</label> &nbsp;
								<input type='radio' value='0' name='wpsc_options[wpsc_force_ssl]' id='wpsc_force_ssl2' <?php 
        checked($this->force_ssl, 0);
        ?>
 />
								<label for='wpsc_force_ssl2'><?php 
        _e('No', 'wpsc');
        ?>
</label>
							</td>
							<td>
								<a title='<?php 
        _e('This can cause warnings for your users if you do not have a properly configured SSL certificate', 'wpsc');
        ?>
' class='flag_email' href='#' ><img src='<?php 
        echo WPSC_CORE_IMAGES_URL;
        ?>
/help.png' alt='' /> </a>
							</td>
						</tr>
					</table>
				</div>
			</div>
		</div>

		<h3><?php 
        _e('Form Fields', 'wpsc');
        ?>
</h3>
		<p><?php 
        _e('Here you can customise the forms to be displayed in your checkout page. The checkout page is where you collect important user information that will show up in your purchase logs i.e. the buyers address, and name...', 'wpsc');
        ?>
</p>

		<p>
			<label for='wpsc_form_set'><?php 
        _e('Select a Form Set', 'wpsc');
        ?>
:</label>
			<select id='wpsc_form_set' name='checkout_set'>
				<?php 
        foreach ($this->checkout_sets as $key => $value) {
            ?>
					<option <?php 
            selected($this->current_checkout_set, $key);
            ?>
 value="<?php 
            echo esc_attr($key);
            ?>
"><?php 
            echo esc_html($value);
            ?>
</option>
				<?php 
        }
        ?>
			</select>
			<input type='submit' value='<?php 
        esc_attr_e('Filter', 'wpsc');
        ?>
' name='wpsc_checkout_set_filter' class='button-secondary' />
			<a href='#' class='add_new_form_set'><?php 
        esc_html_e("+ Add New Form Set", 'wpsc');
        ?>
</a>
		</p>

		<p class='add_new_form_set_forms'>
			<label><?php 
        esc_html_e("Add new Form Set", 'wpsc');
        ?>
:
			<input type="text" value="" name="new_form_set" /></label>
			<input type="submit" value="<?php 
        _e('Add', 'wpsc');
        ?>
" class="button-secondary" id="formset-add-sumbit"/>
		</p>

		<input type="hidden" name="selected_form_set" value="<?php 
        echo esc_attr($this->current_checkout_set);
        ?>
" />

		<table id="wpsc_checkout_list" class="widefat page fixed"  cellspacing="0">
			<thead>
				<tr>
					<?php 
        print_column_headers('display-checkout-list');
        ?>
				</tr>
			</thead>

			<tfoot>
				<tr>
					<?php 
        print_column_headers('display-checkout-list', false);
        ?>
				</tr>
			</tfoot>

			<tbody id='wpsc_checkout_list_body'>
				<?php 
        if (empty($this->form_fields)) {
            ?>
					<?php 
            $this->prototype_field('new');
            ?>
				<?php 
        } else {
            ?>
					<?php 
            foreach ($this->form_fields as $form_field) {
                ?>
						<tr data-field-id="<?php 
                echo esc_attr($form_field->id);
                ?>
" id="checkout_<?php 
                echo esc_attr($form_field->id);
                ?>
" class="checkout_form_field">
							<td class="drag">
								<div class="cell-wrapper">
									<a title="<?php 
                esc_attr_e('Click and Drag to Order Checkout Fields', 'wpsc');
                ?>
">
										<img src="<?php 
                echo esc_url(WPSC_CORE_IMAGES_URL . '/drag.png');
                ?>
" />
									</a>
									<img src="<?php 
                echo esc_url(admin_url('images/wpspin_light.gif'));
                ?>
" class="ajax-feedback" title="" alt="" />
								</div>
							</td>
							<td class="namecol">
								<div class="cell-wrapper">
									<input type="text" name="form_name[<?php 
                echo esc_attr($form_field->id);
                ?>
]" value="<?php 
                echo esc_attr($form_field->name);
                ?>
" />
									<a
										class="edit-options" href="#"
										<?php 
                if (in_array($form_field->type, array('select', 'radio', 'checkbox'))) {
                    echo 'style="display:inline;"';
                }
                ?>
									><?php 
                esc_html_e('Edit Options', 'wpsc');
                ?>
</a>
								</div>
							</td>
							<td class="typecol">
								<div class="cell-wrapper">
									<?php 
                if ($this->is_field_default($form_field)) {
                    ?>
										<strong><?php 
                    echo esc_html($form_field->type);
                    ?>
</strong>
									<?php 
                } else {
                    ?>
										<select name="form_type[<?php 
                    echo esc_attr($form_field->id);
                    ?>
]">
											<?php 
                    foreach ($this->field_types as $label => $name) {
                        ?>
												<option <?php 
                        selected($form_field->type, $name);
                        ?>
 value="<?php 
                        echo esc_attr($name);
                        ?>
"><?php 
                        echo esc_html($label);
                        ?>
</option>
											<?php 
                    }
                    ?>
										</select>
										<?php 
                    $field_options = unserialize($form_field->options);
                    if (empty($field_options)) {
                        $field_options = array();
                    }
                    $i = 0;
                    foreach ($field_options as $label => $value) {
                        $i++;
                        ?>
											<input type="hidden" name="form_options[<?php 
                        echo esc_attr($form_field->id);
                        ?>
][label][]" value="<?php 
                        echo esc_attr($label);
                        ?>
" />
											<input type="hidden" name="form_options[<?php 
                        echo esc_attr($form_field->id);
                        ?>
][value][]" value="<?php 
                        echo esc_attr($value);
                        ?>
" />
										<?php 
                    }
                    ?>
									<?php 
                }
                ?>
								</div>
							</td>

							<td class="uniquenamecol">
								<div class="cell-wrapper">
								<?php 
                if ($form_field->type != 'heading' && !empty($form_field->unique_name)) {
                    ?>
									<small><?php 
                    echo esc_html($form_field->unique_name);
                    ?>
</small>
								<?php 
                }
                ?>
								</div>
							</td>
							<td class="displaycol">
								<div class="cell-wrapper">
									<input <?php 
                checked($form_field->active, 1);
                ?>
 type="checkbox" name="form_display[<?php 
                echo esc_attr($form_field->id);
                ?>
]" value="1" />
								</div>
							</td>
							<td class="mandatorycol">
								<div class="cell-wrapper">
									<?php 
                if ($form_field->type != 'heading') {
                    ?>
										<input <?php 
                    checked($form_field->mandatory, 1);
                    ?>
 type="checkbox" name="form_mandatory[<?php 
                    echo esc_attr($form_field->id);
                    ?>
]" value="1" />
									<?php 
                }
                ?>
								</div>
							</td>
							<td class="actionscol">
								<div class="cell-wrapper">
									<?php 
                if (!$this->is_field_default($form_field)) {
                    ?>
										<a tabindex="-1" title="<?php 
                    _e('Delete Field', 'wpsc');
                    ?>
" class="action delete" href="#">Delete</a>
									<?php 
                } else {
                    ?>
										<span title="<?php 
                    _e('Cannot Delete Default Fields', 'wpsc');
                    ?>
" class="action delete">Delete</span>
									<?php 
                }
                ?>
									<a tabindex="-1" title="<?php 
                _e('Add Field', 'wpsc');
                ?>
" class="action add" href="#">Add</a>
								</div>
							</td>
						</tr>
					<?php 
            }
            ?>
				<?php 
        }
        ?>
				<?php 
        $this->prototype_field();
        ?>
			</tbody>
		</table>
	<?php 
    }
예제 #18
0
    private function do_manage_taxonomies_page()
    {
        $taxonomy_names = $this->get_taxonomies();
        ?>
		<div class="wrap">
			<?php 
        screen_icon('taxonomy');
        ?>
			<h2>
				<?php 
        _e("Edit Taxonomies");
        ?>
  
				<a href="<?php 
        echo $this->get_add_taxonomy_url();
        ?>
" class="button add-new-h2"><?php 
        _e('Add New');
        ?>
</a> 
			</h2>
			<?php 
        if (!empty($_REQUEST['notice'])) {
            ?>
				<div id="message" class="updated fade"><p><strong><?php 
            echo stripslashes($_REQUEST['notice']);
            ?>
</strong></div>
			<?php 
        }
        ?>
		
			<?php 
        if (count($taxonomy_names)) {
            ?>
	
				<form id="posts-filter" action="<?php 
            $this->get_manage_taxonomies_url();
            ?>
" method="post">
					<div class="tablenav">
						<div class="alignleft actions">
							<select name="action">
								<option value="" selected="selected"><?php 
            _e('Bulk Actions');
            ?>
</option>
								<option value="bulk-delete"><?php 
            _e('Delete');
            ?>
</option>
							</select>
							<input type="submit" value="<?php 
            esc_attr_e('Apply');
            ?>
" name="doaction" id="doaction" class="button-secondary action" />
							<?php 
            wp_nonce_field('bulk-action');
            ?>
						</div>
						<br class="clear" />
					</div>
					<table class="widefat fixed" cellspacing="0">
						<thead>
							<tr class="thead">
								<?php 
            print_column_headers('dynamic_taxonomy');
            ?>
							</tr>
						</thead>
						<tfoot>
							<tr class="thead">
								<?php 
            print_column_headers('dynamic_taxonomy', false);
            ?>
							</tr>
						</tfoot>
						<tbody id="taxonomies" class="list:taxonomies taxonomy-list">
							<?php 
            $style = '';
            ?>
							<?php 
            foreach ($taxonomy_names as $taxonomy_name) {
                ?>
								<?php 
                $style = ' class="alternate"' == $style ? '' : ' class="alternate"';
                ?>
								<?php 
                echo "\n\t" . $this->dynamic_taxonomy_row($taxonomy_name, $style);
                ?>
							<?php 
            }
            ?>
						</tbody>
					</table>
					<div class="tablenav">
						<div class="alignleft actions">
							<select name="action2">
								<option value="" selected="selected"><?php 
            _e('Bulk Actions');
            ?>
</option>
								<option value="delete"><?php 
            _e('Delete');
            ?>
</option>
							</select>
							<input type="submit" value="<?php 
            esc_attr_e('Apply');
            ?>
" name="doaction2" id="doaction2" class="button-secondary action" />
						</div>
						<br class="clear" />
					</div>
				</form>
			<?php 
        } else {
            ?>
				<p><?php 
            printf(__('There are currently no custom taxonomies created.  <a href="%s">Create One</a></p>'), $this->get_add_taxonomy_url());
            ?>
</p>
			<?php 
        }
        ?>
		</div>
		<br class="clear" />
		<?php 
    }
<div class="clear"></div>

<table class="widefat fixed" cellspacing="0">
	<thead>
	<tr>
<?php 
print_column_headers('edit-link-categories');
?>
	</tr>
	</thead>

	<tfoot>
	<tr>
<?php 
print_column_headers('edit-link-categories', false);
?>
	</tr>
	</tfoot>

	<tbody id="the-list" class="list:link-cat">
<?php 
$start = ($pagenum - 1) * $catsperpage;
$args = array('offset' => $start, 'number' => $catsperpage, 'hide_empty' => 0);
if (!empty($_GET['s'])) {
    $args['search'] = $_GET['s'];
}
$categories = get_terms('link_category', $args);
if ($categories) {
    $output = '';
    foreach ($categories as $category) {
예제 #20
0
					<div id="end-position" class="calendar-wrap"><input type="text" id="end" name="end" value="<?php echo $enddate; ?>" size="10" class="search-input selectall" /></div>
				</div>
				<button type="submit" id="filter-button" name="filter" value="customers" class="button-secondary"><?php _e('Filter','Ecart'); ?></button>
			</div>
			</div>
			<?php if ($page_links) echo "<div class='tablenav-pages'>$page_links</div>"; ?>
		<div class="clear"></div>
	</div>
	<div class="clear"></div>

	<table class="widefat" cellspacing="0">
		<thead>
		<tr><?php print_column_headers('ecart_page_ecart-customers'); ?></tr>
		</thead>
		<tfoot>
		<tr><?php print_column_headers('ecart_page_ecart-customers',false); ?></tr>
		</tfoot>
	<?php if (sizeof($Customers) > 0): ?>
		<tbody id="customers-table" class="list orders">
		<?php
			$hidden = get_hidden_columns('ecart_page_ecart-customers');

			$even = false;
			foreach ($Customers as $Customer):
			$CustomerName = (empty($Customer->firstname) && empty($Customer->lastname))?'('.__('no contact name','Ecart').')':"{$Customer->firstname} {$Customer->lastname}";
			?>
		<tr<?php if (!$even) echo " class='alternate'"; $even = !$even; ?>>
			<th scope='row' class='check-column'><input type='checkbox' name='selected[]' value='<?php echo $Customer->id; ?>' /></th>
			<td class="name column-name"><a class='row-title' href='<?php echo esc_url( add_query_arg(array('page'=>'ecart-customers','id'=>$Customer->id),admin_url('admin.php'))); ?>' title='<?php _e('Edit','Ecart'); ?> &quot;<?php echo esc_attr($CustomerName); ?>&quot;'><?php echo esc_html($CustomerName); ?></a><?php echo !empty($Customer->company)?"<br />".esc_html($Customer->company):""; ?></td>
			<td class="login column-login<?php echo in_array('login',$hidden)?' hidden':''; ?>"><?php echo esc_html($Customer->user_login); ?></td>
			<td class="email column-email<?php echo in_array('email',$hidden)?' hidden':''; ?>"><a href="mailto:<?php echo esc_attr($Customer->email); ?>"><?php echo esc_html($Customer->email); ?></a></td>
예제 #21
0
<div class="clear"></div>

<table class="widefat tag fixed" cellspacing="0">
	<thead>
	<tr>
<?php 
        print_column_headers('edit-tags');
        ?>
	</tr>
	</thead>

	<tfoot>
	<tr>
<?php 
        print_column_headers('edit-tags', false);
        ?>
	</tr>
	</tfoot>

	<tbody id="the-list" class="list:tag">
<?php 
        $searchterms = isset($_GET['s']) ? trim($_GET['s']) : '';
        $count = tag_rows($pagenum, $tags_per_page, $searchterms, $taxonomy);
        ?>
	</tbody>
</table>

<div class="tablenav">
<?php 
        if ($page_links) {
예제 #22
0
/**
 * Display comments for post.
 *
 * @since 2.8.0
 *
 * @param object $post
 */
function post_comment_meta_box($post)
{
    global $wpdb, $post_ID;
    $total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM {$wpdb->comments} WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID));
    if (1 > $total) {
        echo '<p>' . __('No comments yet.') . '</p>';
        return;
    }
    wp_nonce_field('get-comments', 'add_comment_nonce', false);
    add_filter('manage_edit-comments_columns', 'post_comment_meta_box_thead', 8, 1);
    ?>

<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
<thead><tr>
	<?php 
    print_column_headers('edit-comments');
    ?>
</tr></thead>
<tbody id="the-comment-list" class="list:comment"></tbody>
</table>
<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php 
    echo $total;
    ?>
);return false;"><?php 
    _e('Show comments');
    ?>
</a> <img class="waiting" style="display:none;" src="<?php 
    echo esc_url(admin_url('images/wpspin_light.gif'));
    ?>
" alt="" /></p>
<?php 
    $hidden = get_hidden_meta_boxes('post');
    if (!in_array('commentsdiv', $hidden)) {
        ?>
		<script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php 
        echo $total;
        ?>
, 10);});</script>
<?php 
    }
    remove_filter('manage_edit-comments_columns', 'post_comment_meta_box_thead');
    wp_comment_trashnotice();
}
function shopp_print_column_headers($type, $id = true)
{
    global $wp_version;
    if (version_compare($wp_version, "2.7.0", ">=")) {
        return print_column_headers($type, $id);
    }
    $type = str_replace('.php', '', $type);
    $columns = shopp_get_column_headers($type);
    $hidden = array();
    $styles = array();
    foreach ($columns as $column_key => $column_display_name) {
        $class = ' class="manage-column';
        $class .= " column-{$column_key}";
        if ('cb' == $column_key) {
            $class .= ' check-column';
        } elseif (in_array($column_key, array('posts', 'comments', 'links'))) {
            $class .= ' num';
        }
        $class .= '"';
        $style = '';
        if (in_array($column_key, $hidden)) {
            $style = 'display:none;';
        }
        if (isset($styles[$type]) && isset($styles[$type][$column_key])) {
            $style .= ' ' . $styles[$type][$column_key];
        }
        $style = ' style="' . $style . '"';
        ?>
	<th scope="col" <?php 
        echo $id ? "id=\"{$column_key}\"" : "";
        echo $class;
        echo $style;
        ?>
><?php 
        echo $column_display_name;
        ?>
</th>
<?php 
    }
}
예제 #24
0
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' => __('&laquo;'), 'next_text' => __('&raquo;'), '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 &#8220;%s&#8221;', '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 . '&amp;mode=edit&amp;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 . '&amp;mode=edit&amp;gid=' . $act_gid . '&amp;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">&nbsp;</th>
					<th align="left">&nbsp;</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&#8211;%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&amp;mode=recoverpic&amp;gid=" . $act_gid . "&amp;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&amp;mode=delpic&amp;gid=" . $act_gid . "&amp;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&#8211;%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');
    ?>
" />
		    		&nbsp;
		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php 
    _e("Cancel", 'nggallery');
    ?>
&nbsp;" />
		    	</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');
    ?>
&nbsp;
		    		<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');
    ?>
" />
		    		&nbsp;
		    		<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');
    ?>
" />
		    		&nbsp;
		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php 
    _e('Cancel', 'nggallery');
    ?>
&nbsp;" />
		    	</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');
    ?>
" />
		    		&nbsp;
		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php 
    _e('Cancel', 'nggallery');
    ?>
&nbsp;" />
		    	</td>
			</tr>
		</table>
		</form>
	</div>
	<!-- /#new_thumbnail -->	

	<script type="text/javascript">
	/* <![CDATA[ */
	jQuery(document).ready(function(){columns.init('nggallery-manage-images');});	
	/* ]]> */
	</script>
	<?php 
}
<div class="clear"></div>

<table class="widefat page fixed" cellspacing="0">
  <thead>
  <tr>
<?php 
    print_column_headers('edit-pages');
    ?>
  </tr>
  </thead>

  <tfoot>
  <tr>
<?php 
    print_column_headers('edit-pages', false);
    ?>
  </tr>
  </tfoot>

  <tbody>
  <?php 
    page_rows($posts, $pagenum, $per_page);
    ?>
  </tbody>
</table>

<div class="tablenav">
<?php 
    if ($page_links) {
        echo "<div class='tablenav-pages'>{$page_links_text}</div>";
예제 #26
0
function cwp_edit_post_rows($page)
{
    ?>
	<table class="widefat post fixed" cellspacing="0">
	    <thead>
	    <tr>
			<?php 
    print_column_headers('cwp_manage');
    ?>
	    </tr>
	    </thead>
	
	    <tfoot>
	    <tr>
			<?php 
    print_column_headers('cwp_manage', false);
    ?>
	    </tr>
	    </tfoot>
	
	    <tbody>
			<?php 
    cwp_post_rows($page->wp_query->posts, $page);
    ?>
	    </tbody>
	</table>
	<?php 
}
 /**
  * Begins a "widefat" WordPress table.
  * 
  * @since 1.8
  * 
  * @param $headers Array of (CSS class => Internationalized column title)
  */
 function admin_wftable_start($headers = false)
 {
     echo "\n<table class='widefat' cellspacing='0'>\n";
     if ($headers) {
         $this->table_column_headers($headers);
     } else {
         echo "\t<thead><tr>\n";
         print_column_headers($this->plugin_page_hook);
         echo "\t</tr></thead>\n";
         echo "\t<tfoot><tr>\n";
         print_column_headers($this->plugin_page_hook);
         echo "\t</tr></tfoot>\n";
     }
     echo "\t<tbody>\n";
 }
예제 #28
0
function wpsc_purchaselogs_displaylist()
{
    global $purchlogs;
    ?>
  	<form method='post' action=''>
  	  <div class='wpsc_purchaselogs_options'>
  		<select id='purchlog_multiple_status_change' name='purchlog_multiple_status_change' class='purchlog_multiple_status_change'>
  			<option value='-1'><?php 
    _e('Bulk Actions');
    ?>
</option>
  			<?php 
    while (wpsc_have_purch_items_statuses()) {
        wpsc_the_purch_status();
        ?>
 				<option value='<?php 
        echo wpsc_the_purch_status_id();
        ?>
' <?php 
        echo wpsc_is_checked_status();
        ?>
 >
 					<?php 
        echo wpsc_the_purch_status_name();
        ?>
 
 				</option>
 			<?php 
    }
    ?>
			<option value="delete"><?php 
    _e('Delete');
    ?>
</option>
  		</select>
  		<input type='hidden' value='purchlog_bulk_modify' name='wpsc_admin_action2' />
  		<input type="submit" value="<?php 
    _e('Apply');
    ?>
" name="doaction" id="doaction" class="button-secondary action" />
  		<?php 
    /* View functions for purchlogs */
    ?>
  		<label for='view_purchlogs_by'><?php 
    _e('View:');
    ?>
</label>

  		<select id='view_purchlogs_by' name='view_purchlogs_by'>
  		  <?php 
    $date_is_selected['3mnths'] = '';
    $date_is_selected['all'] = '';
    switch ($_GET['view_purchlogs_by']) {
        case '3mnths':
            $date_is_selected['3mnths'] = 'selected="selected"';
            break;
        case '':
        case 'all':
            $date_is_selected['all'] = 'selected="selected"';
            break;
    }
    ?>
  			<option value='all' <?php 
    echo $date_is_selected['all'];
    ?>
>All</option>
				<option value='3mnths' <?php 
    echo $date_is_selected['3mnths'];
    ?>
>Three Months</option>
  			<?php 
    echo wpsc_purchlogs_getfirstdates();
    ?>
  		</select>
  		<select id='view_purchlogs_by_status' name='view_purchlogs_by_status'>
  			<option value='-1'>Status: All</option>
  			<?php 
    while (wpsc_have_purch_items_statuses()) {
        wpsc_the_purch_status();
        ?>
  			<?php 
        $current_status = wpsc_the_purch_status_id();
        $is_selected = '';
        if ($_GET['view_purchlogs_by_status'] == $current_status) {
            $is_selected = 'selected="selected"';
        }
        ?>
 				<option value='<?php 
        echo $current_status;
        ?>
' <?php 
        echo $is_selected;
        ?>
 >
 					<?php 
        echo wpsc_the_purch_status_name();
        ?>
 
 				</option>
 			<?php 
    }
    ?>

  		</select>
  		<input type='hidden' value='purchlog_filter_by' name='wpsc_admin_action' />
  		<input type="submit" value="<?php 
    _e('Filter');
    ?>
" name="doaction2" id="doaction2" class="button-secondary action" />
  	</div>
  		<?php 
    if (wpsc_have_purch_items() == false) {
        ?>
  		<p style='color:red;'><?php 
        _e('Oops there are no purchase logs for your selection, please try again.');
        ?>
</p>
  		
  		<?php 
    }
    ?>
	 	<table class="widefat page fixed" cellspacing="0">
			<thead>
				<tr>
			<?php 
    print_column_headers('display-sales-list');
    ?>
				</tr>
			</thead>
		
			<tfoot>
				<tr>
			<?php 
    print_column_headers('display-sales-list', false);
    ?>
				</tr>
			</tfoot>
		
			<tbody>
			<?php 
    get_purchaselogs_content();
    ?>
			</tbody>
		</table>
		<p><strong style='float:left' ><?php 
    _e('Total:');
    ?>
</strong>  <?php 
    echo nzshpcrt_currency_display(wpsc_the_purch_total(), true);
    ?>
</p>
		<?php 
    if (!isset($purchlogs->current_start_timestamp) && !isset($purchlogs->current_end_timestamp)) {
        $purchlogs->current_start_timestamp = $purchlogs->earliest_timestamp;
        $purchlogs->current_end_timestamp = $purchlogs->current_timestamp;
    }
    $arr_params = array('wpsc_admin_action' => 'wpsc_downloadcsv', 'rss_key' => 'key', 'start_timestamp' => $purchlogs->current_start_timestamp, 'end_timestamp' => $purchlogs->current_end_timestamp);
    ?>
	
		<br />	
		<p><a class='admin_download' href='<?php 
    echo htmlentities(add_query_arg($arr_params));
    ?>
' ><img class='wpsc_pushdown_img' src='<?php 
    echo WPSC_URL;
    ?>
/images/download.gif' alt='' title='' /> <span> <?php 
    echo TXT_WPSC_DOWNLOAD_CSV;
    ?>
</span></a></p>
	</form>
	<br />
	<script type="text/javascript">
	/* <![CDATA[ */
	(function($){
		$(document).ready(function(){
			$('#doaction, #doaction2').click(function(){
				if ( $('select[name^="purchlog_multiple_status_change"]').val() == 'delete' ) {
					var m = '<?php 
    echo js_escape(__("You are about to delete the selected purchase logs.\n  'Cancel' to stop, 'OK' to delete."));
    ?>
';
					return showNotice.warn(m);
				}
			});
		});
	})(jQuery);
	//columns.init('edit');
	/* ]]> */
	</script>

<?php 
    unset($_SESSION['newlogs']);
}
예제 #29
0
function nggallery_manage_gallery_main()
{
    global $ngg, $nggdb, $wp_query;
    //Build the pagination for more than 25 galleries
    if (!isset($_GET['paged']) || $_GET['paged'] < 1) {
        $_GET['paged'] = 1;
    }
    $start = ($_GET['paged'] - 1) * 25;
    $gallerylist = $nggdb->find_all_galleries('gid', 'asc', TRUE, 25, $start, false);
    $page_links = paginate_links(array('base' => add_query_arg('paged', '%#%'), 'format' => '', 'prev_text' => __('&laquo;'), 'next_text' => __('&raquo;'), 'total' => $nggdb->paged['max_objects_per_page'], 'current' => $_GET['paged']));
    ?>
	<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('editgalleries'));
		 
		if(numchecked < 1) { 
			alert('<?php 
    echo esc_js(__('No images selected', 'nggallery'));
    ?>
');
			return false; 
		} 
		
		actionId = jQuery('#bulkaction').val();
		
		switch (actionId) {
			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 galleries \n \n 'Cancel' to stop, 'OK' to proceed.", 'nggallery')), "' + numchecked + '");
    ?>
');
	}

	function showDialog( windowId, title ) {
		var form = document.getElementById('editgalleries');
		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"); });
	}
	
	function showAddGallery() {
    	jQuery( "#addGallery").dialog({
    		width: 640,
            resizable : false,
    		modal: true,
            title: '<?php 
    echo esc_js(__('Add new gallery', 'nggallery'));
    ?>
'          
    	});	   
        jQuery("#addGallery .dialog-cancel").click(function() { jQuery( "#addGallery" ).dialog("close"); });
	}
	//-->
	</script>
	<div class="wrap">
        <?php 
    screen_icon('nextgen-gallery');
    ?>
		<h2><?php 
    echo _n('Gallery', 'Galleries', 2, 'nggallery');
    ?>
</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>
		<form id="editgalleries" class="nggform" method="POST" action="<?php 
    echo $ngg->manage_page->base_page . '&amp;paged=' . $_GET['paged'];
    ?>
" accept-charset="utf-8">
		<?php 
    wp_nonce_field('ngg_bulkgallery');
    ?>
		<input type="hidden" name="page" value="manage-galleries" />
		
		<div class="tablenav">
			
			<div class="alignleft actions">
				<?php 
    if (function_exists('json_encode')) {
        ?>
				<select name="bulkaction" id="bulkaction">
					<option value="no_action" ><?php 
        _e("Bulk actions", 'nggallery');
        ?>
</option>
					<option value="delete_gallery" ><?php 
        _e("Delete", '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="import_meta" ><?php 
        _e("Import metadata", 'nggallery');
        ?>
</option>
					<option value="recover_images" ><?php 
        _e("Recover from backup", 'nggallery');
        ?>
</option>
				</select>
				<input name="showThickbox" class="button-secondary" type="submit" value="<?php 
        _e('Apply', 'nggallery');
        ?>
" onclick="if ( !checkSelected() ) return false;" />
				<?php 
    }
    ?>
				<?php 
    if (current_user_can('NextGEN Upload images') && nggGallery::current_user_can('NextGEN Add new gallery')) {
        ?>
					<input name="doaction" class="button-secondary action" type="submit" onclick="showAddGallery(); return false;" value="<?php 
        _e('Add new gallery', 'nggallery');
        ?>
"/>
				<?php 
    }
    ?>
			</div>
			
		<?php 
    if ($page_links) {
        ?>
			<div class="tablenav-pages"><?php 
        $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s&#8211;%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>
		<table class="widefat" cellspacing="0">
			<thead>
			<tr>
<?php 
    print_column_headers('nggallery-manage-galleries');
    ?>
			</tr>
			</thead>
			<tfoot>
			<tr>
<?php 
    print_column_headers('nggallery-manage-galleries', false);
    ?>
			</tr>
			</tfoot>            
			<tbody>
<?php 
    if ($gallerylist) {
        //get the columns
        $gallery_columns = ngg_manage_gallery_columns();
        $hidden_columns = get_hidden_columns('nggallery-manage-images');
        $num_columns = count($gallery_columns) - count($hidden_columns);
        foreach ($gallerylist as $gallery) {
            $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
            $gid = $gallery->gid;
            $name = empty($gallery->title) ? $gallery->name : $gallery->title;
            $author_user = get_userdata((int) $gallery->author);
            ?>
		<tr id="gallery-<?php 
            echo $gid;
            ?>
" <?php 
            echo $alternate;
            ?>
 >
		<?php 
            foreach ($gallery_columns as $gallery_column_key => $column_display_name) {
                $class = "class=\"{$gallery_column_key} column-{$gallery_column_key}\"";
                $style = '';
                if (in_array($gallery_column_key, $hidden_columns)) {
                    $style = ' style="display:none;"';
                }
                $attributes = "{$class}{$style}";
                switch ($gallery_column_key) {
                    case 'cb':
                        ?>
        			<th scope="row" class="cb column-cb">
        				<?php 
                        if (nggAdmin::can_manage_this_gallery($gallery->author)) {
                            ?>
        					<input name="doaction[]" type="checkbox" value="<?php 
                            echo $gid;
                            ?>
" />
        				<?php 
                        }
                        ?>
        			</th>
        			<?php 
                        break;
                    case 'id':
                        ?>
					<td <?php 
                        echo $attributes;
                        ?>
 scope="row"><?php 
                        echo $gid;
                        ?>
</td>
					<?php 
                        break;
                    case 'title':
                        ?>
        			<td>
        				<?php 
                        if (nggAdmin::can_manage_this_gallery($gallery->author)) {
                            ?>
        					<a href="<?php 
                            echo wp_nonce_url($ngg->manage_page->base_page . '&amp;mode=edit&amp;gid=' . $gid, 'ngg_editgallery');
                            ?>
" class='edit' title="<?php 
                            _e('Edit');
                            ?>
" >
        						<?php 
                            echo nggGallery::i18n($name);
                            ?>
        					</a>
        				<?php 
                        } else {
                            ?>
        					<?php 
                            echo nggGallery::i18n($gallery->title);
                            ?>
        				<?php 
                        }
                        ?>
        			</td>
        			<?php 
                        break;
                    case 'description':
                        ?>
					<td <?php 
                        echo $attributes;
                        ?>
><?php 
                        echo nggGallery::i18n($gallery->galdesc);
                        ?>
&nbsp;</td>
					<?php 
                        break;
                    case 'author':
                        ?>
					<td <?php 
                        echo $attributes;
                        ?>
><?php 
                        echo $author_user->display_name;
                        ?>
</td>
					<?php 
                        break;
                    case 'page_id':
                        ?>
        			<td <?php 
                        echo $attributes;
                        ?>
><?php 
                        echo $gallery->pageid;
                        ?>
</td>
        			<?php 
                        break;
                    case 'quantity':
                        ?>
        			<td <?php 
                        echo $attributes;
                        ?>
><?php 
                        echo $gallery->counter;
                        ?>
</td>
        			<?php 
                        break;
                    default:
                        ?>
					<td <?php 
                        echo $attributes;
                        ?>
><?php 
                        do_action('ngg_manage_gallery_custom_column', $gallery_column_key, $gid);
                        ?>
</td>
					<?php 
                        break;
                }
            }
            ?>
		</tr>
		<?php 
        }
    } else {
        echo '<tr><td colspan="7" align="center"><strong>' . __('No entries found', 'nggallery') . '</strong></td></tr>';
    }
    ?>
			
			</tbody>
		</table>
        <div class="tablenav">
		<?php 
    if ($page_links) {
        ?>
			<div class="tablenav-pages"><?php 
        $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s&#8211;%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>
	</div>
	<!-- #addGallery -->
	<div id="addGallery" style="display: none;" >
		<form id="form-tags" method="POST" accept-charset="utf-8">
		<?php 
    wp_nonce_field('ngg_addgallery');
    ?>
		<input type="hidden" name="page" value="manage-galleries" />
		<table width="100%" border="0" cellspacing="3" cellpadding="3" >
		  	<tr>
		    	<td>
					<strong><?php 
    _e('New Gallery', 'nggallery');
    ?>
:</strong> <input type="text" size="35" name="galleryname" value="" /><br />
					<?php 
    if (!is_multisite()) {
        ?>
					<?php 
        _e('Create a new , empty gallery below the folder', 'nggallery');
        ?>
  <strong><?php 
        echo $ngg->options['gallerypath'];
        ?>
</strong><br />
					<?php 
    }
    ?>
					<i>( <?php 
    _e('Allowed characters for file and folder names are', 'nggallery');
    ?>
: a-z, A-Z, 0-9, -, _ )</i>
				</td>
		  	</tr>
		  	<tr align="right">
		    	<td class="submit">
		    		<input class="button-primary" type="submit" name="addgallery" value="<?php 
    _e('OK', 'nggallery');
    ?>
" />
		    		&nbsp;
		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php 
    _e('Cancel', 'nggallery');
    ?>
&nbsp;" />
		    	</td>
			</tr>
		</table>
		</form>
	</div>
	<!-- /#addGallery -->

	<!-- #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-galleries" />
		<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');
    ?>
" />
		    		&nbsp;
		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php 
    _e('Cancel', 'nggallery');
    ?>
&nbsp;" />
		    	</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-galleries" />
		<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');
    ?>
" />
		    		&nbsp;
		    		<input class="button-secondary dialog-cancel" type="reset" value="&nbsp;<?php 
    _e('Cancel', 'nggallery');
    ?>
&nbsp;" />
		    	</td>
			</tr>
		</table>
		</form>
	</div>
	<!-- /#new_thumbnail -->	

<?php 
}
function powerpress_admin_categoryfeeds()
{
    $General = powerpress_get_settings('powerpress_general');
    ?>
<h2><?php 
    echo __('Category Podcasting', 'powerpress');
    ?>
</h2>
<p>
	<?php 
    echo __('Category Podcasting adds custom podcast settings to specific blog category feeds, allowing you to organize episodes by topic.', 'powerpress');
    ?>
</p>
<p>
	<?php 
    echo sprintf(__('If you are looking to organize episodes by file or format, please use %s.', 'powerpress'), '<a href="' . admin_url('admin.php?page=powerpress/powerpressadmin_customfeeds.php') . '" title="' . __('Custom Podcast Channels') . '">' . __('Custom Podcast Channels') . '</a>');
    ?>
</p><style type="text/css">
.column-url {
	width: 40%;
}
.column-name {
	width: 30%;
}
.column-feed-slug {
	width: 15%;
}
.column-episode-count {
	width: 15%;
}
.category-list {
	width: 100%;
}
</style>
<div id="col-container">

<div id="col-right">
<table class="widefat fixed" cellspacing="0">
	<thead>
	<tr>
<?php 
    print_column_headers('powerpressadmin_categoryfeeds');
    ?>
	</tr>
	</thead>

	<tfoot>
	<tr>
<?php 
    print_column_headers('powerpressadmin_categoryfeeds', false);
    ?>
	</tr>
	</tfoot>
	<tbody>
<?php 
    $Feeds = array();
    if (isset($General['custom_cat_feeds'])) {
        $Feeds = $General['custom_cat_feeds'];
    }
    $count = 0;
    while (list($null, $cat_ID) = each($Feeds)) {
        if (empty($cat_ID)) {
            continue;
        }
        $category = get_category_to_edit($cat_ID);
        if (is_wp_error($category)) {
            // $cat_ID does not existing
            continue;
        }
        //var_dump($category);
        $columns = powerpress_admin_customfeeds_columns();
        $hidden = array();
        if ($count % 2 == 0) {
            echo '<tr valign="middle" class="alternate">';
        } else {
            echo '<tr valign="middle">';
        }
        $edit_link = admin_url('admin.php?page=powerpress/powerpressadmin_categoryfeeds.php&amp;action=powerpress-editcategoryfeed&amp;cat=') . $cat_ID;
        $feed_title = $category->name;
        $url = get_category_feed_link($cat_ID);
        $short_url = str_replace('http://', '', $url);
        $short_url = str_replace('www.', '', $short_url);
        if (strlen($short_url) > 35) {
            $short_url = substr($short_url, 0, 32) . '...';
        }
        foreach ($columns as $column_name => $column_display_name) {
            $class = "class=\"column-{$column_name}\"";
            //$short_url = '';
            switch ($column_name) {
                case 'feed-slug':
                    echo "<td {$class}>{$category->slug}";
                    echo "</td>";
                    break;
                case 'name':
                    echo '<td ' . $class . '><strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit "%s"', 'powerpress'), $feed_title)) . '">' . esc_html($feed_title) . '</a></strong><br />';
                    $actions = array();
                    $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit', 'powerpress') . '</a>';
                    $actions['remove'] = "<a class='submitdelete' href='" . admin_url() . wp_nonce_url("admin.php?page=powerpress/powerpressadmin_categoryfeeds.php&amp;action=powerpress-delete-category-feed&amp;cat={$cat_ID}", 'powerpress-delete-category-feed-' . $cat_ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf(__("You are about to remove podcast settings for category feed '%s'\n  'Cancel' to stop, 'OK' to delete.", 'powerpress'), esc_html($feed_title))) . "') ) { return true;}return false;\">" . __('Remove', 'powerpress') . "</a>";
                    $action_count = count($actions);
                    $i = 0;
                    echo '<div class="row-actions">';
                    foreach ($actions as $action => $linkaction) {
                        ++$i;
                        $i == $action_count ? $sep = '' : ($sep = ' | ');
                        echo '<span class="' . $action . '">' . $linkaction . $sep . '</span>';
                    }
                    echo '</div>';
                    echo '</td>';
                    break;
                case 'url':
                    echo "<td {$class}><a href='{$url}' title='" . esc_attr(sprintf(__('Visit %s', 'powerpress'), $feed_title)) . "' target=\"_blank\">{$short_url}</a>";
                    echo '<div class="row-actions">';
                    if (defined('POWERPRESS_FEEDVALIDATOR_URL')) {
                        echo '<span class="' . $action . '"><a href="' . POWERPRESS_FEEDVALIDATOR_URL . urlencode(str_replace('&amp;', '&', $url)) . '" target="_blank">' . __('Validate Feed', 'powerpress') . '</a></span>';
                    }
                    echo '</div>';
                    echo "</td>";
                    break;
                case 'episode-count':
                    echo "<td {$class}>{$episode_total}";
                    echo "</td>";
                    break;
                default:
                    break;
            }
        }
        echo "\n    </tr>\n";
        $count++;
    }
    ?>
	</tbody>
</table>
</div> <!-- col-right -->

<div id="col-left">
<div class="col-wrap">
<div class="form-wrap">
<h3><?php 
    echo __('Add Podcast Settings to existing Category Feed', 'powerpress');
    ?>
</h3>
<input type="hidden" name="action" value="powerpress-addcategoryfeed" />
<input type="hidden" name="taxonomy" value="category" />
<?php 
    //wp_original_referer_field(true, 'previous');
    wp_nonce_field('powerpress-add-taxonomy-feed');
    ?>

<div class="form-field form-required">
	<label for="feed_name"><?php 
    echo __('Category', 'powerpress');
    ?>
</label>
<?php 
    wp_dropdown_categories(array('class' => 'category-list', 'show_option_none' => __('Select Category', 'powerpress'), 'orderby' => 'name', 'hide_empty' => 0, 'hierarchical' => 1, 'name' => 'term', 'id' => 'term_id'));
    ?>
	
    
</div>

<p class="submit"><input type="submit" class="button" name="submit" value="<?php 
    echo __('Add Podcast Settings to Category Feed', 'powerpress');
    ?>
" /></p>

</div>
</div>

</div> <!-- col-left -->

</div> <!-- col-container -->

<h3><?php 
    echo __('Example Usage', 'powerpress');
    ?>
</h3>
<p>
	<?php 
    echo __('Example 1: You have a podcast that covers two topics that sometimes share same posts and sometimes do not. Use your main podcast feed as a combined feed of both topics 	and use category feeds to distribute topic specific episodes.', 'powerpress');
    ?>
</p>
<p>
	<?php 
    echo __('Example 2: You want to use categories to keep episodes separate from each other. Each category can be used to distribute separate podcasts with the main podcast feed combining all categories to provide a network feed.', 'powerpress');
    ?>
</p>

<?php 
}