예제 #1
0
 /**
  * The callback that is executed when the user is loading the admin page.
  *  Basically, output the page content for the admin page. The function
  *  acts just like a controller method for and MVC app. That is, it loads
  *  a view.
  */
 public function adminMenuCallback()
 {
     Bizyhood_Log::add('debug', "Admin page callback executed");
     Bizyhood_Utility::sendInstallReportIfNew();
     $data = array();
     $data['api_url'] = Bizyhood_Utility::getApiUrl();
     $data['main_page_id'] = Bizyhood_Utility::getOption(self::KEY_MAIN_PAGE_ID);
     $data['signup_page_id'] = Bizyhood_Utility::getOption(self::KEY_SIGNUP_PAGE_ID);
     $data['zip_codes'] = Bizyhood_Utility::getOption(self::KEY_ZIP_CODES);
     $data['use_cuisine_types'] = Bizyhood_Utility::getOption(self::KEY_USE_CUISINE_TYPES);
     $data['categories'] = Bizyhood_Utility::getOption(self::KEY_CATEGORIES);
     $data['errors'] = array();
     if (!function_exists('curl_exec')) {
         $data['errors'][] = 'Bizyhood requires the PHP cURL module to be enabled. You may need to ask your web host or developer to enable this.';
     }
     if (get_page_by_path('businesses')) {
         $data['errors'][] = 'You have a page named "businesses", which will interfere with the business directory if you plan to use it. You must delete that page.';
     }
     if (get_category_by_slug('businesses')) {
         $data['errors'][] = 'You have a category named "businesses", which will interfere with the business directory if you plan to use it. You must delete that category.';
     }
     Bizyhood_View::load('admin/admin', $data);
 }