本文整理汇总了PHP中Essential_Grid_Base::shuffle_assoc方法的典型用法代码示例。如果您正苦于以下问题:PHP Essential_Grid_Base::shuffle_assoc方法的具体用法?PHP Essential_Grid_Base::shuffle_assoc怎么用?PHP Essential_Grid_Base::shuffle_assoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Essential_Grid_Base
的用法示例。
在下文中一共展示了Essential_Grid_Base::shuffle_assoc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output_by_custom
//.........这里部分代码省略.........
//set order of filter
$navigation_c->set_orders_text($sort_by_text);
$navigation_c->set_orders_start($order_by_start);
//set order of filter
}
$item_skin->init_by_id($base->getVar($this->grid_params, 'entry-skin', 0, 'i'));
$lazy_load = $base->getVar($this->grid_params, 'lazy-loading', 'off');
if ($lazy_load == 'on') {
$item_skin->set_lazy_load(true);
}
$default_media_source_order = $base->getVar($this->grid_postparams, 'media-source-order', '');
$item_skin->set_default_media_source_order($default_media_source_order);
$default_lightbox_source_order = $base->getVar($this->grid_params, 'lb-source-order', '');
$item_skin->set_default_lightbox_source_order($default_lightbox_source_order);
$default_aj_source_order = $base->getVar($this->grid_params, 'aj-source-order', '');
$item_skin->set_default_ajax_source_order($default_aj_source_order);
$post_media_source_type = $base->getVar($this->grid_postparams, 'image-source-type', 'full');
$default_video_poster_order = $base->getVar($this->grid_params, 'poster-source-order', '');
$item_skin->set_default_video_poster_order($default_video_poster_order);
$layout = $base->getVar($this->grid_params, 'layout', 'even');
$layout_sizing = $base->getVar($this->grid_params, 'layout-sizing', 'boxed');
$ajax_container_position = $base->getVar($this->grid_params, 'ajax-container-position', 'top');
if ($layout_sizing !== 'fullwidth' && $layout == 'masonry') {
$item_skin->set_poster_cropping(true);
}
$skins_css = '';
$skins_html = '';
$found_filter = array();
$i = 1;
if (!empty($order_by_start) && !empty($this->grid_layers)) {
if (is_array($order_by_start)) {
foreach ($order_by_start as $c_order) {
if ($c_order == 'rand') {
$this->grid_layers = $base->shuffle_assoc($this->grid_layers);
break;
}
}
} else {
if ($order_by_start == 'rand') {
$this->grid_layers = $base->shuffle_assoc($this->grid_layers);
}
}
}
if (!empty($this->grid_layers) && count($this->grid_layers) > 0) {
foreach ($this->grid_layers as $key => $entry) {
$post_media_source_data = $base->get_custom_media_source_data($entry, $post_media_source_type);
$post_video_ratios = $m->get_custom_video_ratios($entry);
$filters = array();
if (is_array($order_by) && !empty($order_by)) {
//$sort = $this->prepare_sorting_array_by_post($post, $order_by);
//$item_skin->set_sorting($sort);
}
if (!empty($entry['custom-filter'])) {
$cats = explode(',', $entry['custom-filter']);
if (!is_array($cats)) {
$cats = (array) $cats;
}
foreach ($cats as $category) {
$filters[sanitize_key($category)] = array('name' => $category, 'slug' => sanitize_key($category));
}
}
$found_filter = $found_filter + $filters;
//these are the found filters, only show filter that the posts have
//switch to different skin
$use_item_skin_id = $base->getVar($entry, 'use-skin', '-1');
if (intval($use_item_skin_id) === 0) {