当前位置: 首页>>代码示例>>PHP>>正文


PHP pods_var_raw函数代码示例

本文整理汇总了PHP中pods_var_raw函数的典型用法代码示例。如果您正苦于以下问题:PHP pods_var_raw函数的具体用法?PHP pods_var_raw怎么用?PHP pods_var_raw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pods_var_raw函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: form

 /**
  * Widget Form
  */
 public function form($instance)
 {
     $title = pods_var_raw('title', $instance, '');
     $pod_type = pods_var_raw('pod_type', $instance, '');
     $slug = pods_var_raw('slug', $instance, '');
     $field = pods_var_raw('field', $instance, '');
     require PODS_DIR . 'ui/admin/widgets/field.php';
 }
开发者ID:dylansmithing,项目名称:leader-of-rock-wordpress,代码行数:11,代码来源:PodsWidgetField.php

示例2: form

 /**
  * Widget Form
  */
 public function form($instance)
 {
     $title = pods_var_raw('title', $instance, '');
     $view = pods_var_raw('view', $instance, '');
     $expires = (int) pods_var_raw('expires', $instance, 60 * 5);
     $cache_mode = pods_var_raw('cache_mode', $instance, 'none', null, true);
     require PODS_DIR . 'ui/admin/widgets/view.php';
 }
开发者ID:centaurustech,项目名称:chipin,代码行数:11,代码来源:PodsWidgetView.php

示例3: form

 /**
  * Widget Form
  */
 public function form($instance)
 {
     $title = pods_var_raw('title', $instance, '');
     $slug = pods_var_raw('slug', $instance, '');
     $pod_type = pods_var_raw('pod_type', $instance, '');
     $template = pods_var_raw('template', $instance, '');
     $template_custom = pods_var_raw('template_custom', $instance, '');
     require PODS_DIR . 'ui/admin/widgets/single.php';
 }
开发者ID:centaurustech,项目名称:chipin,代码行数:12,代码来源:PodsWidgetSingle.php

示例4: form

 public function form($instance)
 {
     $title = pods_var_raw('title', $instance, '');
     $pod_type = pods_var_raw('pod_type', $instance, '');
     $slug = pods_var_raw('slug', $instance, '');
     $fields = pods_var_raw('fields', $instance, '');
     $label = pods_var_raw('label', $instance, __('Submit', 'pods'), null, true);
     $thank_you = pods_var_raw('thank_you', $instance, '');
     require PODS_DIR . 'ui/admin/widgets/form.php';
 }
开发者ID:centaurustech,项目名称:chipin,代码行数:10,代码来源:PodsWidgetForm.php

示例5: form

 /**
  * Widget Form
  */
 public function form($instance)
 {
     $title = pods_var_raw('title', $instance, '');
     $pod_type = pods_var_raw('pod_type', $instance, '');
     $template = pods_var_raw('template', $instance, '');
     $template_custom = pods_var_raw('template_custom', $instance, '');
     $limit = (int) pods_var_raw('limit', $instance, 15, null, true);
     $orderby = pods_var_raw('orderby', $instance, '');
     $where = pods_var_raw('where', $instance, '');
     $expires = (int) pods_var_raw('expires', $instance, 60 * 5);
     $cache_mode = pods_var_raw('cache_mode', $instance, 'none');
     require PODS_DIR . 'ui/admin/widgets/list.php';
 }
开发者ID:centaurustech,项目名称:chipin,代码行数:16,代码来源:PodsWidgetList.php

示例6: view

 /**
  * @static
  *
  * @param string $view Path of the view file
  * @param array|null $data (optional) Data to pass on to the template
  * @param bool|int|array $expires (optional) Time in seconds for the cache to expire, if 0 caching is disabled.
  * @param string $cache_mode (optional) Decides the caching method to use for the view.
  *
  * @return bool|mixed|null|string|void
  *
  * @since 2.0
  */
 public static function view($view, $data = null, $expires = false, $cache_mode = 'cache')
 {
     // Different $expires if user is anonymous or logged in or specific capability
     if (is_array($expires)) {
         $anon = pods_var_raw(0, $expires, false);
         $user = pods_var_raw(1, $expires, false);
         $capability = pods_var_raw(2, $expires, null, null, true);
         $expires = pods_var_user($anon, $user, $capability);
     }
     if ('none' == $cache_mode) {
         $expires = false;
     }
     if (false !== $expires && empty($expires)) {
         $expires = 0;
     }
     if (!in_array($cache_mode, self::$cache_modes)) {
         $cache_mode = 'cache';
     }
     $view = apply_filters('pods_view_inc', $view, $data, $expires, $cache_mode);
     $view_key = $view;
     if (is_array($view_key)) {
         $view_key = implode('-', $view_key) . '.php';
     }
     $view_key = realpath($view_key);
     $pods_ui_dir = realpath(PODS_DIR . 'ui/');
     $pods_components_dir = realpath(PODS_DIR . 'components/');
     $content_dir = realpath(WP_CONTENT_DIR);
     $plugins_dir = realpath(WP_PLUGIN_DIR);
     $abspath_dir = realpath(ABSPATH);
     $cache_key = sanitize_title(pods_str_replace(array($pods_ui_dir, $pods_components_dir, $content_dir, $plugins_dir, $abspath_dir, '.php', '/'), array('ui-', 'ui-', 'custom-', 'custom-', 'custom-', '', '_'), $view_key, 1));
     $output = false;
     if (false !== $expires && false === strpos($view_key, $pods_ui_dir) && false === strpos($view_key, $pods_components_dir) && false === strpos($view_key, $content_dir) && false === strpos($view_key, $plugins_dir) && false === strpos($view_key, $abspath_dir)) {
         $output = self::get('pods-view-' . $cache_key, $cache_mode, 'pods_view');
     }
     if (false === $output || null === $output) {
         $output = self::get_template_part($view, $data);
     }
     if (false !== $output && false !== $expires) {
         self::set('pods-view-' . $cache_key, $output, $expires, $cache_mode, 'pods_view');
     }
     $output = apply_filters('pods_view_output_' . $cache_key, $output, $view, $data, $expires, $cache_mode);
     $output = apply_filters('pods_view_output', $output, $view, $data, $expires, $cache_mode);
     return $output;
 }
开发者ID:centaurustech,项目名称:chipin,代码行数:56,代码来源:PodsView.php

示例7: ucwords

                                    <div class="clear"></div>
                                </div>
                                <!-- /#major-publishing-actions -->
                            </div>
                            <!-- /#submitpost -->
                        </div>
                        <!-- /.inside -->
                    </div>
                    <!-- /#submitdiv --><!-- END PUBLISH DIV --><!-- TODO: minor column fields -->
                    <?php 
if (pods_var_raw('action') == 'edit' && !$duplicate && !in_array('navigate', $obj->actions_disabled) && !in_array('navigate', $obj->actions_hidden)) {
    if (!isset($singular_label)) {
        $singular_label = ucwords(str_replace('_', ' ', $pod->pod_data['name']));
    }
    $singular_label = pods_var_raw('label', $pod->pod_data['options'], $singular_label, null, true);
    $singular_label = pods_var_raw('label_singular', $pod->pod_data['options'], $singular_label, null, true);
    $prev = $pod->prev_id();
    $next = $pod->next_id();
    if (0 < $prev || 0 < $next) {
        ?>
                    <div id="navigatediv" class="postbox">
                        <div class="handlediv" title="Click to toggle"><br /></div>
                        <h3 class="hndle"><span><?php 
        _e('Navigate', 'pods');
        ?>
</span></h3>

                        <div class="inside">
                            <div class="pods-admin" id="navigatebox">
                                <div id="navigation-actions">
                                    <?php 
开发者ID:Ingenex,项目名称:redesign,代码行数:31,代码来源:form.php

示例8: wp_create_nonce

$attributes['value'] = $value;
$attributes['data-field-type'] = 'select2';
$attributes['tabindex'] = 2;
$attributes = PodsForm::merge_attributes($attributes, $name, $form_field_type, $options);
$attributes['class'] .= ' pods-form-ui-field-type-select2';
$uri_hash = wp_create_nonce('pods_uri_' . $_SERVER['REQUEST_URI']);
$uid = @session_id();
if (is_user_logged_in()) {
    $uid = 'user_' . get_current_user_id();
}
$field_nonce = wp_create_nonce('pods_relationship_' . (!is_object($pod) ? '0' : $pod->pod_id) . '_' . $uid . '_' . $uri_hash . '_' . $options['id']);
$pick_limit = (int) pods_var($form_field_type . '_limit', $options, 0);
if ('multi' == pods_var($form_field_type . '_format_type', $options) && 1 != $pick_limit) {
    wp_enqueue_script('jquery-ui-sortable');
}
$options['data'] = (array) pods_var_raw('data', $options, array(), null, true);
?>
<div class="pods-select2">
    <input<?php 
PodsForm::attributes($attributes, $name, $form_field_type, $options);
?>
 />
</div>

<script type="text/javascript">
    jQuery( function ( $ ) {
        if ( 'undefined' == typeof ajaxurl ) {
            var ajaxurl = '<?php 
echo pods_slash(admin_url('admin-ajax.php'));
?>
';
开发者ID:dylansmithing,项目名称:leader-of-rock-wordpress,代码行数:31,代码来源:select2.php

示例9: ui

 /**
  *
  * Generate UI for Data Management
  *
  * @param mixed $options Array or String containing Pod or Options to be used
  * @param bool $amend Whether to amend the default UI options or replace entirely
  *
  * @return PodsUI|void UI object or void if custom UI used
  *
  * @since 2.3.10
  */
 public function ui($options = null, $amend = false)
 {
     $num = '';
     if (empty($options)) {
         $options = array();
     } else {
         $num = pods_var('num', $options, '');
         if (empty($num)) {
             $num = '';
         }
     }
     if ($this->id() != pods_var('id' . $num, 'get', null, null, true)) {
         $this->fetch(pods_var('id' . $num, 'get', null, null, true));
     }
     if (!empty($options) && !$amend) {
         $this->ui = $options;
         return pods_ui($this);
     } elseif (!empty($options) || 'custom' != pods_var('ui_style', $this->pod_data['options'], 'post_type', null, true)) {
         $actions_enabled = pods_var_raw('ui_actions_enabled', $this->pod_data['options']);
         if (!empty($actions_enabled)) {
             $actions_enabled = (array) $actions_enabled;
         } else {
             $actions_enabled = array();
         }
         $available_actions = array('add', 'edit', 'duplicate', 'delete', 'reorder', 'export');
         if (!empty($actions_enabled)) {
             $actions_disabled = array('view' => 'view');
             foreach ($available_actions as $action) {
                 if (!in_array($action, $actions_enabled)) {
                     $actions_disabled[$action] = $action;
                 }
             }
         } else {
             $actions_disabled = array('duplicate' => 'duplicate', 'view' => 'view', 'export' => 'export');
             if (1 == pods_var('ui_export', $this->pod_data['options'], 0)) {
                 unset($actions_disabled['export']);
             }
         }
         if (empty($options)) {
             $author_restrict = false;
             if (isset($this->fields['author']) && 'pick' == $this->fields['author']['type'] && 'user' == $this->fields['author']['pick_object']) {
                 $author_restrict = 'author.ID';
             }
             if (!pods_is_admin(array('pods', 'pods_content'))) {
                 if (!current_user_can('pods_add_' . $this->pod)) {
                     $actions_disabled['add'] = 'add';
                     if ('add' == pods_var('action' . $num, 'get')) {
                         $_GET['action' . $num] = 'manage';
                     }
                 }
                 if (!$author_restrict && !current_user_can('pods_edit_' . $this->pod) && !current_user_can('pods_edit_others_' . $this->pod)) {
                     $actions_disabled['edit'] = 'edit';
                 }
                 if (!$author_restrict && !current_user_can('pods_delete_' . $this->pod) && !current_user_can('pods_delete_others_' . $this->pod)) {
                     $actions_disabled['delete'] = 'delete';
                 }
                 if (!current_user_can('pods_reorder_' . $this->pod)) {
                     $actions_disabled['reorder'] = 'reorder';
                 }
                 if (!current_user_can('pods_export_' . $this->pod)) {
                     $actions_disabled['export'] = 'export';
                 }
             }
         }
         $_GET['action' . $num] = pods_var('action' . $num, 'get', pods_var('action', $options, 'manage'));
         $index = $this->pod_data['field_id'];
         $label = __('ID', 'pods');
         if (isset($this->pod_data['fields'][$this->pod_data['field_index']])) {
             $index = $this->pod_data['field_index'];
             $label = $this->pod_data['fields'][$this->pod_data['field_index']];
         }
         $manage = array($index => $label);
         if (isset($this->pod_data['fields']['modified'])) {
             $manage['modified'] = $this->pod_data['fields']['modified']['label'];
         }
         $manage_fields = pods_var_raw('ui_fields_manage', $this->pod_data['options']);
         if (!empty($manage_fields)) {
             $manage_new = array();
             foreach ($manage_fields as $manage_field) {
                 if (isset($this->pod_data['fields'][$manage_field])) {
                     $manage_new[$manage_field] = $this->pod_data['fields'][$manage_field];
                 } elseif (isset($this->pod_data['object_fields'][$manage_field])) {
                     $manage_new[$manage_field] = $this->pod_data['object_fields'][$manage_field];
                 } elseif ($manage_field == $this->pod_data['field_id']) {
                     $field = array('name' => $manage_field, 'label' => 'ID', 'type' => 'number', 'width' => '8%');
                     $manage_new[$manage_field] = PodsForm::field_setup($field, null, $field['type']);
                 }
             }
             if (!empty($manage_new)) {
//.........这里部分代码省略.........
开发者ID:erkmen,项目名称:wpstartersetup,代码行数:101,代码来源:Pods.php

示例10: get_object_data

 /**
  * Get data from relationship objects
  *
  * @param array $object_params Object data parameters
  *
  * @return array|bool Object data
  */
 public function get_object_data($object_params = null)
 {
     global $wpdb, $polylang, $sitepress, $icl_adjust_id_url_filter_off;
     $current_language = false;
     // WPML support
     if (is_object($sitepress) && !$icl_adjust_id_url_filter_off) {
         $current_language = pods_sanitize(ICL_LANGUAGE_CODE);
     } elseif (function_exists('pll_current_language')) {
         $current_language = pll_current_language('slug');
     }
     $object_params = array_merge(array('name' => '', 'value' => '', 'options' => array(), 'pod' => '', 'id' => '', 'context' => '', 'data_params' => array('query' => ''), 'page' => 1, 'limit' => 0), $object_params);
     $name = $object_params['name'];
     $value = $object_params['value'];
     $options = $object_params['options'] = (array) $object_params['options'];
     $pod = $object_params['pod'];
     $id = $object_params['id'];
     $context = $object_params['context'];
     $data_params = $object_params['data_params'] = (array) $object_params['data_params'];
     $page = min(1, (int) $object_params['page']);
     $limit = (int) $object_params['limit'];
     if (isset($options['options'])) {
         $options = array_merge($options, $options['options']);
         unset($options['options']);
     }
     $data = apply_filters('pods_field_pick_object_data', null, $name, $value, $options, $pod, $id, $object_params);
     $items = array();
     if (!isset($options[self::$type . '_object'])) {
         $data = pods_var_raw('data', $options, array(), null, true);
     }
     $simple = false;
     if (null === $data) {
         $data = array();
         if ('custom-simple' == $options[self::$type . '_object']) {
             $custom = pods_var_raw(self::$type . '_custom', $options, '');
             $custom = apply_filters('pods_form_ui_field_pick_custom_values', $custom, $name, $value, $options, $pod, $id, $object_params);
             if (!empty($custom)) {
                 if (!is_array($custom)) {
                     $data = array();
                     $custom = explode("\n", trim($custom));
                     foreach ($custom as $custom_value) {
                         $custom_label = explode('|', $custom_value);
                         if (empty($custom_label)) {
                             continue;
                         }
                         if (1 == count($custom_label)) {
                             $custom_label = $custom_value;
                         } else {
                             $custom_value = $custom_label[0];
                             $custom_label = $custom_label[1];
                         }
                         $custom_value = trim((string) $custom_value);
                         $custom_label = trim((string) $custom_label);
                         $data[$custom_value] = $custom_label;
                     }
                 } else {
                     $data = $custom;
                 }
                 $simple = true;
             }
         } elseif (isset(self::$related_objects[$options[self::$type . '_object']]) && isset(self::$related_objects[$options[self::$type . '_object']]['data']) && !empty(self::$related_objects[$options[self::$type . '_object']]['data'])) {
             $data = self::$related_objects[$options[self::$type . '_object']]['data'];
             $simple = true;
         } elseif (isset(self::$related_objects[$options[self::$type . '_object']]) && isset(self::$related_objects[$options[self::$type . '_object']]['data_callback']) && is_callable(self::$related_objects[$options[self::$type . '_object']]['data_callback'])) {
             $data = call_user_func_array(self::$related_objects[$options[self::$type . '_object']]['data_callback'], array($name, $value, $options, $pod, $id));
             $simple = true;
             // Cache data from callback
             if (!empty($data)) {
                 self::$related_objects[$options[self::$type . '_object']]['data'] = $data;
             }
         } elseif ('simple_value' != $context) {
             $pick_val = pods_var(self::$type . '_val', $options);
             if ('table' == pods_var(self::$type . '_object', $options)) {
                 $pick_val = pods_var(self::$type . '_table', $options, $pick_val, null, true);
             }
             if ('__current__' == $pick_val) {
                 if (is_object($pod)) {
                     $pick_val = $pod->pod;
                 } elseif (is_array($pod)) {
                     $pick_val = $pod['name'];
                 } elseif (0 < strlen($pod)) {
                     $pick_val = $pod;
                 }
             }
             $options['table_info'] = pods_api()->get_table_info(pods_var(self::$type . '_object', $options), $pick_val, null, null, $options);
             $search_data = pods_data();
             $search_data->table($options['table_info']);
             if (isset($options['table_info']['pod']) && !empty($options['table_info']['pod']) && isset($options['table_info']['pod']['name'])) {
                 $search_data->pod = $options['table_info']['pod']['name'];
                 $search_data->fields = $options['table_info']['pod']['fields'];
             }
             $params = array('select' => "`t`.`{$search_data->field_id}`, `t`.`{$search_data->field_index}`", 'table' => $search_data->table, 'where' => pods_var_raw(self::$type . '_where', $options, (array) $options['table_info']['where_default'], null, true), 'orderby' => pods_var_raw(self::$type . '_orderby', $options, null, null, true), 'groupby' => pods_var_raw(self::$type . '_groupby', $options, null, null, true), 'pagination' => false, 'search' => false);
             if (in_array($options[self::$type . '_object'], array('site', 'network'))) {
                 $params['select'] .= ', `t`.`path`';
//.........这里部分代码省略.........
开发者ID:dylansmithing,项目名称:leader-of-rock-wordpress,代码行数:101,代码来源:pick.php

示例11: ui

 /**
  * Customize the Pods UI manage table column output
  *
  * @param int $id
  * @param mixed $value
  * @param string $name
  * @param array $options
  * @param array $fields
  * @param array $pod
  *
  * @since 2.0
  */
 public function ui($id, $value, $name = null, $options = null, $fields = null, $pod = null)
 {
     $yesno = array(1 => pods_var_raw(self::$type . '_yes_label', $options, __('Yes', 'pods'), null, true), 0 => pods_var_raw(self::$type . '_no_label', $options, __('No', 'pods'), null, true));
     if (isset($yesno[(int) $value])) {
         $value = strip_tags($yesno[(int) $value], '<strong><a><em><span><img>');
     }
     return $value;
 }
开发者ID:dylansmithing,项目名称:leader-of-rock-wordpress,代码行数:20,代码来源:boolean.php

示例12: process_form

 /**
  * Process a Pod-based form
  *
  * @param mixed $params
  * @param object $obj Pod object
  * @param array $fields Fields being submitted in form ( key => settings )
  * @param string $thank_you URL to send to upon success
  *
  * @return mixed
  *
  * @since 2.0
  */
 public function process_form($params, $obj = null, $fields = null, $thank_you = null)
 {
     $this->display_errors = false;
     $form = null;
     $nonce = pods_var('_pods_nonce', $params);
     $pod = pods_var('_pods_pod', $params);
     $id = pods_var('_pods_id', $params);
     $uri = pods_var('_pods_uri', $params);
     $form = pods_var('_pods_form', $params);
     $location = pods_var('_pods_location', $params);
     if (is_object($obj)) {
         $pod = $obj->pod;
         $id = $obj->id();
     }
     if (!empty($fields)) {
         $fields = array_keys($fields);
         $form = implode(',', $fields);
     } else {
         $fields = explode(',', $form);
     }
     if (empty($nonce) || empty($pod) || empty($uri) || empty($fields)) {
         return pods_error(__('Invalid submission', 'pods'), $this);
     }
     $uid = @session_id();
     if (is_user_logged_in()) {
         $uid = 'user_' . get_current_user_id();
     }
     $field_hash = wp_create_nonce('pods_fields_' . $form);
     $action = 'pods_form_' . $pod . '_' . $uid . '_' . $id . '_' . $uri . '_' . $field_hash;
     if (empty($uid)) {
         return pods_error(__('Access denied for your session, please refresh and try again.', 'pods'), $this);
     }
     if (false === wp_verify_nonce($nonce, $action)) {
         return pods_error(__('Access denied, please refresh and try again.', 'pods'), $this);
     }
     $data = array();
     foreach ($fields as $field) {
         $data[$field] = pods_var_raw('pods_field_' . $field, $params, '');
     }
     $params = array('pod' => $pod, 'id' => $id, 'data' => $data, 'from' => 'process_form', 'location' => $location);
     $id = $this->save_pod_item($params);
     if (0 < $id && !empty($thank_you)) {
         $thank_you = str_replace('X_ID_X', $id, $thank_you);
         pods_redirect($thank_you);
     }
     return $id;
 }
开发者ID:satokora,项目名称:IT354Project,代码行数:59,代码来源:PodsAPI.php

示例13: wp_get_attachment_image_src

    }
    $thumb = wp_get_attachment_image_src($val, 'thumbnail', true);
    $title = $attachment->post_title;
    if (0 == $title_editable) {
        $title = basename($attachment->guid);
    }
    echo $field_file->markup($attributes, $file_limit, $title_editable, $val, $thumb[0], $title);
}
?>
</ul>

    <a class="button pods-file-add pods-media-add" id="<?php 
echo $css_id;
?>
-upload" href="#" tabindex="2"><?php 
echo pods_var_raw($form_field_type . '_add_button', $options, __('Add File', 'pods'));
?>
</a>

    <ul class="pods-files pods-files-queue"></ul>
</div>

<script type="text/x-handlebars" id="<?php 
echo $css_id;
?>
-handlebars">
    <?php 
echo $field_file->markup($attributes, $file_limit, $title_editable);
?>
</script>
开发者ID:Ingenex,项目名称:redesign,代码行数:30,代码来源:plupload.php

示例14: admin_capabilities

 /**
  * Add pods specific capabilities.
  *
  * @param $capabilities List of extra capabilities to add
  *
  * @return array
  */
 public function admin_capabilities($capabilities)
 {
     $pods = pods_api()->load_pods(array('type' => array('pod', 'table', 'post_type', 'taxonomy', 'settings')));
     $capabilities[] = 'pods';
     $capabilities[] = 'pods_content';
     $capabilities[] = 'pods_settings';
     $capabilities[] = 'pods_components';
     foreach ($pods as $pod) {
         if ('settings' == $pod['type']) {
             $capabilities[] = 'pods_edit_' . $pod['name'];
         } elseif ('post_type' == $pod['type']) {
             $capability_type = pods_var('capability_type_custom', $pod['options'], pods_var_raw('name', $pod));
             if ('custom' == pods_var('capability_type', $pod['options']) && 0 < strlen($capability_type)) {
                 $capabilities[] = 'read_' . $capability_type;
                 $capabilities[] = 'edit_' . $capability_type;
                 $capabilities[] = 'delete_' . $capability_type;
                 if (1 == pods_var('capability_type_extra', $pod['options'], 1)) {
                     $capabilities[] = 'read_private_' . $capability_type . 's';
                     $capabilities[] = 'edit_' . $capability_type . 's';
                     $capabilities[] = 'edit_others_' . $capability_type . 's';
                     $capabilities[] = 'edit_private_' . $capability_type . 's';
                     $capabilities[] = 'edit_published_' . $capability_type . 's';
                     $capabilities[] = 'publish_' . $capability_type . 's';
                     $capabilities[] = 'delete_' . $capability_type . 's';
                     $capabilities[] = 'delete_private_' . $capability_type . 's';
                     $capabilities[] = 'delete_published_' . $capability_type . 's';
                     $capabilities[] = 'delete_others_' . $capability_type . 's';
                 }
             }
         } elseif ('taxonomy' == $pod['type']) {
             if (1 == pods_var('capabilities', $pod['options'], 0)) {
                 $capability_type = pods_var('capability_type_custom', $pod['options'], pods_var_raw('name', $pod) . 's');
                 $capabilities[] = 'manage_' . $capability_type;
                 $capabilities[] = 'edit_' . $capability_type;
                 $capabilities[] = 'delete_' . $capability_type;
                 $capabilities[] = 'assign_' . $capability_type;
             }
         } else {
             $capabilities[] = 'pods_add_' . $pod['name'];
             $capabilities[] = 'pods_edit_' . $pod['name'];
             if (isset($pod['fields']['author']) && 'pick' == $pod['fields']['author']['type'] && 'user' == $pod['fields']['author']['pick_object']) {
                 $capabilities[] = 'pods_edit_others_' . $pod['name'];
             }
             $capabilities[] = 'pods_delete_' . $pod['name'];
             if (isset($pod['fields']['author']) && 'pick' == $pod['fields']['author']['type'] && 'user' == $pod['fields']['author']['pick_object']) {
                 $capabilities[] = 'pods_delete_others_' . $pod['name'];
             }
             $actions_enabled = pods_var_raw('ui_actions_enabled', $pod['options']);
             if (!empty($actions_enabled)) {
                 $actions_enabled = (array) $actions_enabled;
             } else {
                 $actions_enabled = array();
             }
             $available_actions = array('add', 'edit', 'duplicate', 'delete', 'reorder', 'export');
             if (!empty($actions_enabled)) {
                 $actions_disabled = array('view' => 'view');
                 foreach ($available_actions as $action) {
                     if (!in_array($action, $actions_enabled)) {
                         $actions_disabled[$action] = $action;
                     }
                 }
                 if (!in_array('export', $actions_disabled)) {
                     $capabilities[] = 'pods_export_' . $pod['name'];
                 }
                 if (!in_array('reorder', $actions_disabled)) {
                     $capabilities[] = 'pods_reorder_' . $pod['name'];
                 }
             } elseif (1 == pods_var('ui_export', $pod['options'], 0)) {
                 $capabilities[] = 'pods_export_' . $pod['name'];
             }
         }
     }
     return $capabilities;
 }
开发者ID:erkmen,项目名称:wpstartersetup,代码行数:81,代码来源:PodsAdmin.php

示例15: table

    /**
     * @param bool $reorder
     *
     * @return bool|mixed
     */
    public function table($reorder = false)
    {
        if (false !== $this->callback('table', $reorder)) {
            return null;
        }
        if (empty($this->data)) {
            ?>
        <p><?php 
            echo sprintf(__('No %s found', 'pods'), $this->items);
            ?>
</p>
        <?php 
            return false;
        }
        if (true === $reorder && !in_array('reorder', $this->actions_disabled) && false !== $this->reorder['on']) {
            ?>
        <style type="text/css">
            table.widefat.fixed tbody.reorderable tr {
                height: 50px;
            }

            .dragme {
                background: url(<?php 
            echo esc_url(PODS_URL);
            ?>
/ui/images/handle.gif) no-repeat;
                background-position: 8px 8px;
                cursor: pointer;
            }

            .dragme strong {
                margin-left: 30px;
            }
        </style>
<form action="<?php 
            echo esc_url(pods_query_arg(array('action' . $this->num => 'reorder', 'do' . $this->num => 'save', 'page' => pods_var_raw('page')), self::$allowed, $this->exclusion()));
            ?>
" method="post" class="admin_ui_reorder_form">
<?php 
        }
        $table_fields = $this->fields['manage'];
        if (true === $reorder && !in_array('reorder', $this->actions_disabled) && false !== $this->reorder['on']) {
            $table_fields = $this->fields['reorder'];
        }
        if (false === $table_fields || empty($table_fields)) {
            return $this->error(__('<strong>Error:</strong> Invalid Configuration - Missing "fields" definition.', 'pods'));
        }
        ?>
        <table class="widefat page fixed wp-list-table" cellspacing="0"<?php 
        echo 1 == $reorder && $this->reorder ? ' id="admin_ui_reorder"' : '';
        ?>
>
            <thead>
                <tr>
                    <?php 
        if (!empty($this->actions_bulk)) {
            ?>
                            <th scope="col" id="cb" class="manage-column column-cb check-column"><input type="checkbox" /></th>
            <?php 
        }
        $name_field = false;
        $fields = array();
        if (!empty($table_fields)) {
            foreach ($table_fields as $field => $attributes) {
                if (false === $attributes['display']) {
                    continue;
                }
                if (false === $name_field) {
                    $id = 'title';
                } else {
                    $id = '';
                }
                if ('other' == $attributes['type']) {
                    $id = '';
                }
                if (in_array($attributes['type'], array('date', 'datetime', 'time'))) {
                    $id = 'date';
                }
                if (false === $name_field && 'title' == $id) {
                    $name_field = true;
                }
                $fields[$field] = $attributes;
                $fields[$field]['field_id'] = $id;
                $dir = 'DESC';
                $current_sort = ' asc';
                if (isset($this->orderby['default']) && $field == $this->orderby['default']) {
                    if ('DESC' == $this->orderby_dir) {
                        $dir = 'ASC';
                        $current_sort = ' desc';
                    }
                }
                $att_id = '';
                if (!empty($id)) {
                    $att_id = ' id="' . esc_attr($id) . '"';
                }
//.........这里部分代码省略.........
开发者ID:dylansmithing,项目名称:leader-of-rock-wordpress,代码行数:101,代码来源:PodsUI.php


注:本文中的pods_var_raw函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。