コード例 #1
0
if ($mode == 'update') {
    $localizaton = fn_get_localization_data($_REQUEST['localization_id'], DESCR_SL, true);
    if (empty($localizaton)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    Registry::get('view')->assign('localization', $localizaton);
    Registry::get('view')->assign('localization_countries', array_diff(fn_get_simple_countries(), $localizaton['countries']));
    Registry::get('view')->assign('localization_currencies', array_diff(fn_get_simple_currencies(), $localizaton['currencies']));
    Registry::get('view')->assign('localization_languages', array_diff(fn_get_simple_languages(true), $localizaton['languages']));
    Registry::get('view')->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => __('general'), 'js' => true), 'details' => array('title' => __('items_title'), 'js' => true)));
} elseif ($mode == 'add') {
    Registry::get('view')->assign('localization_countries', fn_get_simple_countries());
    Registry::get('view')->assign('localization_currencies', fn_get_simple_currencies());
    Registry::get('view')->assign('localization_languages', fn_get_simple_languages(true));
    Registry::get('view')->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => __('general'), 'js' => true), 'details' => array('title' => __('items_title'), 'js' => true)));
} elseif ($mode == 'manage') {
    Registry::get('view')->assign('localizations', fn_get_localizations(DESCR_SL));
} elseif ($mode == 'delete') {
    if (!empty($_REQUEST['localization_id'])) {
        fn_delete_localization((array) $_REQUEST['localization_id']);
    }
    return array(CONTROLLER_STATUS_OK, "localizations.manage");
}
function fn_delete_localization($localization_ids)
{
    $loc_objects = fn_get_localization_objects();
    fn_set_progress('parts', sizeof($localization_ids) * sizeof($loc_objects));
    foreach ($localization_ids as $loc_id) {
        foreach ($loc_objects as $table) {
コード例 #2
0
ファイル: localizations.php プロジェクト: askzap/ultimate
if ($mode == 'update') {
    $localizaton = fn_get_localization_data($_REQUEST['localization_id'], DESCR_SL, true);
    if (empty($localizaton)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    Tygh::$app['view']->assign('localization', $localizaton);
    Tygh::$app['view']->assign('localization_countries', array_diff(fn_get_simple_countries(), $localizaton['countries']));
    Tygh::$app['view']->assign('localization_currencies', array_diff(fn_get_simple_currencies(), $localizaton['currencies']));
    Tygh::$app['view']->assign('localization_languages', array_diff(fn_get_simple_languages(true), $localizaton['languages']));
    Tygh::$app['view']->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => __('general'), 'js' => true), 'details' => array('title' => __('items_title'), 'js' => true)));
} elseif ($mode == 'add') {
    Tygh::$app['view']->assign('localization_countries', fn_get_simple_countries());
    Tygh::$app['view']->assign('localization_currencies', fn_get_simple_currencies());
    Tygh::$app['view']->assign('localization_languages', fn_get_simple_languages(true));
    Tygh::$app['view']->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => __('general'), 'js' => true), 'details' => array('title' => __('items_title'), 'js' => true)));
} elseif ($mode == 'manage') {
    Tygh::$app['view']->assign('localizations', fn_get_localizations(DESCR_SL));
}
function fn_delete_localization($localization_ids)
{
    $loc_objects = fn_get_localization_objects();
    fn_set_progress('parts', sizeof($localization_ids) * sizeof($loc_objects));
    foreach ($localization_ids as $loc_id) {
        foreach ($loc_objects as $table) {
            fn_set_progress('echo', __('converting_data_in_table', array('[table]' => $table)));
            db_query("UPDATE ?:{$table} SET localization = ?p", fn_remove_from_set('localization', $loc_id));
        }
        db_query("DELETE FROM ?:localizations WHERE localization_id = ?i", $loc_id);
        db_query("DELETE FROM ?:localization_descriptions WHERE localization_id = ?i", $loc_id);
コード例 #3
0
    $localizaton = fn_get_localization_data($_REQUEST['localization_id'], DESCR_SL, true);
    if (empty($localizaton)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    $view->assign('localization', $localizaton);
    $view->assign('localization_countries', array_diff(fn_get_simple_countries(), $localizaton['countries']));
    $view->assign('localization_currencies', array_diff(fn_get_simple_currencies(), $localizaton['currencies']));
    $view->assign('localization_languages', array_diff(fn_get_simple_languages(), $localizaton['languages']));
    $view->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => fn_get_lang_var('general'), 'js' => true), 'details' => array('title' => fn_get_lang_var('items_title'), 'js' => true)));
} elseif ($mode == 'add') {
    fn_add_breadcrumb(fn_get_lang_var('localizations'), "localizations.manage");
    $view->assign('localization_countries', fn_get_simple_countries());
    $view->assign('localization_currencies', fn_get_simple_currencies());
    $view->assign('localization_languages', fn_get_simple_languages());
    $view->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => fn_get_lang_var('general'), 'js' => true), 'details' => array('title' => fn_get_lang_var('items_title'), 'js' => true)));
} elseif ($mode == 'manage') {
    $view->assign('localizations', fn_get_localizations(DESCR_SL));
} elseif ($mode == 'delete') {
    if (!empty($_REQUEST['localization_id'])) {
        fn_delete_localization((array) $_REQUEST['localization_id']);
    }
    return array(CONTROLLER_STATUS_REDIRECT, "localizations.manage");
}
function fn_delete_localization($localization_ids)
{
    fn_start_scroller();
    foreach ($localization_ids as $loc_id) {
        foreach (fn_get_localization_objects() as $table) {
            fn_echo('<br />' . str_replace('[table]', $table, fn_get_lang_var('converting_data_in_table')) . '...' . '<br />');