예제 #1
0
 private static function init($params)
 {
     self::$install_src_dir = $params['install_src_dir'];
     $available_themes = fn_get_available_themes(Registry::get('settings.theme_name'));
     self::$installed_themes = array_keys($available_themes['installed']);
     self::$repo_themes = array_keys($available_themes['repo']);
     return true;
 }
예제 #2
0
        }
    }
    Tygh::$app['view']->assign('location', $selected_location);
    if (!empty($_REQUEST['dynamic_object'])) {
        Tygh::$app['view']->assign('dynamic_object', $_REQUEST['dynamic_object']);
    }
    if (!empty($selected_location['dispatch'])) {
        Tygh::$app['view']->assign('dynamic_object_scheme', SchemesManager::getDynamicObject($selected_location['dispatch'], 'C'));
    }
    $theme = Themes::factory(fn_get_theme_path('[theme]', 'C'));
    Tygh::$app['view']->assign('theme_manifest', $theme->getManifest());
    $params = array('theme_name' => $theme->getThemeName());
    Tygh::$app['view']->assign('layouts', Layout::instance()->getList($params));
    Tygh::$app['view']->assign('all_layouts', Layout::instance()->getList());
    Tygh::$app['view']->assign('default_layouts_sources', fn_get_default_layouts_sources('responsive'));
    Tygh::$app['view']->assign('themes', fn_get_available_themes($theme->getThemeName()));
    $http_url = fn_get_storefront_url('http');
    $https_url = fn_get_storefront_url('https');
    Tygh::$app['view']->assign('widget_http_url', urlencode($http_url));
    Tygh::$app['view']->assign('widget_https_url', urlencode($https_url));
    if ($mode == 'manage') {
        Tygh::$app['view']->assign('layout_data', Layout::instance()->get(Registry::get('runtime.layout.layout_id')));
    } else {
        Tygh::$app['view']->display('views/block_manager/manage_in_tab.tpl');
        exit;
    }
} elseif ($mode == 'update_block') {
    $snapping_data = array();
    $editable_content = true;
    $editable_template_name = true;
    $editable_wrapper = false;
예제 #3
0
 if (fn_allowed_for('MULTIVENDOR')) {
     if (!empty($company_id)) {
         $company_data['logos'] = fn_get_logos($company_id);
     }
     Tygh::$app['view']->assign('logo_types', fn_get_logo_types(true));
 }
 $restored_company_data = fn_restore_post_data('company_data');
 if (!empty($restored_company_data) && $mode == 'add') {
     if (!empty($restored_company_data['shippings'])) {
         $restored_company_data['shippings'] = implode(',', $restored_company_data['shippings']);
     }
     $company_data = fn_array_merge($company_data, $restored_company_data);
 }
 if (fn_allowed_for('ULTIMATE')) {
     if ($mode == 'update') {
         $available_themes = fn_get_available_themes(fn_get_theme_path('[theme]', 'C', $company_id));
         $theme_name = fn_get_theme_path('[theme]', 'C', $company_id);
         $layout = Layout::instance($company_id)->getDefault($theme_name);
         $style = Styles::factory($theme_name)->get($layout['style_id']);
         Tygh::$app['view']->assign('current_style', $style);
         Tygh::$app['view']->assign('theme_info', $available_themes['current']);
     }
     $countries_list = fn_get_simple_countries();
     if (!empty($company_data['countries_list'])) {
         if (!is_array($company_data['countries_list'])) {
             $company_countries = explode(',', $company_data['countries_list']);
         } else {
             $company_countries = $company_data['countries_list'];
         }
         $_countries = array();
         foreach ($company_countries as $code) {
예제 #4
0
        }
    }
    Registry::get('view')->assign('location', $selected_location);
    if (!empty($_REQUEST['dynamic_object'])) {
        Registry::get('view')->assign('dynamic_object', $_REQUEST['dynamic_object']);
    }
    if (!empty($selected_location['dispatch'])) {
        Registry::get('view')->assign('dynamic_object_scheme', SchemesManager::getDynamicObject($selected_location['dispatch'], 'C'));
    }
    $theme = Themes::factory(fn_get_theme_path('[theme]', 'C'));
    Registry::get('view')->assign('theme_manifest', $theme->getManifest());
    $params = array('theme_name' => $theme->getThemeName());
    Registry::get('view')->assign('layouts', Layout::instance()->getList($params));
    Registry::get('view')->assign('all_layouts', Layout::instance()->getList());
    Registry::get('view')->assign('default_layouts_sources', fn_get_default_layouts_sources('responsive'));
    Registry::get('view')->assign('themes', fn_get_available_themes($theme->getThemeName()));
    $http_url = fn_get_storefront_url('http');
    $https_url = fn_get_storefront_url('https');
    Registry::get('view')->assign('widget_http_url', urlencode($http_url));
    Registry::get('view')->assign('widget_https_url', urlencode($https_url));
    if ($mode == 'manage') {
        Registry::get('view')->assign('layout_data', Layout::instance()->get(Registry::get('runtime.layout.layout_id')));
    } else {
        Registry::get('view')->display('views/block_manager/manage_in_tab.tpl');
        exit;
    }
} elseif ($mode == 'update_block') {
    $snapping_data = array();
    $editable_content = true;
    $editable_template_name = true;
    $editable_wrapper = false;
예제 #5
0
파일: themes.php 프로젝트: askzap/ultimate
                if (!empty($_REQUEST['state'])) {
                    fn_set_notification('W', __('warning'), __('warning_store_optimization_dev', array('[link]' => fn_url('themes.manage'))));
                } else {
                    fn_set_notification('W', __('warning'), __('warning_store_optimization_dev_disabled', array('[link]' => fn_url('themes.manage?ctpl'))));
                }
            }
        }
        exit;
    }
    return array(CONTROLLER_STATUS_OK, 'themes.manage');
}
if ($mode == 'manage') {
    if (fn_allowed_for('ULTIMATE') && !Registry::get('runtime.company_id')) {
        return array(CONTROLLER_STATUS_OK);
    }
    $available_themes = fn_get_available_themes(Registry::get('settings.theme_name'));
    if (!empty($available_themes['repo']) && !empty($available_themes['installed'])) {
        $available_themes['repo'] = array_diff_key($available_themes['repo'], $available_themes['installed']);
    }
    Tygh::$app['view']->assign('themes_prefix', fn_get_theme_path('[relative]', 'C'));
    Tygh::$app['view']->assign('repo_prefix', fn_get_theme_path('[repo]', 'C'));
    Registry::set('navigation.tabs', array('installed_themes' => array('title' => __('installed_themes'), 'js' => true), 'browse_all_available_themes' => array('title' => __('browse_all_available_themes'), 'js' => true)));
    $theme_name = fn_get_theme_path('[theme]', 'C');
    $layout = Layout::instance()->getDefault($theme_name);
    $style = Styles::factory($theme_name)->get($layout['style_id']);
    $layout['style_name'] = empty($style['name']) ? '' : $style['name'];
    Tygh::$app['view']->assign('layout', $layout);
    foreach ($available_themes['installed'] as $theme_id => $theme) {
        $layouts_params = array('theme_name' => $theme_id);
        $available_themes['installed'][$theme_id]['layouts'] = Layout::instance()->getList($layouts_params);
        if ($theme_id == $theme_name) {