本文整理汇总了PHP中Essential_Grid_Base::set_basic_colums_custom方法的典型用法代码示例。如果您正苦于以下问题:PHP Essential_Grid_Base::set_basic_colums_custom方法的具体用法?PHP Essential_Grid_Base::set_basic_colums_custom怎么用?PHP Essential_Grid_Base::set_basic_colums_custom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Essential_Grid_Base
的用法示例。
在下文中一共展示了Essential_Grid_Base::set_basic_colums_custom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: apply_custom_settings
/**
* Apply Custom Settings to the Grid, so users can change everything in the settings they want to
* This allows to modify grid_params and grid_post_params
* @since: 1.2.0
*/
private function apply_custom_settings($has_handle = false)
{
if (empty($this->custom_settings) || !is_array($this->custom_settings)) {
return false;
}
$base = new Essential_Grid_Base();
$translate_variables = array('grid-layout' => 'layout');
foreach ($this->custom_settings as $handle => $new_setting) {
if (isset($translate_variables[$handle])) {
$handle = $translate_variables[$handle];
}
if ($has_handle) {
//p- is in front of postparameters
if (strpos($handle, 'p-') === 0) {
$this->grid_postparams[substr($handle, 2)] = $new_setting;
} else {
$this->grid_params[$handle] = $new_setting;
}
} else {
if (isset($this->grid_params[$handle])) {
$this->grid_params[$handle] = $new_setting;
} elseif (isset($this->grid_postparams[$handle])) {
$this->grid_postparams[$handle] = $new_setting;
} else {
$this->grid_params[$handle] = $new_setting;
}
}
}
if (isset($this->grid_params['columns'])) {
//change columns
$columns = $base->set_basic_colums_custom($this->grid_params['columns']);
$this->grid_params['columns'] = $columns;
}
if (isset($this->grid_params['rows-unlimited']) && $this->grid_params['rows-unlimited'] == 'off') {
//add pagination
$this->grid_params['navigation-layout']['pagination']['bottom-1'] = '0';
$this->grid_params['bottom-1-margin-top'] = '10';
}
return true;
}