<?php

$dir_path = 'themes';
$all_data = [];
$complete_dir_path = HOME_DIR . DS . $dir_path;
$all_themes = scandir($complete_dir_path);
foreach ($all_themes as $k => $theme_name) {
 if ($theme_name == '.' || $theme_name == '..') {
  continue;
 }
 $theme_dir = $complete_dir_path . DS . $theme_name;
 if (is_dir($theme_dir)) {
  $class_file_name = $theme_dir . DS . 'class_theme_' . $theme_name . '.inc';
  if (file_exists($class_file_name)) {
   require_once $class_file_name;
   $class_name = 'theme_' . $theme_name;
   $class_obj = new $class_name;
   if (property_exists($class_name, 'theme_info') && (!empty($class_name::$theme_info))) {
    $sys_info_a = $class_name::$theme_info;
    $sys_info_a['theme_name'] = $theme_name;
    array_push($all_data, $sys_info_a);
   }
  } else {
   continue;
  }
 }
}


$total_count = count($all_data);
$pageno = !empty($_GET['pageno']) && !is_array($_GET['pageno']) ? $_GET['pageno'] : 1;
$per_page = (!empty($_GET['per_page']) && !is_array($_GET['per_page'])) ? $_GET['per_page'] : 50;
$pagination = new pagination($pageno, $per_page, $total_count);
$pagination->setProperty('_path', 'form.php?');
$position = ($pageno - 1) * $per_page;

//pa($file_paths);
//pa($all_data);
?>