public static function at_recent_cars($atts = null, $content = null)
    {
        if ($atts == 'generator') {
            return array("name" => __("Recent Listings", AT_ADMIN_TEXTDOMAIN), "base" => "at_recent_cars", 'icon' => "im-icon-spinner-4", "class" => "at-recent-cars-class", 'category' => __("Theme Short-Codes", AT_ADMIN_TEXTDOMAIN), "params" => array(array("type" => "textfield", "heading" => __("Title", AT_ADMIN_TEXTDOMAIN), "param_name" => "title", "value" => "", "description" => __("Description will appear below each chart.", AT_ADMIN_TEXTDOMAIN), 'dependency' => array('element' => 'content_type', 'value' => array('custom_text'))), array("type" => "range", "heading" => __("Limit", AT_ADMIN_TEXTDOMAIN), "param_name" => "limit", "value" => "12", "min" => "0", "max" => "20", "step" => "1", "unit" => '', "description" => __("Select limit to display on this block", AT_ADMIN_TEXTDOMAIN)), array("type" => "dropdown", "heading" => __("Make", AT_ADMIN_TEXTDOMAIN), "param_name" => "manufacturer_id", "width" => 200, "value" => AT_VC_Helper::get_manufacturers(), "description" => ''), array("type" => "dropdown", "heading" => __("Model", AT_ADMIN_TEXTDOMAIN), "param_name" => "model_id", "width" => 200, "value" => array("Any" => "0"), "description" => ''), array("type" => "dropdown", "heading" => __("Autoplay", AT_ADMIN_TEXTDOMAIN), "param_name" => "autoplay", "width" => 200, "value" => array("Yes" => "true", "No" => "false"), "description" => ''), array("type" => "textfield", "heading" => __("Pause", AT_ADMIN_TEXTDOMAIN), "param_name" => "pause", "value" => "4000", "description" => __("Specify slideshow timeout in ms.", AT_ADMIN_TEXTDOMAIN)), array("type" => "textfield", "heading" => __("Extra class name", AT_ADMIN_TEXTDOMAIN), "param_name" => "el_class", "value" => "", "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in Custom CSS Shortcode or Masterkey Custom CSS option.", AT_ADMIN_TEXTDOMAIN))));
        }
        $shortcode_id = self::_shortcode_id();
        extract(shortcode_atts(array('title' => '', 'manufacturer_id' => 0, 'model_id' => 0, 'limit' => 12, 'autoplay' => 'false', 'pause' => '4000', 'el_class' => '', 'width' => '1/1'), $atts));
        $width = wpb_translateColumnWidthToSpan($width);
        $car_model = AT_Loader::get_instance()->model('car_model');
        $cars = array();
        $params = array();
        if ($manufacturer_id > 0) {
            $params['manufacturer_id'] = $manufacturer_id;
            if ($model_id == 0) {
                $params['model_id'] = $model_id;
            }
        }
        $cars = $car_model->get_cars($params, $offset = 0, $limit);
        $output = '<div class="recent ' . $el_class . '">
					<h2>' . $title . '</h2>
					<div class="recent_carousel" data-settings=\'{
						"auto": ' . $autoplay . ',
						"pause": ' . $pause . ',
						"slideWidth": 220,
						"minSlides": 1,
						"infiniteLoop": 1,
						"maxSlides": 4,
						"slideMargin": 20,
						"controls" : true,
						"pager" : false,
						"infiniteLoop": true
					}\'>';
        foreach ($cars as $key => $car) {
            if (isset($car['photo']['photo_name']) && file_exists($car['photo']['photo_path'] . '213x164/' . $car['photo']['photo_name'])) {
                $static = $car['photo']['photo_url'] . '213x164/' . $car['photo']['photo_name'];
                $image = '<img src="' . AT_Common::static_url($static) . '" alt="' . $title . '"/>';
            } else {
                if (has_post_thumbnail()) {
                    $image = get_the_post_thumbnail($post_id = get_the_ID(), $size = array(213, 164));
                } else {
                    $image = '<img src="' . AT_Common::site_url(AT_URI_THEME . '/framework/assets/images/pics/noimage-small.jpg') . '" alt="' . $title . '"/>';
                }
            }
            // OLD WAY:
            // <img src="' . AT_Common::static_url( $car['photo']['photo_path'] . '213x164/' . $car['photo']['photo_name'] ) . '" alt="' . $car['options']['_manufacturer_id']['name'] . ' ' . $car['options']['_model_id']['name'] . '"/>
            $cost = AT_Common::show_full_price($value = $car['options']['_price'], $currency = $car['options']['_currency_id']);
            $output .= '<div class="slide">
							<a href="' . get_permalink($car['ID']) . '">
							' . $image . '
								<div class="description">
									Registration ' . $car['options']['_fabrication'] . '<br/>' . (!empty($car['options']['_cilindrics']) ? $car['options']['_cilindrics'] . ' cm³ ' : '') . (!empty($car['options']['_fuel_id']['name']) ? $car['options']['_fuel_id']['name'] . '<br/>' : '') . (!empty($car['options']['_engine_power']) ? $car['options']['_engine_power'] . ' HP<br/>' : '') . (!empty($car['options']['_body_type_id']['name']) ? 'Body ' . $car['options']['_body_type_id']['name'] . '<br/>' : '') . (!empty($car['options']['_mileage']) ? number_format((int) $car['options']['_mileage'], 0, '', ' ') . ' ' . AT_Common::car_mileage(0) : '') . '</div>
								<div class="title">' . $car['options']['_manufacturer_id']['name'] . ' ' . $car['options']['_model_id']['name'] . ' <span class="price">' . $cost . '</span></div>
							</a>
						</div>';
        }
        $output .= '</div>
				</div>';
        return $output;
    }
if (!defined("AT_DIR")) {
    die('!!!');
}
//$this->add_style( 'bootstrap', 'assets/css/bootstrap.css');
$this->add_style('style.css', 'assets/css/admin/admin.css');
$this->add_style('fonts.css', 'assets/css/fonts.css');
$this->add_style('icons.css', 'assets/css/icons.css');
$this->add_style('select2.css', 'assets/css/select2/select2.css');
$this->add_script('jquery.form', 'assets/js/jquery/jquery.form.js');
//$this->add_script( 'admin-options', 'assets/js/admin/options/options.js', array( 'jquery', 'media-upload', 'thickbox' ) );
$this->add_script('select2', 'assets/js/select2/select2.min.js');
$this->add_script('admin-options', 'assets/js/admin/options/options.js');
$this->add_script('admin-form-options', 'assets/js/admin/options/form-options.js', array(THEME_PREFIX . 'jquery.form'));
?>
<div class="theme_header">
	<div class="theme_logo">
		<img src="<?php 
echo AT_Common::static_url('assets/images/admin/logo.png');
?>
"/>
	</div>
	<div class="theme_details">
		<p><?php 
echo __('AutoDealer', AT_ADMIN_TEXTDOMAIN);
?>
 <?php 
echo __('by', AT_ADMIN_TEXTDOMAIN);
?>
 <a target="_BLANK" href="http://winterjuice.com/">Winter Juice</a></p>
	</div>
</div>
				<?php 
        }
        ?>
			</div>


			<div class="checkbox"><input type="checkbox" class="select_car" name="select_car" value="<?php 
        echo $car['ID'];
        ?>
" /></div>
			<div class="img">
				<?php 
        if (count($car['photo']) > 0) {
            ?>
				<img src="<?php 
            echo AT_Common::static_url($car['photo']['photo_url'] . '165x120/' . $car['photo']['photo_name']);
            ?>
" alt=""/>
				<?php 
        } else {
            ?>
				<img src="<?php 
            echo AT_Common::site_url(AT_URI_THEME . '/framework/assets/images/pics/noimage-small.jpg');
            ?>
" alt="" />
				<!--img src="/wp-content/themes/winterjuice/framework/assets/images/pics/catalog.jpg" alt=""/-->
				<?php 
        }
        ?>
			</div>
			<div class="general_info">
<div class="breadcrumbs">
	<?php 
    foreach ($items as $key => $value) {
        ?>
		<?php 
        if (count($items) - 1 != $key) {
            ?>
		<a href="<?php 
            echo $value['url'];
            ?>
"><?php 
            echo $value['name'];
            ?>
</a>
		<img src="<?php 
            echo AT_Common::static_url('/assets/images/marker_2.gif');
            ?>
" alt=""/>
		<?php 
        } else {
            ?>
		<?php 
            echo $value['name'];
            ?>
		<?php 
        }
        ?>
	<?php 
    }
    ?>
</div>
 private function _frontend_header($params)
 {
     $data = array();
     switch ($this->core->get_option('logo_settings')) {
         case 'logo_image':
             $width = $this->core->get_option('header_logo_width') != '' ? ' style="max-width:' . $this->core->get_option('header_logo_width') . ';"' : '';
             if ($this->core->get_option('header_logo_src') != '') {
                 $data['logo'] = '<img src="' . $this->core->get_option('header_logo_src') . '"' . $width . '>';
             } else {
                 $data['logo'] = '<img src="' . AT_Common::static_url('/assets/images/pics/logo_auto_dealer.png') . '"' . $width . '>';
             }
             break;
         case 'logo_text':
             $data['logo'] = $this->core->get_option('header_logo_text');
             break;
         default:
             $data['logo'] = get_bloginfo('name');
             break;
     }
     $data['header_style'] = $this->core->get_option('header_content_style', 'info');
     $data['add_car_button'] = $this->core->get_option('header_add_car_button', true);
     $data['add_car_button'] = $this->core->get_option('header_add_car_button', true);
     $data['sociable_view'] = $this->core->get_option('header_sociable_view', true);
     $data['sociable'] = AT_Core::get_instance()->get_option('sociable', array());
     $data['site_type'] = $this->core->get_option('site_type', 'mode_soletrader');
     $data['phone'] = $this->core->get_option('header_phone', '');
     $data['adress'] = $this->core->get_option('header_adress', '');
     $data['header_custom_html'] = $this->core->get_option('header_custom_html', '');
     $data['searchbox'] = $this->core->get_option('header_searchbox', true);
     return $data;
 }
    public static function at_auto_gallery($atts = null, $content = null)
    {
        if ($atts == 'generator') {
            return array("name" => __("Slider: Auto Gallery", AT_ADMIN_TEXTDOMAIN), "base" => "at_auto_gallery", 'icon' => "im-icon-spinner-4", "class" => "at-auto-gallery-class", 'category' => __("Theme Short-Codes", AT_ADMIN_TEXTDOMAIN), "params" => array(array("type" => "range", "heading" => __("Limit", AT_ADMIN_TEXTDOMAIN), "param_name" => "limit", "value" => "5", "min" => "0", "max" => "12", "step" => "1", "unit" => '', "description" => __("Select limit to display on this block", AT_ADMIN_TEXTDOMAIN)), array("type" => "dropdown", "heading" => __("Display options", AT_ADMIN_TEXTDOMAIN), "param_name" => "display", "width" => 200, "value" => array("Show all item" => "all", "Only featured" => "featured"), "description" => ''), array("type" => "dropdown", "heading" => __("Make", AT_ADMIN_TEXTDOMAIN), "param_name" => "manufacturer_id", "width" => 200, "value" => AT_VC_Helper::get_manufacturers(), "description" => ''), array("type" => "dropdown", "heading" => __("Model", AT_ADMIN_TEXTDOMAIN), "param_name" => "model_id", "width" => 200, "value" => array_merge(array("Any" => "0"), AT_VC_Helper::get_manufacturers()), "description" => ''), array("type" => "dropdown", "heading" => __("Autoplay", AT_ADMIN_TEXTDOMAIN), "param_name" => "autoplay", "width" => 200, "value" => array("Yes" => "true", "No" => "false"), "description" => ''), array("type" => "textfield", "heading" => __("Pause", AT_ADMIN_TEXTDOMAIN), "param_name" => "pause", "value" => "4000", "description" => __("Specify slideshow timeout in ms.", AT_ADMIN_TEXTDOMAIN)), array("type" => "textfield", "heading" => __("Extra class name", AT_ADMIN_TEXTDOMAIN), "param_name" => "el_class", "value" => "", "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in Custom CSS Shortcode or Masterkey Custom CSS option.", AT_ADMIN_TEXTDOMAIN))));
        }
        $shortcode_id = self::_shortcode_id();
        extract(shortcode_atts(array('manufacturer_id' => 0, 'model_id' => 0, 'display' => 'all', 'limit' => 5, 'autoplay' => 'false', 'pause' => '4000', 'el_class' => '', 'width' => '1/1'), $atts));
        $width = wpb_translateColumnWidthToSpan($width);
        $car_model = AT_Loader::get_instance()->model('car_model');
        $cars = array();
        $params = array();
        if ($manufacturer_id > 0) {
            $params['manufacturer_id'] = $manufacturer_id;
            if ($model_id == 0) {
                $params['model_id'] = $model_id;
            }
        }
        if ($display == "featured") {
            $params['featured'] = true;
        }
        $cars = $car_model->get_cars($params, $offset = 0, $limit);
        if (count($cars) > 0) {
            $output = '<div class="home_slider ' . $el_class . '">
								<div class="slider slider_1" data-settings=\'{
									"auto": ' . $autoplay . ',
									"slideWidth": 940,
									"pause": ' . $pause . ',
									"minSlides": 1,
									"infiniteLoop" : true,
									"maxSlides": 1,
									"slideMargin": 0,
									"controls" : false}\'>';
            foreach ($cars as $key => $car) {
                $title = $car['options']['_manufacturer_id']['name'] . ' ' . $car['options']['_model_id']['name'];
                if (isset($car['photo']['photo_name']) && file_exists($car['photo']['photo_path'] . 'original/' . $car['photo']['photo_name'])) {
                    $static = $car['photo']['photo_url'] . 'original/' . $car['photo']['photo_name'];
                    $image = '<img src="' . AT_Common::static_url($static) . '" alt="' . $title . '"/>';
                } else {
                    if (has_post_thumbnail()) {
                        $image = get_the_post_thumbnail($post_id = $car['ID'], $size = array(640, 428));
                    } else {
                        $image = '<img src="' . AT_Common::site_url(AT_URI_THEME . '/framework/assets/images/pics/noimage-large.jpg') . '" alt="' . $title . '"/>';
                    }
                }
                $cost = AT_Common::show_full_price($value = $car['options']['_price'], $currency = $car['options']['_currency_id']);
                $output .= '<div class="slide" data-onclick="location.href=' . get_permalink($car['ID']) . '">
								<a title="' . $title . '" href="' . get_permalink($car['ID']) . '">' . $image . '</a>
								<div class="description">
									<a title="' . $title . '" href="' . get_permalink($car['ID']) . '"><h2 class="title">' . $car['options']['_fabrication'] . ' ' . $title . '</h2></a>
									<p class="desc">' . (!empty($car['options']['_mileage']) ? '<span><strong>' . AT_Common::car_mileage(0) . ': </strong>' . number_format((int) $car['options']['_mileage'], 0, '', ',') . '</span>' : '') . (!empty($car['options']['_cilindrics']) ? '<span><strong>' . __('Engine', AT_TEXTDOMAIN) . ': </strong>' . $car['options']['_cilindrics'] . ' ' . __('cm³', AT_TEXTDOMAIN) . '</span> ' : '') . '</p>
									<div class="price">' . $cost . '</div>
								</div>
							</div>';
            }
            $output .= '</div>
					</div>';
        } else {
            $output = '<div class="home_slider ' . $el_class . '">' . __('Login and add new vehicles.', AT_TEXTDOMAIN) . '</div>';
        }
        return $output;
    }
		<h2></h2>
		<div class="btn-next">
			<a href="#" class="btn3"><?php 
echo __('Back', AT_TEXTDOMAIN);
?>
</a>
			<?php 
if (empty($car_info)) {
    ?>
			<a href="#" class="btn1"><?php 
    echo __('Add', AT_TEXTDOMAIN);
    ?>
</a>
			<?php 
} else {
    ?>
			<a href="#" class="btn1"><?php 
    echo __('Save', AT_TEXTDOMAIN);
    ?>
</a>
			<?php 
}
?>
			<span class="form_loading"><img src="<?php 
echo AT_Common::static_url('assets/images/loading.gif');
?>
" /></span>
		</div>
	</div>
	</form>
</div>
 public function del_photo()
 {
     if ($this->uri->is_ajax_request()) {
         try {
             $photo_model = $this->load->model('photo_model');
             $user_model = $this->load->model('user_model');
             $user_info = $user_model->get_user_by_id(AT_Common::get_logged_user_id());
             if (!empty($user_info['photo'])) {
                 $photo_model->del_photo_by_id($user_info['photo']['id']);
             }
             $response = '{"status" : "OK", "file_name_url" : "' . AT_Common::static_url('assets/images/no_photo_profile.png') . '"}';
             throw new Exception($response);
         } catch (Exception $e) {
             $this->view->add_json(json_decode($e->getMessage()))->display();
         }
     } else {
         AT_Core::show_404();
     }
 }
        echo $contacts_owner['phones'];
        ?>
</div>
				<?php 
    }
    ?>
					<div class="user-detail">
						<?php 
    if (count($contacts_owner['photo'])) {
        ?>
							<a href="<?php 
        echo $contacts_owner['url'];
        ?>
">
							<img style="max-width:70px;float:left;margin-right:20px;" src="<?php 
        echo AT_Common::static_url($contacts_owner['photo']['photo_url'] . '138x138/' . $contacts_owner['photo']['photo_name']);
        ?>
" alt=""/>
							</a>
						<?php 
    }
    ?>
						<?php 
    if (isset($is_dealer) && $is_dealer == 1) {
        ?>
							<i class="icon-award is-dealer award"></i>
						<?php 
    } else {
        ?>
							<i class="icon-user"></i>
						<?php 
 public static function options_init()
 {
     //AT_Core::get_instance()->view->add_style( 'adminmenu.css', 'assets/css/admin/adminmenu.css' );
     // INIT PAGES
     add_menu_page(__('Theme Options', AT_ADMIN_TEXTDOMAIN), __('Theme Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options', array('AT_Admin', 'options'), AT_Common::static_url('assets/images/admin/custom_pages_icons/20x20/theme_options.png'), 103);
     add_submenu_page(THEME_PREFIX . 'theme_options', __('General Theme Options', AT_ADMIN_TEXTDOMAIN), __('General Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_general', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('Header Theme Options', AT_ADMIN_TEXTDOMAIN), __('Header Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_header', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('Footer Theme Options', AT_ADMIN_TEXTDOMAIN), __('Footer Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_footer', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('Sociable Theme Options', AT_ADMIN_TEXTDOMAIN), __('Sociable Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_sociable', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('Styled Theme Options', AT_ADMIN_TEXTDOMAIN), __('Styled Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_styled', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('Blog Theme Options', AT_ADMIN_TEXTDOMAIN), __('Blog Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_blog', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('News Theme Options', AT_ADMIN_TEXTDOMAIN), __('News Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_news', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('Reviews Theme Options', AT_ADMIN_TEXTDOMAIN), __('Reviews Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_reviews', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('Sidebars Theme Options', AT_ADMIN_TEXTDOMAIN), __('Sidebars Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_sidebars', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('Backup Theme Options', AT_ADMIN_TEXTDOMAIN), __('Backup Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_backup', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('Support Theme Options', AT_ADMIN_TEXTDOMAIN), __('Support Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_support', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('Release Info', AT_ADMIN_TEXTDOMAIN), __('Release Info', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_release', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'theme_options', __('Troubleshooting', AT_ADMIN_TEXTDOMAIN), __('Troubleshooting', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_options_troubleshooting', array('AT_Admin', 'options'));
     remove_submenu_page(THEME_PREFIX . 'theme_options', THEME_PREFIX . 'theme_options');
     add_menu_page(__('Site Options', AT_ADMIN_TEXTDOMAIN), __('Site Options', AT_ADMIN_TEXTDOMAIN), 'manage_options', THEME_PREFIX . 'site_options', array('AT_Admin', 'options'), AT_Common::static_url('assets/images/admin/custom_pages_icons/20x20/site_options.png'), 104);
     add_submenu_page(THEME_PREFIX . 'site_options', __('General Site Options', AT_ADMIN_TEXTDOMAIN), __('General Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'site_options_general', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'site_options', __('Search Filter Options', AT_ADMIN_TEXTDOMAIN), __('Search Filter Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'site_options_filter', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'site_options', __('Maintenance Options', AT_ADMIN_TEXTDOMAIN), __('Maintenance Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'site_options_maintenance', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'site_options', __('Catalog Options', AT_ADMIN_TEXTDOMAIN), __('Catalog Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'site_options_catalog', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'site_options', __('Car Options', AT_ADMIN_TEXTDOMAIN), __('Car Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'site_options_car', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'site_options', __('Registration Options', AT_ADMIN_TEXTDOMAIN), __('Registration Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'site_options_registration', array('AT_Admin', 'options'));
     //add_submenu_page( THEME_PREFIX . 'site_options', __( 'Advertisement Options' , AT_ADMIN_TEXTDOMAIN ), __( 'Advertisement' , AT_ADMIN_TEXTDOMAIN ), 'edit_themes', THEME_PREFIX . 'site_options_advertisement', array( 'AT_Admin', 'options' ));
     add_submenu_page(THEME_PREFIX . 'site_options', __('Mail Template Options', AT_ADMIN_TEXTDOMAIN), __('Mail Template Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'site_options_mailtemplate', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'site_options', __('Text Options', AT_ADMIN_TEXTDOMAIN), __('Texts Options ', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'site_options_texts', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'site_options', __('Loans Options', AT_ADMIN_TEXTDOMAIN), __('Loans Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'site_options_loans', array('AT_Admin', 'options'));
     remove_submenu_page(THEME_PREFIX . 'site_options', THEME_PREFIX . 'site_options');
     if (!AT_Core::get_instance()->get_option('theme_is_activated', false)) {
         add_submenu_page(THEME_PREFIX . 'site_options', __('Theme Install', AT_ADMIN_TEXTDOMAIN), __('Theme Install ', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'theme_install', array('AT_Admin', 'options'));
     }
     add_menu_page(__('Edit Reference Tables', AT_ADMIN_TEXTDOMAIN), __('Reference', AT_ADMIN_TEXTDOMAIN), 'manage_options', THEME_PREFIX . 'reference', array('AT_Admin', 'options'), AT_Common::static_url('assets/images/admin/custom_pages_icons/20x20/reference.png'), 105);
     add_menu_page(__('Edit Frontend Users', AT_ADMIN_TEXTDOMAIN), __('Frontend Users', AT_ADMIN_TEXTDOMAIN), 'manage_options', THEME_PREFIX . 'users', array('AT_Admin', 'options'), AT_Common::static_url('assets/images/admin/custom_pages_icons/20x20/users.png'), 106);
     add_menu_page(__('Merchant [BETA]', AT_ADMIN_TEXTDOMAIN), __('Merchant [BETA]', AT_ADMIN_TEXTDOMAIN), 'manage_options', THEME_PREFIX . 'merchant', array('AT_Admin', 'options'), AT_Common::static_url('assets/images/admin/custom_pages_icons/20x20/merchant.png'), 107);
     add_submenu_page(THEME_PREFIX . 'merchant', __('General Options', AT_ADMIN_TEXTDOMAIN), __('General Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'merchant_general', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'merchant', __('PayPal Options', AT_ADMIN_TEXTDOMAIN), __('PayPal Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'merchant_paypal', array('AT_Admin', 'options'));
     add_submenu_page(THEME_PREFIX . 'merchant', __('Custom Gateway', AT_ADMIN_TEXTDOMAIN), __('Gateway Options', AT_ADMIN_TEXTDOMAIN), 'edit_themes', THEME_PREFIX . 'merchant_gateway', array('AT_Admin', 'options'));
     remove_submenu_page(THEME_PREFIX . 'merchant', THEME_PREFIX . 'merchant');
 }
options[photos][{file_name}]' value='{photo_value}'>
				</div>
			</li>
		</script>
		<ul class="photos_sortable photos">
		<?php 
    foreach ($items as $item_key => $photo) {
        ?>
			<li class="photo_wrapper item <?php 
        if ($photo['is_main']) {
            echo 'photo_main';
        }
        ?>
">
				<img src="<?php 
        echo AT_Common::static_url($photo['photo_url'] . '480x290/' . $photo['photo_name']);
        ?>
" class="active" />
				<div class="actions">
					<a href="#" class="icon set_main_image" title="<?php 
        echo __('Set main', AT_ADMIN_TEXTDOMAIN);
        ?>
"><i class="icon-up-dir"></i></a>
					<a href="#" class="icon delete_image" title="<?php 
        echo __('Delete', AT_ADMIN_TEXTDOMAIN);
        ?>
"><i class="icon-cancel"></i></a>
					<input type='hidden' name='<?php 
        echo THEME_PREFIX;
        ?>
options[photos][<?php 
    ?>
 <?php 
    if ($car['owner_info']['is_dealer']) {
        echo 'is_dealer';
    }
    ?>
">
		<a href="<?php 
    echo get_permalink($car['ID']);
    ?>
">
			<?php 
    if (count($car['photo']) > 0) {
        ?>
				<img src="<?php 
        echo AT_Common::static_url($car['photo']['photo_url'] . '213x164/' . $car['photo']['photo_name']);
        ?>
"/>
			<?php 
    } else {
        ?>
				<img src="<?php 
        echo AT_Common::site_url(AT_URI_THEME . '/framework/assets/images/pics/noimage-small.jpg');
        ?>
" alt="" />
			<?php 
    }
    ?>
			<div class="description">
				<?php 
    if ($car['owner_info']['is_dealer']) {
        ?>
				<div class="f_widget <?php 
        echo $value['class'] . ' ';
        echo $last_key == $key ? 'last' : '';
        ?>
">
					<?php 
        echo $value['content'];
        ?>
				</div>	
			<?php 
    }
    ?>
				<!--div class="f_widget last" style="width:700px;">
					<img src="<?php 
    echo AT_Common::static_url('/assets/images/pics/banner_footer.jpg');
    ?>
" />
					<img src="http://wp-test/wp-content/themes/winterjuice/framework/assets/images/pics/banner_footer.jpg" />
				</div-->	
			</div>
		</div>
	  <?php 
}
?>
	  <?php 
if (count($bottom_sidebars) > 0) {
    ?>
		<div class="bottom_footer">
			<?php 
    end($bottom_sidebars);
<?php

if (!defined("AT_DIR")) {
    die('!!!');
}
?>

<!--h2>404 Page Not Found!</h2-->
<div class="counter_heading">
	<img src="<?php 
echo AT_Common::static_url('assets/images/404.jpg');
?>
">
</div>
<!--
<div class="counter_heading">We’ll be here soon with a new website. Estimated time remaining:</div>
<div class="counter_wrapper">
	<div id="counter"></div>
</div>
<div class="newsletter">
	<div class="title">We are building new? beautiful website. In the meantime, while here, you can use the form below to subscribe to our newsletter. </div>
	<form method="get" action="">
		<input type="text" onblur="if(this.value=='') this.value='Your E-mail...';" onfocus="if(this.value=='Your E-mail...') this.value='';" value="Your E-mail..." class="txb"/>
		<input type="submit" value="subscribe" class="btn_subscribe"/>
	</form>
</div>
<div class="needs_wrapper">
	<div class="post_block">
		<h3><strong>What</strong> we have finished</h3>
		<ul>
			<li>The main website design</li>
 public function render_scripts()
 {
     if (!empty($this->_scripts)) {
         foreach ($this->_scripts as $name => $item) {
             if (count($item) > 0) {
                 wp_enqueue_script(THEME_PREFIX . $name, AT_Common::static_url($item['script']), empty($item['deps']) ? false : $item['deps'], THEME_VERSION);
             } else {
                 wp_enqueue_script($name, '', '', '');
             }
             //wp_enqueue_script( $name );
         }
     }
     if (!empty($this->_localize_script)) {
         foreach ($this->_localize_script as $handle => $objects) {
             foreach ($objects as $object_name => $value) {
                 wp_localize_script(THEME_PREFIX . $handle, $object_name, $value);
             }
         }
     }
 }
        }
        ?>
>
			<?php 
        $cost = AT_Common::show_full_price($value = $car['options']['_price'], $currency = $car['options']['_currency_id']);
        echo '
				<a href="' . get_permalink($car['ID']) . '">
					<img src="' . AT_Common::static_url($car['photo']['photo_url'] . '213x164/' . $car['photo']['photo_name']) . '" alt="' . $car['options']['_manufacturer_id']['name'] . ' ' . $car['options']['_model_id']['name'] . '"/>
					<div class="description">
						Registration ' . $car['options']['_fabrication'] . '<br/>' . (!empty($car['options']['_cilindrics']) ? $car['options']['_cilindrics'] . ' cm³ ' : '') . (!empty($car['options']['_fuel_id']['name']) ? $car['options']['_fuel_id']['name'] . '<br/>' : '') . (!empty($car['options']['_engine_power']) ? $car['options']['_engine_power'] . ' HP<br/>' : '') . (!empty($car['options']['_body_type_id']['name']) ? 'Body ' . $car['options']['_body_type_id']['name'] . '<br/>' : '') . (!empty($car['options']['_mileage']) ? number_format((int) $car['options']['_mileage'], 0, '', ' ') . ' ' . AT_Common::car_mileage(0) : '') . '</div>
					<div class="title">' . $car['options']['_manufacturer_id']['name'] . ' ' . $car['options']['_model_id']['name'] . ' <span class="price">' . $cost . '</span></div>
				</a>';
        ?>
			</li>
		<?php 
    }
    ?>
		<!-- <li class="last">
			<a href="#">
				<img src="<?php 
    echo AT_Common::static_url('/assets/images/pics/recent_1.jpg');
    ?>
" alt=""/>
				<div class="description">Registration 2010<br/>3.0 Diesel<br/>230 HP<br/>Body Coupe<br/>80 000 Miles</div>
				<div class="title">Mercedes-Benz <span class="price">$ 115 265</span></div>
			</a>
		</li> -->
	</ul>
</div>
<?php 
}
<?php

if (!defined("AT_DIR")) {
    die('!!!');
}
?>

<div class="wrapper_login_page">
	<div class="background">
		<img src="<?php 
echo AT_Common::static_url('assets/images/bg_auto/' . $background);
?>
">
		<div id="login-page" class="popup">
			<div class="popup_title"><?php 
echo __('Login', AT_TEXTDOMAIN);
?>
</div>
			<div class="popup_content">
				<form method="post" action="<?php 
echo AT_Common::site_url('/auth/login/');
?>
" id="login-form-page" class="login-form">
					<input type="text" id="email" class="text" name="email" placeholder="<?php 
echo __('Email', AT_TEXTDOMAIN);
?>
">
					<input type="password" class="text" name="password" id="password" placeholder="<?php 
echo __('Password', AT_TEXTDOMAIN);
?>
">
 private static function _news()
 {
     register_post_type('news', array('labels' => array('name' => _x('News', 'post type general name', AT_ADMIN_TEXTDOMAIN), 'singular_name' => _x('News', 'post type singular name', AT_ADMIN_TEXTDOMAIN), 'add_new' => _x('Add New', 'service', AT_ADMIN_TEXTDOMAIN), 'add_new_item' => __('Add News', AT_ADMIN_TEXTDOMAIN), 'edit_item' => __('Edit News', AT_ADMIN_TEXTDOMAIN), 'new_item' => __('Add News', AT_ADMIN_TEXTDOMAIN), 'view_item' => __('View News', AT_ADMIN_TEXTDOMAIN), 'search_items' => __('Search News', AT_ADMIN_TEXTDOMAIN), 'not_found' => __('No news found', AT_ADMIN_TEXTDOMAIN), 'not_found_in_trash' => __('No news found in Trash', AT_ADMIN_TEXTDOMAIN), 'parent_item_colon' => ''), 'singular_label' => __('News', AT_ADMIN_TEXTDOMAIN), 'public' => true, 'exclude_from_search' => false, 'show_ui' => true, 'menu_icon' => AT_Common::static_url('assets/images/admin/custom_pages_icons/20x20/news.png'), 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => true, 'has_archive' => true, 'query_var' => false, 'supports' => array('title', 'editor', 'thumbnail')));
 }
		<div class="cl_15">&nbsp;</div>
	</div>
	<div class="theme-table-body">
	<?php 
foreach ($items as $key => $item) {
    ?>
	<?php 
    //print_r($item);
    ?>
		<div class="theme-table-body-row" id="user_<?php 
    echo $item['id'];
    ?>
">
			<div class="cl_5 user_photo">
				<img src="<?php 
    echo AT_Common::static_url(!empty($item['photo']) ? $item['photo']['photo_url'] . '138x138/' . $item['photo']['photo_name'] : 'assets/images/no_photo_profile.png');
    ?>
">
			</div>
			<div class="cl_16"><?php 
    echo $item['name'];
    ?>
</div>
			<div class="cl_14"><?php 
    echo $item['email'];
    ?>
</div>
			<!-- <div class="cl_14"><?php 
    echo !empty($item['phone']) ? $item['phone'] : '&nbsp;';
    ?>
</div>
<div class="widget grey car_widget">
	<h2><?php 
echo __('<strong>About</strong> us', AT_TEXTDOMAIN);
?>
</h2>
	<div class="post">
		<?php 
if (count($dealer_info['photo'])) {
    ?>
			<img style="max-width:70px;float:left;margin-right:20px;" src="<?php 
    echo AT_Common::static_url($dealer_info['photo']['photo_url'] . '138x138/' . $dealer_info['photo']['photo_name']);
    ?>
" alt=""/>
		<?php 
}
?>
		<p><?php 
echo $dealer_info['about'];
?>
</p>
		<div class="clear"></div>
	</div>
</div>
<?php 
if (count($dealer_contact) > 0) {
    ?>
<div class="widget contacts_widget">
	<h2><?php 
    echo __('<strong>Contact</strong> details', AT_TEXTDOMAIN);
    ?>
: <?php 
 public function upload()
 {
     if (empty($_POST) || empty($_FILES) || !isset($_FILES["file"])) {
         AT_Core::show_404();
     }
     $_file_a = explode('.', $_FILES["file"]["name"]);
     if (count($_file_a) <= 1) {
         //AT_Core::show_404();
         $file_name = uniqid("car_") . '.jpg';
     } else {
         $file_name = uniqid("car_") . '.' . $_file_a[count($_file_a) - 1];
     }
     //$file_name = uniqid("car_") . '.' . $_file_a[count($_file_a)-1];
     $targetDir = AT_DIR_THEME . '/uploads';
     $cleanupTargetDir = false;
     // Remove old files
     $maxFileAge = 5 * 3600;
     // Temp file age in seconds
     $filePath = $targetDir . DIRECTORY_SEPARATOR . $file_name;
     // Chunking might be enabled
     $chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0;
     $chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 0;
     try {
         // Open temp file
         if (!($out = @fopen("{$filePath}.part", $chunks ? "ab" : "wb"))) {
             throw new Exception('{"status" : "ERROR", "code": 102, "message": "Failed to open output stream."}');
         }
         if (!empty($_FILES)) {
             if ($_FILES["file"]["error"] || !is_uploaded_file($_FILES["file"]["tmp_name"])) {
                 throw new Exception('{"status" : "ERROR", "code": 103, "message": "Failed to move uploaded file."}');
             }
             // Read binary input stream and append it to temp file
             if (!($in = @fopen($_FILES["file"]["tmp_name"], "rb"))) {
                 throw new Exception('{"status" : "ERROR", "code": 101, "message": "Failed to open input stream."}');
             }
         } else {
             if (!($in = @fopen("php://input", "rb"))) {
                 throw new Exception('{"status" : "ERROR", "code": 101, "message": "Failed to open input stream."}');
             }
         }
         while ($buff = fread($in, 4096)) {
             fwrite($out, $buff);
         }
         @fclose($out);
         @fclose($in);
         // Check if file has been uploaded
         if (!$chunks || $chunk == $chunks - 1) {
             // Strip the temp .part suffix off
             rename("{$filePath}.part", $filePath);
         }
         // Return Success JSON-RPC response
         $response = '{"status" : "OK", "file_name" : "' . $file_name . '", "file_name_url" : "' . AT_Common::static_url('uploads/' . $file_name) . '"}';
         throw new Exception($response);
     } catch (Exception $e) {
         $this->view->add_json(json_decode($e->getMessage()))->display();
     }
 }