本文整理汇总了PHP中Essential_Grid_Base::get_categories_by_ids方法的典型用法代码示例。如果您正苦于以下问题:PHP Essential_Grid_Base::get_categories_by_ids方法的具体用法?PHP Essential_Grid_Base::get_categories_by_ids怎么用?PHP Essential_Grid_Base::get_categories_by_ids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Essential_Grid_Base
的用法示例。
在下文中一共展示了Essential_Grid_Base::get_categories_by_ids方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export_grids
public function export_grids($export_grids)
{
$return_grids = array();
if ($export_grids !== false && !empty($export_grids)) {
$c_grid = new Essential_Grid();
$base = new Essential_Grid_Base();
$item_skin = new Essential_Grid_Item_Skin();
$grids = $c_grid->get_essential_grids();
if (!empty($grids)) {
foreach ($export_grids as $e_grid_id) {
foreach ($grids as $grid) {
$grid = (array) $grid;
if ($e_grid_id == $grid['id']) {
//change categories/tags id to slug
$check = json_decode($grid['postparams'], true);
if (isset($check['post_category']) && !empty($check['post_category'])) {
$slug_cats = array();
$the_cats = explode(',', $check['post_category']);
foreach ($the_cats as $cat) {
$raw = explode('_', $cat);
$catSlug = $raw[count($raw) - 1];
unset($raw[count($raw) - 1]);
$cat = implode('_', $raw);
$category = $base->get_categories_by_ids((array) $catSlug, $cat);
foreach ($category as $cat_obj) {
$slug_cats[] = $cat . '_' . $cat_obj->slug;
}
}
$check['post_category'] = implode(',', $slug_cats);
$grid['postparams'] = json_encode($check);
}
//change choosen skinid to skinhandle
$check = json_decode($grid['params'], true);
if (isset($check['entry-skin']) && !empty($check['entry-skin']) && intval($check['entry-skin']) != 0) {
$skin = $item_skin->get_handle_by_id($check['entry-skin']);
if (!empty($skin)) {
$check['entry-skin'] = $skin['handle'];
}
$grid['params'] = json_encode($check);
}
$return_grids[] = $grid;
break;
}
}
}
}
}
return $return_grids;
}