ajax.php
changeset 968 105a24b4de8f
parent 963 b572ce1114f1
child 1005 b7c7f7e2e93b
equal deleted inserted replaced
967:a267c5be7963 968:105a24b4de8f
   549       echo PageUtils::acl_json($parms);
   549       echo PageUtils::acl_json($parms);
   550       break;
   550       break;
   551     case 'theme_list':
   551     case 'theme_list':
   552       header('Content-type: application/json');
   552       header('Content-type: application/json');
   553       
   553       
   554       $q = $db->sql_query('SELECT theme_name, theme_id FROM ' . table_prefix . "themes WHERE enabled = 1 ORDER BY theme_name ASC;");
       
   555       if ( !$q )
       
   556         $db->die_json();
       
   557       
       
   558       $return = array();
   554       $return = array();
   559       while ( $row = $db->fetchrow() )
   555       foreach ( $template->theme_list as $theme )
   560         $return[] = $row;
   556       {
   561       
   557         $return[] = array(
   562       foreach ( $return as &$theme )
   558             'theme_name' => $theme['theme_name'],
   563       {
   559             'theme_id' => $theme['theme_id'],
   564         $theme['have_thumb'] = file_exists(ENANO_ROOT . "/themes/{$theme['theme_id']}/preview.png");
   560             'have_thumb' => file_exists(ENANO_ROOT . "/themes/{$theme['theme_id']}/preview.png")
       
   561           );
   565       }
   562       }
   566       
   563       
   567       echo enano_json_encode($return);
   564       echo enano_json_encode($return);
   568       
   565       
   569       break;
   566       break;