app_data() ) . ';', 'before' ); } /** * Settings App Data */ private function app_data() { $layouts = array(); foreach ( Options::layouts() as $value => $label ) { $layouts[] = array( 'value' => (string) $value, 'label' => $label, ); } return array( 'version' => AI1WP_VERSION, 'settings' => Options::all(), 'layouts' => $layouts, 'templates' => $this->preview_templates(), 'styleUrl' => AI1WP_URL . '/assets/css/style.css?ver=' . AI1WP_VERSION, 'defaultImage' => Options::default_image(), 'siteTitle' => get_bloginfo( 'name' ), 'siteUrl' => home_url( '/' ), ); } /** * Loader Markup for the Live Preview * Same templates as the frontend. */ private function preview_templates() { $templates = array(); $logo = Options::default_image(); foreach ( array_keys( Options::layouts() ) as $value ) { ob_start(); include AI1WP_PATH . '/templates/loader-' . $value . '.php'; $templates[ (string) $value ] = ob_get_clean(); } return $templates; } /** * Settings Page Content */ public function render() { if ( ! current_user_can( 'manage_options' ) ) { return; } ?>