本文整理汇总了PHP中Essential_Grid_Base::set_basic_colums方法的典型用法代码示例。如果您正苦于以下问题:PHP Essential_Grid_Base::set_basic_colums方法的具体用法?PHP Essential_Grid_Base::set_basic_colums怎么用?PHP Essential_Grid_Base::set_basic_colums使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Essential_Grid_Base
的用法示例。
在下文中一共展示了Essential_Grid_Base::set_basic_colums方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_maximum_entries
/**
* Check the maximum entries that should be loaded
* @since: 1.5.3
*/
public function get_maximum_entries($grid)
{
$base = new Essential_Grid_Base();
$max_entries = intval($grid->get_postparam_by_handle('max_entries', '-1'));
if ($max_entries !== -1) {
return $max_entries;
}
$layout = $grid->get_param_by_handle('navigation-layout', array());
if (isset($layout['pagination']) || isset($layout['left']) || isset($layout['right'])) {
return $max_entries;
}
$rows_unlimited = $grid->get_param_by_handle('rows-unlimited', 'on');
$load_more = $grid->get_param_by_handle('load-more', 'none');
$rows = intval($grid->get_param_by_handle('rows', '3'));
$columns_advanced = $grid->get_param_by_handle('columns-advanced', 'off');
$columns = $grid->get_param_by_handle('columns', '');
//this is the first line
$columns = $base->set_basic_colums($columns);
$max_column = 0;
foreach ($columns as $column) {
if ($max_column < $column) {
$max_column = $column;
}
}
if ($columns_advanced === 'on') {
$columns_advanced = array();
$columns_advanced[] = $columns;
$columns_advanced[] = $base->getVar($this->grid_params, 'columns-advanced-rows-0', '');
$columns_advanced[] = $base->getVar($this->grid_params, 'columns-advanced-rows-1', '');
$columns_advanced[] = $base->getVar($this->grid_params, 'columns-advanced-rows-2', '');
$columns_advanced[] = $base->getVar($this->grid_params, 'columns-advanced-rows-3', '');
$columns_advanced[] = $base->getVar($this->grid_params, 'columns-advanced-rows-4', '');
$columns_advanced[] = $base->getVar($this->grid_params, 'columns-advanced-rows-5', '');
$columns_advanced[] = $base->getVar($this->grid_params, 'columns-advanced-rows-6', '');
$columns_advanced[] = $base->getVar($this->grid_params, 'columns-advanced-rows-7', '');
$columns_advanced[] = $base->getVar($this->grid_params, 'columns-advanced-rows-8', '');
$match = array(0, 0, 0, 0, 0, 0, 0);
for ($i = 0; $i <= $rows; $i++) {
foreach ($columns_advanced as $col_adv) {
if (!empty($col_adv)) {
foreach ($col_adv as $key => $val) {
$match[$key] += $val;
}
$i++;
}
if ($i >= $rows) {
break;
}
}
}
foreach ($match as $highest) {
if ($max_column < $highest) {
$max_column = $highest;
}
}
}
if ($rows_unlimited === 'off') {
if ($columns_advanced === 'off') {
$max_entries = $max_column * $rows;
} else {
$max_entries = $max_column;
}
} elseif ($rows_unlimited === 'on' && $load_more === 'none') {
//@disabled at 2.0 -> will not work as expeced, all elements should be loaded here
//$max_entries = $max_column;
}
return $max_entries;
}
示例2: explode
$grid = Essential_Grid::get_essential_grid_by_id(intval($isCreate));
if (!empty($grid)) {
$title = __('Settings', EG_TEXTDOMAIN);
$layers = $grid['layers'];
}
}
$postTypesWithCats = $base->getPostTypesWithCatsForClient();
$jsonTaxWithCats = $base->jsonEncodeForClientSide($postTypesWithCats);
$base = new Essential_Grid_Base();
$pages = get_pages(array('sort_column' => 'post_name'));
$post_elements = $base->getPostTypesAssoc();
$postTypes = $base->getVar($grid['postparams'], 'post_category', 'post');
$categories = $base->setCategoryByPostTypes($postTypes, $postTypesWithCats);
$selected_pages = explode(',', $base->getVar($grid['postparams'], 'selected_pages', '-1', 's'));
$columns = $base->getVar($grid['params'], 'columns', '');
$columns = $base->set_basic_colums($columns);
$columns_width = $base->getVar($grid['params'], 'columns-width', '');
$columns_width = $base->set_basic_colums_width($columns_width);
$columns_height = $base->getVar($grid['params'], 'columns-height', '');
$columns_height = $base->set_basic_colums_height($columns_height);
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-0', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-1', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-2', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-3', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-4', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-5', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-6', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-7', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-8', '');
$columns_advanced[] = $base->getVar($grid['params'], 'columns-advanced-rows-9', '');
$nav_skin_choosen = $base->getVar($grid['params'], 'navigation-skin', 'minimal-light');