function wp_dropdown_cats($currentcat, $currentparent = 0, $parent = 0, $level = 0, $categories = 0)
    {
        $myts =& MyTextSanitizer::getInstance();
        if (!$categories) {
            $categoryHandler =& wp_handler('Category');
            $categories =& $categoryHandler->getObjects();
        }
        if ($categories) {
            foreach ($categories as $category) {
                $cat_ID = $category->getVar('cat_ID');
                if ($currentcat != $cat_ID && $parent == $category->getVar('category_parent')) {
                    $cat_name = $myts->makeTareaData4Show($category->getVar('cat_name'));
                    $pad = str_repeat('– ', $level);
                    ?>
				<option value='<?php 
                    echo $cat_ID;
                    ?>
'<?php 
                    selected($currentparent, $cat_ID);
                    ?>
><?php 
                    echo "{$pad}{$cat_name}";
                    ?>
</option>
<?php 
                    wp_dropdown_cats($currentcat, $currentparent, $cat_ID, $level + 1, $categories);
                }
            }
        } else {
            return false;
        }
    }
Esempio n. 2
0
/**
 * {@internal Missing Short Description}}
 *
 * @since 1.2.0
 * @deprecated 3.0.0
 * @deprecated Use wp_dropdown_categories()
 * @see wp_dropdown_categories()
 *
 * @param unknown_type $currentcat
 * @param unknown_type $currentparent
 * @param unknown_type $parent
 * @param unknown_type $level
 * @param unknown_type $categories
 * @return unknown
 */
function wp_dropdown_cats($currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0)
{
    _deprecated_function(__FUNCTION__, '3.0', 'wp_dropdown_categories()');
    if (!$categories) {
        $categories = get_categories(array('hide_empty' => 0));
    }
    if ($categories) {
        foreach ($categories as $category) {
            if ($currentcat != $category->term_id && $parent == $category->parent) {
                $pad = str_repeat('&#8211; ', $level);
                $category->name = esc_html($category->name);
                echo "\n\t<option value='{$category->term_id}'";
                if ($currentparent == $category->term_id) {
                    echo " selected='selected'";
                }
                echo ">{$pad}{$category->name}</option>";
                wp_dropdown_cats($currentcat, $currentparent, $category->term_id, $level + 1, $categories);
            }
        }
    } else {
        return false;
    }
}
function wp_dropdown_cats($currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0)
{
    global $wpdb, $bgcolor;
    if (!$categories) {
        $categories = $wpdb->get_results("SELECT * FROM {$wpdb->categories} ORDER BY cat_name");
    }
    if ($categories) {
        foreach ($categories as $category) {
            if ($currentcat != $category->cat_ID && $parent == $category->category_parent) {
                $count = $wpdb->get_var("SELECT COUNT(post_id) FROM {$wpdb->post2cat} WHERE category_id = {$category->cat_ID}");
                $pad = str_repeat('&#8211; ', $level);
                $category->cat_name = wp_specialchars($category->cat_name);
                echo "\n\t<option value='{$category->cat_ID}'";
                if ($currentparent == $category->cat_ID) {
                    echo " selected='selected'";
                }
                echo ">{$pad}{$category->cat_name}</option>";
                wp_dropdown_cats($currentcat, $currentparent, $category->cat_ID, $level + 1, $categories);
            }
        }
    } else {
        return false;
    }
}
Esempio n. 4
0
        <p><?php 
            _e('Name:');
            ?>
<br />
        <input type="text" name="cat_name" value="" /></p>
        <p><?php 
            _e('Category parent:');
            ?>
<br />
        <select name='category_parent' class='postform'>
        <option value='0'><?php 
            _e('None');
            ?>
</option>
        <?php 
            wp_dropdown_cats(0);
            ?>
        </select></p>
        <p><?php 
            _e('Description: (optional)');
            ?>
 <br />
        <textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p>
        <p class="submit"><input type="hidden" name="action" value="addcat" /><input type="submit" name="submit" value="<?php 
            _e('Add Category &raquo;');
            ?>
" /></p>
    </form>
</div>
<?php 
        }
<?php if ( current_user_can('manage_categories') ) : ?>
<div class="wrap">
<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete posts from that category, it will just set them back to the default category <strong>%s</strong>.'), get_catname(get_option('default_category'))) ?></p>
</div>

<div class="wrap">
    <h2><?php _e('Add New Category') ?></h2>
    <form name="addcat" id="addcat" action="categories.php" method="post">
    <?php wp_nonce_field('add-category'); ?>
        <p><?php _e('Name:') ?><br />
        <input type="text" name="cat_name" value="" /></p>
        <p><?php _e('Category parent:') ?><br />
        <select name='category_parent' class='postform'>
        <option value='0'><?php _e('None') ?></option>
        <?php wp_dropdown_cats(0); ?>
        </select></p>
        <p><?php _e('Description: (optional)') ?> <br />
        <textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p>
        <p class="submit"><input type="hidden" name="action" value="addcat" /><input type="submit" name="submit" value="<?php _e('Add Category &raquo;') ?>" /></p>
    </form>
</div>
<?php endif; ?>

<?php
break;
}

include('admin-footer.php');
?>
/**
 * {@internal Missing Short Description}}
 *
 * @since unknown
 *
 * @param unknown_type $currentcat
 * @param unknown_type $currentparent
 * @param unknown_type $parent
 * @param unknown_type $level
 * @param unknown_type $categories
 * @return unknown
 */
function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
	if (!$categories )
		$categories = get_categories( array('hide_empty' => 0) );

	if ( $categories ) {
		foreach ( $categories as $category ) {
			if ( $currentcat != $category->term_id && $parent == $category->parent) {
				$pad = str_repeat( '&#8211; ', $level );
				$category->name = wp_specialchars( $category->name );
				echo "\n\t<option value='$category->term_id'";
				if ( $currentparent == $category->term_id )
					echo " selected='selected'";
				echo ">$pad$category->name</option>";
				wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
			}
		}
	} else {
		return false;
	}
}
Esempio n. 7
0
function wp_dropdown_cats($currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0)
{
    global $wpdb;
    if (!$categories) {
        $categories = get_categories('hide_empty=0');
    }
    if ($categories) {
        foreach ($categories as $category) {
            if ($currentcat != $category->term_id && $parent == $category->parent) {
                $pad = str_repeat('&#8211; ', $level);
                $category->name = wp_specialchars($category->name);
                echo "\n\t<option value='{$category->term_id}'";
                if ($currentparent == $category->term_id) {
                    echo " selected='selected'";
                }
                echo ">{$pad}{$category->name}</option>";
                wp_dropdown_cats($currentcat, $currentparent, $category->term_id, $level + 1, $categories);
            }
        }
    } else {
        return false;
    }
}
function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
	global $wpdb;
	if (!$categories )
		$categories = get_categories( 'hide_empty=0' );

	if ( $categories ) {
		foreach ( $categories as $category ) {
			if ( $currentcat != $category->cat_ID && $parent == $category->category_parent) {
				$pad = str_repeat( '&#8211; ', $level );
				$category->cat_name = wp_specialchars( $category->cat_name );
				echo "\n\t<option value='$category->cat_ID'";
				if ( $currentparent == $category->cat_ID )
					echo " selected='selected'";
				echo ">$pad$category->cat_name</option>";
				wp_dropdown_cats( $currentcat, $currentparent, $category->cat_ID, $level +1, $categories );
			}
		}
	} else {
		return false;
	}
}
Esempio n. 9
0
    function options_subpanel()
    {
        global $ec3;
        if (isset($_POST['info_update'])) {
            echo '<div id="message" class="updated fade"><p><strong>';
            if (isset($_POST['ec3_event_category'])) {
                $ec3->set_event_category(intval($_POST['ec3_event_category']));
            }
            if (isset($_POST['ec3_show_event_box'])) {
                $ec3->set_show_event_box(intval($_POST['ec3_show_event_box']));
            }
            if (isset($_POST['ec3_advanced'])) {
                $ec3->set_advanced(intval($_POST['ec3_advanced']));
            }
            if (isset($_POST['ec3_tz'])) {
                $ec3->set_tz($_POST['ec3_tz']);
            }
            _e('Options saved.');
            echo '</strong></p></div>';
        }
        ?>

   <div class="wrap">
    <form method="post">
     <h2><?php 
        _e('Event Calendar Options', 'ec3');
        ?>
</h2>

     <?php 
        if (isset($_GET['ec3_easteregg'])) {
            ?>

     <h3><?php 
            _e('Easter Egg', 'ec3');
            ?>
:
       <input type="submit" name="ec3_upgrade_posts"
        value="<?php 
            _e('Upgrade Event Posts', 'ec3');
            ?>
" /></h3>

     <?php 
        }
        ?>

     <table class="form-table"> 

      <tr valign="top"> 
       <th width="33%" scope="row"><?php 
        _e('Event category', 'ec3');
        ?>
:</th> 
       <td>
        <select name="ec3_event_category">
        <?php 
        if (0 == $ec3->event_category) {
            echo '<option value="0">' . __('- Select -') . '</option>';
        }
        wp_dropdown_cats(0, $ec3->event_category);
        ?>
        </select>
        <br /><em>
         <?php 
        _e("Event posts are put into this category for you. Don't make this your default post category.", 'ec3');
        ?>
        </em>
       </td> 
      </tr> 

       <tr valign="top"> 
        <th width="33%" scope="row"><?php 
        _e('Show times within post content', 'ec3');
        ?>
:</th> 
        <td>
         <select name="ec3_show_event_box">          
          <option value='0'<?php 
        if ($ec3->show_event_box == 0) {
            echo " selected='selected'";
        }
        ?>
 >
           <?php 
        _e('Hide Times', 'ec3');
        ?>
          </option>
          <option value='1'<?php 
        if ($ec3->show_event_box == 1) {
            echo " selected='selected'";
        }
        ?>
 >
           <?php 
        _e('List Times', 'ec3');
        ?>
          </option>
          <option value='2'<?php 
        if ($ec3->show_event_box == 2) {
            echo " selected='selected'";
        }
        ?>
 >
           <?php 
        _e('Show Times as Icons', 'ec3');
        ?>
          </option>
         </select>
        </td> 
       </tr>

      <tr valign="top">
       <th width="33%" scope="row"><?php 
        _e('Show events as blog entries', 'ec3');
        ?>
:</th> 
       <td>
        <select name="ec3_advanced">
         <option value='0'<?php 
        if (!$ec3->advanced_setting) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Events are Normal Posts', 'ec3');
        ?>
         </option>
         <option value='1'<?php 
        if ($ec3->advanced_setting) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Keep Events Separate', 'ec3');
        ?>
         </option>
        </select>
        <br /><em>
         <?php 
        _e('Keep Events Separate: the Event Category page shows future events, in date order. Events do not appear on front page.', 'ec3');
        ?>
        </em>
       </td> 

      <tr valign="top">
      <?php 
        if ($ec3->tz_disabled) {
            ?>
       <th style="color:gray" width="33%" scope="row"><?php 
            _e('Timezone', 'ec3');
            ?>
:</th> 
       <td>
         <input disabled="disabled" type="text" value="<?php 
            if (empty($ec3->tz)) {
                _e('unknown', 'ec3');
            } else {
                echo $ec3->tz;
            }
            ?>
" />
         <br /><em>
          <?php 
            _e("You cannot change your timezone. Turn off PHP's 'safe mode' or upgrade to PHP5.", 'ec3');
            ?>
         </em>
       </td> 
      <?php 
        } else {
            ?>
       <th width="33%" scope="row"><?php 
            _e('Timezone', 'ec3');
            ?>
:</th> 
       <td>
         <select name="ec3_tz">
          <option value="wordpress">WordPress</option>
          <?php 
            ec3_get_tz_options($ec3->tz);
            ?>
         </select>
       </td> 
      <?php 
        }
        ?>
      </tr>

     </table>

     <p class="submit"><input type="submit" name="info_update"
        value="<?php 
        _e('Save Changes');
        ?>
" /></p>
    </form>

   </div> <?php 
    }
Esempio n. 10
0
function ec3_options_subpanel()
{
    global $ec3;
    if (isset($_POST['info_update'])) {
        echo '<div class="updated"><p><strong>';
        if (isset($_POST['ec3_event_category'])) {
            $ec3->set_event_category(intval($_POST['ec3_event_category']));
        }
        if (isset($_POST['ec3_num_months'])) {
            $ec3->set_num_months(intval($_POST['ec3_num_months']));
        }
        if (isset($_POST['ec3_show_only_events'])) {
            $ec3->set_show_only_events(intval($_POST['ec3_show_only_events']));
        }
        if (isset($_POST['ec3_day_length'])) {
            $ec3->set_day_length(intval($_POST['ec3_day_length']));
        }
        if (isset($_POST['ec3_hide_logo'])) {
            $ec3->set_hide_logo(intval($_POST['ec3_hide_logo']));
        }
        if (isset($_POST['ec3_advanced'])) {
            $ec3->set_advanced(intval($_POST['ec3_advanced']));
        }
        if (isset($_POST['ec3_nav_below'])) {
            $ec3->set_nav_below(intval($_POST['ec3_nav_below']));
        }
        if (isset($_POST['ec3_disable_popups'])) {
            $ec3->set_disable_popups(intval($_POST['ec3_disable_popups']));
        }
        _e('Options set.', 'ec3');
        echo '</strong></p></div>';
    }
    ?>

 <div class=wrap>
  <form method="post">
   <h2><?php 
    _e('Event Calendar Options', 'ec3');
    ?>
</h2>
   <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 

    <tr valign="middle"> 
     <th width="33%" scope="row"><?php 
    _e('Event category', 'ec3');
    ?>
:</th> 
     <td>
      <select name="ec3_event_category">
      <?php 
    wp_dropdown_cats(0, $ec3->event_category);
    ?>
      </select>
     </td> 
    </tr> 

    <tr valign="middle">
     <th width="33%" scope="row"><?php 
    _e('Show events as blog entries', 'ec3');
    ?>
:</th> 
     <td>
      <select name="ec3_advanced">
       <option value='0'<?php 
    if (!$ec3->advanced) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Events are Normal Posts', 'ec3');
    ?>
       </option>
       <option value='1'<?php 
    if ($ec3->advanced) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Keep Events Separate', 'ec3');
    ?>
       </option>
      </select>
     </td> 
    </tr> 
    <tr valign="middle"><th width="33%" scope="row"></th> 
     <td><em>
      <?php 
    _e('Keep Events Separate: the Event Category page shows future events, in date order. Events do not appear on front page.', 'ec3');
    ?>
     </em></td> 
    </tr> 

   </table>

   <fieldset class="options"><legend><?php 
    _e('Calendar Display', 'ec3');
    ?>
</legend> 

   <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 

    <tr valign="middle"> 
     <th width="33%" scope="row"><?php 
    _e('Number of months', 'ec3');
    ?>
:</th> 
     <td>
      <input type="text" name="ec3_num_months" value="<?php 
    echo $ec3->num_months;
    ?>
" />
     </td> 
    </tr> 

    <tr valign="middle"> 
     <th width="33%" scope="row"><?php 
    _e('Show all categories in calendar', 'ec3');
    ?>
:</th> 
     <td>
      <select name="ec3_show_only_events">
       <option value='1'<?php 
    if ($ec3->show_only_events) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Only Show Events', 'ec3');
    ?>
       </option>
       <option value='0'<?php 
    if (!$ec3->show_only_events) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Show All Posts', 'ec3');
    ?>
       </option>
      </select>
     </td> 
    </tr> 

    <tr valign="middle"> 
     <th width="33%" scope="row"><?php 
    _e('Show day names as', 'ec3');
    ?>
:</th> 
     <td>
      <select name="ec3_day_length">
       <option value='1'<?php 
    if ($ec3->day_length < 3) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Single Letter', 'ec3');
    ?>
       </option>
       <option value='3'<?php 
    if (3 == $ec3->day_length) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('3-Letter Abbreviation', 'ec3');
    ?>
       </option>
       <option value='9'<?php 
    if ($ec3->day_length > 3) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Full Day Name', 'ec3');
    ?>
       </option>
      </select>
     </td> 
    </tr> 

    <tr valign="middle"> 
     <th width="33%" scope="row"><?php 
    _e('Show Event Calendar logo', 'ec3');
    ?>
:</th> 
     <td>
      <select name="ec3_hide_logo">
       <option value='0'<?php 
    if (!$ec3->hide_logo) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Show Logo', 'ec3');
    ?>
       </option>
       <option value='1'<?php 
    if ($ec3->hide_logo) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Hide Logo', 'ec3');
    ?>
       </option>
      </select>
     </td> 
    </tr> 

    <tr valign="middle"> 
     <th width="33%" scope="row"><?php 
    _e('Position of navigation links', 'ec3');
    ?>
:</th> 
     <td>
      <select name="ec3_nav_below">
       <option value='0'<?php 
    if (!$ec3->nav_below) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Above Calendar', 'ec3');
    ?>
       </option>
       <option value='1'<?php 
    if ($ec3->nav_below) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Below Calendar', 'ec3');
    ?>
       </option>
      </select>
     </td> 
    </tr> 
    <tr valign="middle"><th width="33%" scope="row"></th>
     <td><em>
      <?php 
    _e('The navigation links are more usable when they are above the calendar, but you might prefer them below it for aesthetic reasons.', 'ec3');
    ?>
     </em></td> 
    </tr> 

    <tr valign="middle">
     <th width="33%" scope="row"><?php 
    _e('Popup event lists', 'ec3');
    ?>
:</th> 
     <td>
      <select name="ec3_disable_popups">
       <option value='0'<?php 
    if (!$ec3->disable_popups) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Show Popups', 'ec3');
    ?>
       </option>
       <option value='1'<?php 
    if ($ec3->disable_popups) {
        echo " selected='selected'";
    }
    ?>
 >
        <?php 
    _e('Hide Popups', 'ec3');
    ?>
       </option>
      </select>
     </td> 
    </tr> 
    <tr valign="middle"><th width="33%" scope="row"></th> 
     <td><em>
      <?php 
    _e('You might want to disable popups if you use Nicetitles.', 'ec3');
    ?>
     </em></td> 
    </tr> 

   </table>
   </fieldset>

   <p class="submit"><input type="submit" name="info_update" value="<?php 
    _e('Update options', 'ec3');
    ?>
 &raquo;" /></p>
  </form>

  <h3>EXAMPLE SIDEBAR CODE:</h3>

  <pre><code>        &lt;li&gt;
           &lt;?php ec3_get_calendar(); ?&gt;
        &lt;/li&gt;
        &lt;li&gt;&lt;?php _e('Events'); ?&gt;
           &lt;?php ec3_get_events(5); ?&gt;
        &lt;/li&gt;</code></pre>

 </div> <?php 
}
Esempio n. 11
0
	<td valign="top" width="33%">
		<form name="searchform" action="" method="get">
			<input type="hidden" name="a" value="s" />
			<input onfocus="if (this.value=='search...') {this.value='';}" onblur="if (this.value=='') {this.value='search...';}" type="text" name="s" value="<?php 
echo test_param('s') ? get_param('s') : "search...";
?>
" size="7" style="width: 100px;" />
			<input type="submit" name="submit" value="search" />
		</form>
	</td>
    <td valign="top" width="33%" align="center">
	  <form name="viewcat" action="" method="get">
		<select name="cat" style="width:140px;">
		<option value="all">All Categories</option>
		<?php 
wp_dropdown_cats(0, get_param('cat'));
?>
		</select>
		<input type="submit" name="submit" value="View" />
	  </form>
    </td>
    <td valign="top" width="33%" align="right">
    <form name="viewarc" action="" method="get">
<?php 
if ($GLOBALS['archive_mode'] == "monthly") {
    ?>
		<select name="m" style="width:120px;">
			<option value="">All Months</option>
			<?php 
    wp_dropdown_month(test_param('m') ? get_param('m') : '');
} elseif ($GLOBALS['archive_mode'] == "daily") {
function wp_dropdown_cats($currentcat, $currentparent = 0, $parent = 0, $level = 0, $categories = 0)
{
    global $wpdb, $wp_id, $bgcolor;
    $myts =& MyTextSanitizer::getInstance();
    if (!$categories) {
        $categories = $wpdb->get_results("SELECT * FROM {$wpdb->categories[$wp_id]} ORDER BY cat_name");
    }
    if ($categories) {
        foreach ($categories as $category) {
            if ($currentcat != $category->cat_ID && $parent == $category->category_parent) {
                $cat_ID = $category->cat_ID;
                $cat_name = $myts->makeTareaData4Show($category->cat_name);
                $pad = str_repeat('&#8211; ', $level);
                ?>
				<option value='<?php 
                echo $cat_ID;
                ?>
'<?php 
                selected($currentparent, $cat_ID);
                ?>
><?php 
                echo "{$pad}{$cat_name}";
                ?>
</option>
<?php 
                wp_dropdown_cats($currentcat, $currentparent, $category->cat_ID, $level + 1, $categories);
            }
        }
    } else {
        return false;
    }
}
</h2>
    <form name="addcat" id="addcat" action="categories.php" method="post">
        
        <p><?php 
        echo _LANG_C_NAME_SUBCAT;
        ?>
<br />
        <input type="text" name="cat_name" value="" /></p>
        <p><?php 
        echo _LANG_C_NAME_PARENT;
        ?>
<br />
        <select name='cat' class='postform'>
        <option value='0'>None</option>
        <?php 
        wp_dropdown_cats();
        ?>
</p>
        </select>
        <p><?php 
        echo _LANG_C_NAME_SUBDESC;
        ?>
 (optional) <br />
        <textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p>
        <p class="submit"><input type="hidden" name="action" value="addcat" /><input type="submit" name="submit" value="<?php 
        echo _LANG_C_NAME_ADDBTN;
        ?>
" /></p>
    </form>
</div>
Esempio n. 14
0
    function options_subpanel()
    {
        global $ec3;
        if (isset($_POST['info_update'])) {
            echo '<div id="message" class="updated fade"><p><strong>';
            if (isset($_POST['ec3_event_category'])) {
                $ec3->set_event_category(intval($_POST['ec3_event_category']));
            }
            if (isset($_POST['ec3_num_months'])) {
                $ec3->set_num_months(intval($_POST['ec3_num_months']));
            }
            if (isset($_POST['ec3_show_only_events'])) {
                $ec3->set_show_only_events(intval($_POST['ec3_show_only_events']));
            }
            if (isset($_POST['ec3_day_length'])) {
                $ec3->set_day_length(intval($_POST['ec3_day_length']));
            }
            if (isset($_POST['ec3_hide_logo'])) {
                $ec3->set_hide_logo(intval($_POST['ec3_hide_logo']));
            }
            if (isset($_POST['ec3_hide_event_box'])) {
                $ec3->set_hide_event_box(intval($_POST['ec3_hide_event_box']));
            }
            if (isset($_POST['ec3_advanced'])) {
                $ec3->set_advanced(intval($_POST['ec3_advanced']));
            }
            if (isset($_POST['ec3_navigation'])) {
                $ec3->set_navigation(intval($_POST['ec3_navigation']));
            }
            if (isset($_POST['ec3_disable_popups'])) {
                $ec3->set_disable_popups(intval($_POST['ec3_disable_popups']));
            }
            if (isset($_POST['ec3_tz'])) {
                $ec3->set_tz($_POST['ec3_tz']);
            }
            _e('Options saved.');
            echo '</strong></p></div>';
        }
        ?>

   <div class="wrap">
    <form method="post">
     <h2><?php 
        _e('Event Calendar Options', 'ec3');
        ?>
</h2>

     <?php 
        if (isset($_GET['ec3_easteregg'])) {
            ?>

     <h3><?php 
            _e('Easter Egg', 'ec3');
            ?>
:
       <input type="submit" name="ec3_upgrade_posts"
        value="<?php 
            _e('Upgrade Event Posts', 'ec3');
            ?>
" /></h3>

     <?php 
        }
        ?>

     <table class="form-table"> 

      <tr valign="top"> 
       <th width="33%" scope="row"><?php 
        _e('Event category', 'ec3');
        ?>
:</th> 
       <td>
        <select name="ec3_event_category">
        <?php 
        if (0 == $ec3->event_category) {
            echo '<option value="0">' . __('- Select -') . '</option>';
        }
        wp_dropdown_cats(0, $ec3->event_category);
        ?>
        </select>
        <br /><em>
         <?php 
        _e("Event posts are put into this category for you. Don't make this your default post category.", 'ec3');
        ?>
        </em>
       </td> 
      </tr> 

       <tr valign="top"> 
        <th width="33%" scope="row"><?php 
        _e('Show schedule within posts', 'ec3');
        ?>
:</th> 
        <td>
         <select name="ec3_hide_event_box">          
           <option value='0'<?php 
        if (!$ec3->hide_event_box) {
            echo " selected='selected'";
        }
        ?>
 >
           <?php 
        _e('Show Schedule', 'ec3');
        ?>
          </option>
            <option value='1'<?php 
        if ($ec3->hide_event_box) {
            echo " selected='selected'";
        }
        ?>
 >
           <?php 
        _e('Hide Schedule', 'ec3');
        ?>
          </option>
         </select>
        </td> 
       </tr>

      <tr valign="top">
       <th width="33%" scope="row"><?php 
        _e('Show events as blog entries', 'ec3');
        ?>
:</th> 
       <td>
        <select name="ec3_advanced">
         <option value='0'<?php 
        if (!$ec3->advanced_setting) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Events are Normal Posts', 'ec3');
        ?>
         </option>
         <option value='1'<?php 
        if ($ec3->advanced_setting) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Keep Events Separate', 'ec3');
        ?>
         </option>
        </select>
        <br /><em>
         <?php 
        _e('Keep Events Separate: the Event Category page shows future events, in date order. Events do not appear on front page.', 'ec3');
        ?>
        </em>
       </td> 

      <tr valign="top">
      <?php 
        if ($ec3->tz_disabled) {
            ?>
       <th style="color:gray" width="33%" scope="row"><?php 
            _e('Timezone', 'ec3');
            ?>
:</th> 
       <td>
         <input disabled="disabled" type="text" value="<?php 
            if (empty($ec3->tz)) {
                _e('unknown', 'ec3');
            } else {
                echo $ec3->tz;
            }
            ?>
" />
         <br /><em>
          <?php 
            _e("You cannot change your timezone. Turn off PHP's 'safe mode' or upgrade to PHP5.", 'ec3');
            ?>
         </em>
       </td> 
      <?php 
        } else {
            ?>
       <th width="33%" scope="row"><?php 
            _e('Timezone', 'ec3');
            ?>
:</th> 
       <td>
         <select name="ec3_tz">
          <option value="wordpress">WordPress</option>
          <?php 
            ec3_get_tz_options($ec3->tz);
            ?>
         </select>
       </td> 
      <?php 
        }
        ?>
      </tr>

     </table>

     <h3><?php 
        _e('Calendar Display', 'ec3');
        ?>
</h3> 

     <table class="form-table"> 

      <tr valign="top"> 
       <th width="33%" scope="row"><?php 
        _e('Number of months', 'ec3');
        ?>
:</th> 
       <td>
        <input type="text" name="ec3_num_months" value="<?php 
        echo $ec3->num_months;
        ?>
" />
       </td> 
      </tr> 

      <tr valign="top"> 
       <th width="33%" scope="row"><?php 
        _e('Show all categories in calendar', 'ec3');
        ?>
:</th> 
       <td>
        <select name="ec3_show_only_events">
         <option value='1'<?php 
        if ($ec3->show_only_events) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Only Show Events', 'ec3');
        ?>
         </option>
         <option value='0'<?php 
        if (!$ec3->show_only_events) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Show All Posts', 'ec3');
        ?>
         </option>
        </select>
       </td> 
      </tr> 

      <tr valign="top"> 
       <th width="33%" scope="row"><?php 
        _e('Show day names as', 'ec3');
        ?>
:</th> 
       <td>
        <select name="ec3_day_length">
         <option value='1'<?php 
        if ($ec3->day_length < 3) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Single Letter', 'ec3');
        ?>
         </option>
         <option value='3'<?php 
        if (3 == $ec3->day_length) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('3-Letter Abbreviation', 'ec3');
        ?>
         </option>
         <option value='9'<?php 
        if ($ec3->day_length > 3) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Full Day Name', 'ec3');
        ?>
         </option>
        </select>
       </td> 
      </tr> 

      <tr valign="top"> 
       <th width="33%" scope="row"><?php 
        _e('Show Event Calendar logo', 'ec3');
        ?>
:</th> 
       <td>
        <select name="ec3_hide_logo">
         <option value='0'<?php 
        if (!$ec3->hide_logo) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Show Logo', 'ec3');
        ?>
         </option>
         <option value='1'<?php 
        if ($ec3->hide_logo) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Hide Logo', 'ec3');
        ?>
         </option>
        </select>
       </td> 
      </tr> 

      <tr valign="top"> 
       <th width="33%" scope="row"><?php 
        _e('Position of navigation links', 'ec3');
        ?>
:</th> 
       <td>
        <select name="ec3_navigation">
         <option value='0'<?php 
        if (0 == !$ec3->navigation) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Above Calendar', 'ec3');
        ?>
         </option>
         <option value='1'<?php 
        if (1 == $ec3->navigation) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Below Calendar', 'ec3');
        ?>
         </option>
         <option value='2'<?php 
        if (2 == $ec3->navigation) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Hidden', 'ec3');
        ?>
         </option>
        </select>
        <br /><em>
         <?php 
        _e('The navigation links are more usable when they are above the calendar, but you might prefer them below or hidden for aesthetic reasons.', 'ec3');
        ?>
        </em> 
       </td> 
      </tr> 

      <tr valign="top">
       <th width="33%" scope="row"><?php 
        _e('Popup event lists', 'ec3');
        ?>
:</th> 
       <td>
        <select name="ec3_disable_popups">
         <option value='0'<?php 
        if (!$ec3->disable_popups) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Show Popups', 'ec3');
        ?>
         </option>
         <option value='1'<?php 
        if ($ec3->disable_popups) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Hide Popups', 'ec3');
        ?>
         </option>
        </select>
        <br /><em>
         <?php 
        _e('You might want to disable popups if you use Nicetitles.', 'ec3');
        ?>
        </em>
       </td> 
      </tr> 

     </table>

     <p class="submit"><input type="submit" name="info_update"
        value="<?php 
        _e('Save Changes');
        ?>
" /></p>
    </form>

   </div> <?php 
    }
Esempio n. 15
0
	<td valign="top" width="33%">
		<form name="searchform" action="" method="get">
			<input type="hidden" name="a" value="s" />
			<input onfocus="if (this.value=='search...') {this.value='';}" onblur="if (this.value=='') {this.value='search...';}" type="text" name="s" value="<?php 
echo isset($s) && $s ? $s : "search...";
?>
" size="7" style="width: 100px;" />
			<input type="submit" name="submit" value="search" />
		</form>
	</td>
    <td valign="top" width="33%" align="center">
	  <form name="viewcat" action="" method="get">
		<select name="cat" style="width:140px;">
		<option value="all">All Categories</option>
		<?php 
wp_dropdown_cats(0, $cat);
?>
		</select>
		<input type="submit" name="submit" value="View" />
	  </form>
    </td>
    <td valign="top" width="33%" align="right">
    <form name="viewarc" action="" method="get">
<?php 
if ($archive_mode == "monthly") {
    ?>
		<select name="m" style="width:120px;">
			<option value="">All Months</option>
			<?php 
    wp_dropdown_month(isset($m) ? $m : "");
} elseif ($archive_mode == "daily") {
Esempio n. 16
0
    function options_subpanel()
    {
        global $ec3, $wpdb;
        $table_opt = $wpdb->prefix . 'ec3_add_opt';
        //$post_types = get_post_types( '', 'names' );
        //$listeActivePosteType = $ec3->listPostType;
        $OpenAgandaKey = $ec3->OpenAgandaKey;
        $OpenAgandaSecretKey = $ec3->OpenAgandaSecretKey;
        $OpenAgandaSlugName = $ec3->OpenAgandaSlugName;
        if (isset($_POST['info_update'])) {
            echo '<div id="message" class="updated fade"><p><strong>';
            if (isset($_POST['ec3_event_category'])) {
                $ec3->set_event_category(intval($_POST['ec3_event_category']));
            }
            if (isset($_POST['ec3_show_event_box'])) {
                $ec3->set_show_event_box(intval($_POST['ec3_show_event_box']));
            }
            if (isset($_POST['ec3_advanced'])) {
                $ec3->set_advanced(intval($_POST['ec3_advanced']));
            }
            if (isset($_POST['ec3_tz'])) {
                $ec3->set_tz($_POST['ec3_tz']);
            }
            // listPostType
            //$newlistPostType = 'post';
            /*
                    if( isset($_POST['ec3PosteType']) ){
                      $newlistPostType = $_POST['ec3PosteType'];
                    }
            
                  $ec3->set_listPostType( $newlistPostType );
                  $listeActivePosteType = $ec3->listPostType;
            */
            if (isset($_POST['OpenAgandaSlugName'])) {
                $newOpenAgandaSlugName = $_POST['OpenAgandaSlugName'];
                $ec3->set_OpenAgandaSlugName($newOpenAgandaSlugName);
                $OpenAgandaSlugName = $ec3->OpenAgandaSlugName;
            }
            if (isset($_POST['OpenAgandaKey'])) {
                $newOpenAgandaKey = $_POST['OpenAgandaKey'];
                $ec3->set_OpenAgandaKey($newOpenAgandaKey);
                $OpenAgandaKey = $ec3->OpenAgandaKey;
            }
            if (isset($_POST['OpenAgandaSecretKey'])) {
                $newOpenAgandaSecretKey = $_POST['OpenAgandaSecretKey'];
                $ec3->set_OpenAgandaSecretKey($newOpenAgandaSecretKey);
                $OpenAgandaSecretKey = $ec3->OpenAgandaSecretKey;
            }
            foreach ($_POST as $k => $v) {
                if (preg_match('/^nom_option_new_([0-9]+)$/', $k, $match)) {
                    $sid = intval($match[1]);
                    $nom_option = $_POST['nom_option_new_' . $sid];
                    $message_option = $_POST['message_option_new_' . $sid];
                    $expo_option = $_POST['expo_option_new_' . $sid];
                    if (!empty($nom_option)) {
                        $wpdb->insert($table_opt, array('nom' => $nom_option, 'message' => $message_option, 'post_type_expo' => $expo_option), array('%s', '%s', '%s'));
                    } else {
                    }
                }
                if (preg_match('/^nom_option_modif_([0-9]+)$/', $k, $match)) {
                    $sid = intval($match[1]);
                    $nom_option = $_POST['nom_option_modif_' . $sid];
                    $message_option = $_POST['message_option_modif_' . $sid];
                    $expo_option = $_POST['expo_option_modif_' . $sid];
                    if (!empty($nom_option)) {
                        $wpdb->update($table_opt, array('nom' => $nom_option, 'message' => $message_option, 'post_type_expo' => $expo_option), array('option_id' => $sid), array('%s', '%s', '%s'));
                    }
                }
                if (preg_match('/^nom_option_delete_([0-9]+)$/', $k, $match)) {
                    $sid = intval($match[1]);
                    $wpdb->delete($table_opt, array('option_id' => $sid));
                }
            }
            _e('Options saved.');
            echo '</strong></p></div>';
        }
        ?>
    <div class="wrap">
    <form method="post">
     <h2><?php 
        _e('Event Calendar Options', 'ec3');
        ?>
</h2>

     <?php 
        if (isset($_GET['ec3_easteregg'])) {
            ?>

     <h3><?php 
            _e('Easter Egg', 'ec3');
            ?>
:
       <input type="submit" name="ec3_upgrade_posts"
        value="<?php 
            _e('Upgrade Event Posts', 'ec3');
            ?>
" /></h3>

     <?php 
        }
        ?>

     <table class="form-table"> 

      <tr valign="top"> 
       <th width="33%" scope="row"><?php 
        _e('Event category', 'ec3');
        ?>
:</th> 
       <td>
        <select name="ec3_event_category">
        <?php 
        if (0 == $ec3->event_category) {
            echo '<option value="0">' . __('- Select -') . '</option>';
        }
        wp_dropdown_cats(0, $ec3->event_category);
        ?>
        </select>
        <br /><em>
         <?php 
        _e("Event posts are put into this category for you. Don't make this your default post category.", 'ec3');
        ?>
        </em>
       </td> 
      </tr> 

       <tr valign="top"> 
        <th width="33%" scope="row"><?php 
        _e('Show times within post content', 'ec3');
        ?>
:</th> 
        <td>
         <select name="ec3_show_event_box">
          <option value='0'<?php 
        if ($ec3->show_event_box == 0) {
            echo " selected='selected'";
        }
        ?>
 >
           <?php 
        _e('Hide Times', 'ec3');
        ?>
          </option>
          <option value='1'<?php 
        if ($ec3->show_event_box == 1) {
            echo " selected='selected'";
        }
        ?>
 >
           <?php 
        _e('List Times', 'ec3');
        ?>
          </option>
          <option value='2'<?php 
        if ($ec3->show_event_box == 2) {
            echo " selected='selected'";
        }
        ?>
 >
           <?php 
        _e('Show Times as Icons', 'ec3');
        ?>
          </option>
         </select>
        </td> 
       </tr>

      <tr valign="top">
       <th width="33%" scope="row"><?php 
        _e('Show events as blog entries', 'ec3');
        ?>
:</th> 
       <td>
        <select name="ec3_advanced">
         <option value='0'<?php 
        if (!$ec3->advanced_setting) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Events are Normal Posts', 'ec3');
        ?>
         </option>
         <option value='1'<?php 
        if ($ec3->advanced_setting) {
            echo " selected='selected'";
        }
        ?>
 >
          <?php 
        _e('Keep Events Separate', 'ec3');
        ?>
         </option>
        </select>
        <br /><em>
         <?php 
        _e('Keep Events Separate: the Event Category page shows future events, in date order. Events do not appear on front page.', 'ec3');
        ?>
        </em>
       </td> 
      </tr>

      <tr valign="top">
      <?php 
        //if($ec3->tz_disabled):
        ?>
      <!-- <th style="color:gray" width="33%" scope="row"><?php 
        // _e('Timezone','ec3');
        ?>
:</th> 
       <td>
         <input disabled="disabled" type="text" value="<?php 
        // if(empty($ec3->tz))
        //     _e('unknown','ec3');
        // else
        //     echo $ec3->tz;
        ?>
" />
         <br /><em>
          <?php 
        php;
        ?>
         </em>
       </td> -->
      <?php 
        //else:
        ?>
       <th width="33%" scope="row"><?php 
        _e('Timezone', 'ec3');
        ?>
:</th> 
       <td>
         <select name="ec3_tz">
          <option value="wordpress">WordPress</option>
          <?php 
        ec3_get_tz_options($ec3->tz);
        ?>
         </select>
       </td> 
      <?php 
        //endif;
        ?>
      </tr>

      <?php 
        $liste_option = $wpdb->get_results("SELECT * FROM {$table_opt}");
        ?>

      <tr valign="top" id="block_liste_option">
        <th width="33%" scope="row"><?php 
        _e('Créer des options sur l\'etat des evenement', 'ec3');
        ?>
:</th> 
        <?php 
        if (count($liste_option) > 0) {
            ?>
          <?php 
            foreach ($liste_option as $value) {
                ?>
            <td class="row_option">

                <label for="nom_option_modif_<?php 
                echo $value->option_id;
                ?>
">Nom :</label>
                <input type="text" name="nom_option_modif_<?php 
                echo $value->option_id;
                ?>
" id="nom_option_modif_<?php 
                echo $value->option_id;
                ?>
" value="<?php 
                echo $value->nom;
                ?>
" >

                <label for="message_option_modif_<?php 
                echo $value->option_id;
                ?>
" >Message :</label>
                <textarea name="message_option_modif_<?php 
                echo $value->option_id;
                ?>
" id="message_option_modif_<?php 
                echo $value->option_id;
                ?>
" cols="40" rows="1" ><?php 
                echo $value->message;
                ?>
</textarea>
                
                <label for="expo_option_modif_<?php 
                echo $value->option_id;
                ?>
">Pour les expo uniquement:</label>
                <input type="checkbox" name="expo_option_modif_<?php 
                echo $value->option_id;
                ?>
" id="expo_option_modif_<?php 
                echo $value->option_id;
                ?>
" value="true" <?php 
                if ($value->post_type_expo == 'true') {
                    echo 'checked="checked"';
                }
                ?>
 >

                <button class="del" >-</button>
            </td>
         <?php 
            }
            ?>
        <?php 
        }
        ?>
            <td class="row_option" id="new_block">
              <button >+</button>
            </td>
        </tr>
        <tr valign="top">
          <th width="33%" scope="row"><?php 
        _e('The slug name of your Agenda', 'ec3');
        ?>
:</th>
          <td class="row_option">
            <input type="text" name="OpenAgandaSlugName" value="<?php 
        echo $OpenAgandaSlugName;
        ?>
" size="40">
            <p>[agenda-slug]: slug of the agenda, found in the url of agenda pages</p>
          </td>
        </tr>
        <tr valign="top">
          <th width="33%" scope="row"><?php 
        _e('Your Key of Open Agenda', 'ec3');
        ?>
:</th>
          <td class="row_option">
            <input type="text" name="OpenAgandaKey" value="<?php 
        echo $OpenAgandaKey;
        ?>
" size="40">
          </td>
        </tr>
        <tr valign="top">
          <th width="33%" scope="row"><?php 
        _e('Your Secret Key of Open Agenda', 'ec3');
        ?>
:</th>
          <td class="row_option">
            <input type="text" name="OpenAgandaSecretKey" value="<?php 
        echo $OpenAgandaSecretKey;
        ?>
" size="40">
          </td>
        </tr>
        <tr valign="top">
          <th width="33%" scope="row"><?php 
        _e('Synchroniser avec Open Agenda', 'ec3');
        ?>
:</th>
          <td class="row_option">
            <button id="syncNow">Synchroniser Maintenant</button>
            <div id="reponseA"></div>
            <p><?php 
        print_r($ec3->tz);
        ?>
</p>
          </td>
        </tr>
     </table>

    <script>
      jQuery(document).ready(function($){
          var nbr = 0;
          //var new_block = $('.new_block_option').html();

          $('#new_block').click(function(e){
              e.preventDefault();
              nbr++;
              $('<td class="row_option">'+
                  '<label for="nom_option_new_'+nbr+'">Nom : </label>'+
                  '<input type="text" name="nom_option_new_'+nbr+'" id="nom_option_new_'+nbr+'" >'+
                  '<label for="message_option_new_'+nbr+'" > Message : </label>'+
                  '<textarea name="message_option_new_'+nbr+'" id="message_option_new_'+nbr+'" cols="40" rows="1"></textarea>'+
                  '<label for="expo_option_new_'+nbr+'">Pour les expo :</label>'+
                  '<input type="checkbox" name="expo_option_new_'+nbr+'" id="expo_option_new_'+nbr+'" value="true">'+
                  '<button class="del" > -</button>'+
                '</td>').insertBefore('#new_block');

              $('button.del').click(function(event){
                event.preventDefault();
                $(this).parent().css({"display":"none"});

                var text_temp = $(this).parent().children('input').attr('name') ;
                text_temp = text_temp.replace( /modif|new/gi ,"delete");
                $(this).parent().children('input').attr('name', text_temp) ;
              }); 
          });

          $('button.del').click(function(event){
              event.preventDefault();
              $(this).parent().css({"display":"none"});

              var text_temp = $(this).parent().children('input').attr('name') ;
              text_temp = text_temp.replace( /modif|new/gi ,"delete");
              $(this).parent().children('input').attr('name', text_temp) ;
          }); 
      });
    </script>

     <p class="submit"><input type="submit" name="info_update"
        value="<?php 
        _e('Save Changes');
        ?>
" /></p>
    </form>

   </div> <?php 
    }