/** * return an array of modules used to select the article display view * @param string $view_name can be: default+enabled_on_loops | enabled_on_loops | enabled_on_more_articles_box * @return array of arrays * array('text' => '', 'title' => '', 'val' => '', 'img' => get_template_directory_uri() . '/includes/wp_booster/wp-admin/images/panel/module-default.png') */ static function helper_display_modules($view_name) { $modules_array = array(); switch ($view_name) { case 'default+enabled_on_loops': // all modules that have enabled_on_loops + default $modules_array[] = array('text' => '', 'title' => '', 'val' => '', 'img' => get_template_directory_uri() . '/includes/wp_booster/wp-admin/images/panel/module-default.png'); foreach (td_api_module::get_all() as $module_class => $module_array) { if ($module_array['enabled_on_loops'] === true) { $modules_array[] = array('text' => '', 'title' => '', 'val' => td_util::get_module_loop_id($module_class), 'img' => $module_array['img']); } } break; case 'enabled_on_loops': // all modules that have enabled_on_loops foreach (td_api_module::get_all() as $module_class => $module_array) { if ($module_array['enabled_on_loops'] === true) { $modules_array[] = array('text' => '', 'title' => '', 'val' => td_util::get_module_loop_id($module_class), 'img' => $module_array['img']); } } break; case 'enabled_on_more_articles_box': // all modules that are enabled on the more articles box foreach (td_api_module::get_all() as $module_class => $module_array) { if ($module_array['enabled_on_more_articles_box'] === true) { $modules_array[] = array('text' => '', 'title' => '', 'val' => td_util::get_module_loop_id($module_class), 'img' => $module_array['img']); } } break; } return $modules_array; }