/**
     * print the edit form header
     * 
     * @return null
     */
    protected function print_header()
    {
        ?>
    <div class="wrap participants_db">
      <?php 
        Participants_Db::admin_page_heading();
        ?>
      <h3><?php 
        _e('Manage Database Fields', 'participants-database');
        ?>
</h3>
      <?php 
        Participants_Db::admin_message();
        ?>
      <h4><?php 
        _e('Field Groups', 'participants-database');
        ?>
:</h4>
      <div id="fields-tabs">
        <ul>
          <?php 
        $mask = '<span class="mask"></span>';
        foreach ($this->groups as $group) {
            echo '<li><a href="#' . $group . '" id="tab_' . $group . '">' . $this->group_titles[$group] . '</a>' . $mask . '</li>';
        }
        echo '<li class="utility"><a href="#field_groups">' . __('Field Groups', 'participants-database') . '</a>' . $mask . '</li>';
        echo '<li class="utility"><a href="#help">' . __('Help', 'participants-database') . '</a>' . $mask . '</li>';
        ?>
        </ul>
        <?php 
    }
Пример #2
0
        /**
         * renders the plugin settings page
         * 
         * this generic rendering is expected to be overridden in the subclass
         */
        function render_settings_page()
        {
            ?>
    <div class="wrap" >
  
        <?php 
            Participants_Db::admin_page_heading();
            ?>
  
        <h2><?php 
            echo $this->aux_plugin_title;
            ?>
</h2>
  
        <?php 
            settings_errors();
            ?>
  
  
        <form method="post" action="options.php">  
            <?php 
            settings_fields($this->aux_plugin_name . '_settings');
            do_settings_sections($this->aux_plugin_name);
            submit_button();
            ?>
  
        </form>  
  
    </div><!-- /.wrap -->  
    <?php 
        }
Пример #3
0
    $select_columns = $group === 'internal' ? '`id`,`order`,`name`,`title`,`admin_column`,`sortable`,`CSV`' : '*';
    $sql = "SELECT {$select_columns} FROM " . Participants_Db::$fields_table . ' WHERE `group` = "' . $group . '" ORDER BY `order` ';
    $database_rows[$group] = $wpdb->get_results($sql, ARRAY_A);
    // get an array of the field attributes
    $attribute_columns[$group] = $wpdb->get_col_info('name');
    $group_title = $wpdb->get_var('SELECT `title` FROM ' . Participants_Db::$groups_table . ' WHERE `name` = "' . $group . '"');
    $group_titles[$group] = empty($group_title) ? ucwords(str_replace('_', ' ', $group)) : $group_title;
    // remove read-only fields
    foreach (array('id') as $item) {
        unset($attribute_columns[$group][array_search($item, $attribute_columns)]);
    }
}
?>
<div class="wrap participants_db">
  <?php 
Participants_Db::admin_page_heading();
?>
  <h3><?php 
_e('Manage Database Fields', 'participants-database');
?>
</h3>
  <?php 
if (!empty($error_msgs)) {
    ?>
    <div class="error settings-error">
      <?php 
    foreach ($error_msgs as $error) {
        echo '<p>' . $error . '</p>';
    }
    ?>
    </div>
Пример #4
0
    /**
     * displays a settings page form using the WP Settings API
     *
     * this function is called by the plugin on it's settings page
     *
     * @return null
     */
    public function show_settings_form()
    {
        ?>
    <div class="wrap participants_db settings-class">
      <?php 
        Participants_Db::admin_page_heading(Participants_Db::$plugin_title . ' ' . __('Settings', 'participants-database'));
        ?>
      <?php 
        settings_errors();
        ?>
      <form action="options.php" method="post" >
        <div class="ui-tabs">
          <?php 
        /* ?>
           <h2 class="nav-tab-wrapper">
             <?php foreach ($this->sections as $id => $title)
               printf('<a class="nav-tab" href="#%s">%s</a>', Participants_Db::make_anchor($id), $title);
             ?>
           </h2>
           <?php */
        ?>
          <ul class="ui-tabs-nav">
            <?php 
        foreach ($this->sections as $id => $title) {
            printf('<li><a href="#%s">%s</a></li>', Participants_Db::make_anchor($id), $title);
        }
        ?>
          </ul>
          <?php 
        settings_fields($this->WP_setting);
        do_settings_sections($this->settings_page);
        ?>
        </div>

        <?php 
        $args = array('type' => 'submit', 'class' => $this->submit_class, 'value' => $this->submit_button, 'name' => 'submit');
        printf($this->submit_wrap, PDb_FormElement::get_element($args));
        ?>
      </form>

    </div>
    <?php 
    }
Пример #5
0
    /**
     * top section for admin listing
     */
    private static function _admin_top()
    {
        ?>
    <script type="text/javascript" language="javascript">

      var L10n = {
        "record": "<?php 
        _e("Do you really want to delete the selected record?", 'participants-database');
        ?>
",
        "records": "<?php 
        _e("Do you really want to delete the selected records?", 'participants-database');
        ?>
"
      },
      check_state = false;

      window.onload = function() {
        armDelbutton(false)
      };

      function delete_confirm() {
        var plural = (document.getElementById('select_count').value > 1) ? true : false;
        var x = window.confirm(plural ? L10n.records : L10n.record);
        armDelbutton(x);
        check_state = !x;
        return x;
      }

      function checkedAll() {
        var form = document.getElementById('list_form');
        if (check_state == false) {
          check_state = true
        } else {
          check_state = false;
          armDelbutton(false);
        }
        for (var i = 0; i < form.elements.length; i++) {
          if (form.elements[i].type == 'checkbox' && form.elements[i].name != 'checkall' && form.elements[i].checked != check_state) {
            form.elements[i].checked = check_state;
            addSelects(check_state);
          }
        }
      }

      function addSelects(selected) {
        var count_element = document.getElementById('select_count');
        var count = count_element.value;
        if (selected === true)
          count++;
        else {
          count--;
          document.getElementById('checkall').checked = false;
        }
        if (count < 0)
          count = 0;
        armDelbutton(count > 0);
        count_element.value = count;
      }

      function armDelbutton(state) {
        var delbutton = document.getElementById('delete_button');
        delbutton.setAttribute('class', state ? delbutton.getAttribute('class').replace('unarmed', 'armed') : delbutton.getAttribute('class').replace('armed', 'unarmed'));
        delbutton.disabled = state ? false : true;
      }


      function checkEnter(e) {
        e = e || event;
        return (e.keyCode || event.which || event.charCode || 0) !== 13;
      }

    </script>
    <div  class="wrap participants_db">
    <a id="pdb-list-admin" name="pdb-list-admin"></a>
      <?php 
        Participants_Db::admin_page_heading();
        ?>
    <div id="poststuff">
      <div class="post-body">
          <h2><?php 
        _e('List Participants', 'participants-database');
        ?>
</h2>
          <h3><?php 
        printf(_n('%s record found, sorted by:', '%s records found, sorted by:', self::$num_records, 'participants-database'), "\n" . self::$num_records);
        ?>
 
          <?php 
        echo Participants_Db::column_title(self::$filter['sortBy']);
        ?>
.</h3>
    <?php 
    }
    /**
     * top section for admin listing
     */
    private static function _admin_top()
    {
        ?>
    <div id="pdb-list-admin"   class="wrap participants_db">
      <?php 
        Participants_Db::admin_page_heading();
        ?>
    <div id="poststuff">
      <div class="post-body">
          <h2><?php 
        _e('List Participants', 'participants-database');
        ?>
</h2>
    <?php 
    }