Example #1
0
 public static function execute($data)
 {
     $language = Languages::get($data['id']);
     $export_array = array();
     if ($data['include_data'] === true) {
         $export_array['language']['data'] = array('title-CDATA' => $language['name'], 'code-CDATA' => $language['code'], 'locale-CDATA' => $language['locale'], 'character_set-CDATA' => $language['charset'], 'text_direction-CDATA' => $language['text_direction'], 'date_format_short-CDATA' => $language['date_format_short'], 'date_format_long-CDATA' => $language['date_format_long'], 'time_format-CDATA' => $language['time_format'], 'default_currency-CDATA' => Currencies::get($language['currencies_id'], 'code'), 'numerical_decimal_separator-CDATA' => $language['numeric_separator_decimal'], 'numerical_thousands_separator-CDATA' => $language['numeric_separator_thousands']);
         if ($language['parent_id'] > 0) {
             $export_array['language']['data']['parent_language_code'] = Languages::get($language['parent_id'], 'code');
         }
     }
     $definitions = Languages::getDefinitions($data['id'], $data['groups']);
     $definitions = $definitions['entries'];
     foreach ($definitions as $def) {
         $export_array['language']['definitions']['definition'][] = array('key' => $def['definition_key'], 'value-CDATA' => $def['definition_value'], 'group' => $def['content_group']);
     }
     $xml = XML::fromArray($export_array, $language['charset']);
     header('Content-disposition: attachment; filename=' . $language['code'] . '.xml');
     header('Content-Type: application/force-download');
     header('Content-Transfer-Encoding: binary');
     header('Content-Length: ' . strlen($xml));
     header('Pragma: no-cache');
     header('Expires: 0');
     echo $xml;
     exit;
 }
Example #2
0
 public static function execute(ApplicationAbstract $application)
 {
     if (Languages::deleteGroup($_GET['group'])) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     osc_redirect_admin(OSCOM::getLink(null, null, 'id=' . $_GET['id']));
 }
Example #3
0
 public static function execute(ApplicationAbstract $application)
 {
     if (Languages::import($_POST['language_import'], $_POST['import_type'])) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     osc_redirect_admin(OSCOM::getLink());
 }
Example #4
0
 public static function execute($id)
 {
     $data = array('id' => $id);
     if (Languages::get($id, 'code') != DEFAULT_LANGUAGE && OSCOM::callDB('Admin\\Languages\\Delete', $data)) {
         Cache::clear('languages');
         return true;
     }
     return false;
 }
Example #5
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('code' => $_POST['language_import'], 'type' => $_POST['import_type']);
     if (Languages::import($data)) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
Example #6
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('language_id' => $_GET['id'], 'group' => $_GET['group'], 'definitions' => $_POST['def']);
     if (Languages::updateDefinition($data)) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group']));
 }
Example #7
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('group' => $_POST['defgroup'], 'key' => $_POST['key'], 'values' => $_POST['value']);
     if (Languages::insertDefinition($data)) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'id=' . $_GET['id'] . (isset($_GET['group']) ? '&group=' . $_GET['group'] : '')));
 }
Example #8
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('id' => $_GET['id'], 'name' => $_POST['name'], 'code' => $_POST['code'], 'locale' => $_POST['locale'], 'charset' => $_POST['charset'], 'date_format_short' => $_POST['date_format_short'], 'date_format_long' => $_POST['date_format_long'], 'time_format' => $_POST['time_format'], 'text_direction' => $_POST['text_direction'], 'currencies_id' => $_POST['currencies_id'], 'numeric_separator_decimal' => $_POST['numeric_separator_decimal'], 'numeric_separator_thousands' => $_POST['numeric_separator_thousands'], 'parent_id' => $_POST['parent_id'], 'sort_order' => $_POST['sort_order'], 'set_default' => isset($_POST['default']) && $_POST['default'] == 'on');
     if (Languages::update($data)) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     osc_redirect_admin(OSCOM::getLink());
 }
Example #9
0
 public static function execute($id)
 {
     $def = Languages::getDefinition($id);
     $data = array('id' => $id);
     if (OSCOM::callDB('Admin\\Languages\\DeleteDefinition', $data)) {
         Cache::clear('languages-' . Languages::get($def['languages_id'], 'code') . '-' . $def['content_group']);
         return true;
     }
     return false;
 }
 public static function execute($data)
 {
     $definitions = $data['definitions'];
     unset($data['definitions']);
     foreach ($definitions as $key => $value) {
         $data['key'] = $key;
         $data['value'] = $value;
         OSCOM::callDB('Admin\\Languages\\UpdateDefinition', $data);
         Cache::clear('languages-' . Languages::get($data['language_id'], 'code') . '-' . $data['group']);
     }
     return true;
 }
 protected function process()
 {
     $this->_page_title = OSCOM::getDef('heading_title');
     if (isset($_GET['id']) && is_numeric($_GET['id']) && Languages::exists($_GET['id'])) {
         $this->_page_contents = 'groups.php';
         $this->_page_title .= ': ' . Languages::get($_GET['id'], 'name');
         if (isset($_GET['group']) && Languages::isGroup($_GET['id'], $_GET['group'])) {
             $this->_page_contents = 'definitions.php';
             $this->_page_title .= ': ' . $_GET['group'];
         }
     }
 }
Example #12
0
 public static function execute()
 {
     if (!isset($_GET['search'])) {
         $_GET['search'] = '';
     }
     if (!empty($_GET['search'])) {
         $result = Languages::findDefinitions($_GET['id'], $_GET['group'], $_GET['search']);
     } else {
         $result = Languages::getDefinitions($_GET['id'], $_GET['group']);
     }
     $result['rpcStatus'] = RPC::STATUS_SUCCESS;
     echo json_encode($result);
 }
 public static function execute($data)
 {
     $languages = Languages::getAll(-1);
     $languages = $languages['entries'];
     $values = $data['values'];
     unset($data['values']);
     foreach ($languages as $l) {
         $data['language_id'] = $l['languages_id'];
         $data['value'] = $values[$l['languages_id']];
         OSCOM::callDB('Admin\\Languages\\InsertDefinition', $data);
         Cache::clear('languages-' . $l['code'] . '-' . $data['group']);
     }
     return true;
 }
Example #14
0
 public static function execute(ApplicationAbstract $application)
 {
     $error = false;
     foreach ($_POST['batch'] as $id) {
         if (!Languages::delete($id)) {
             $error = true;
             break;
         }
     }
     if ($error === false) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
Example #15
0
 public static function execute(ApplicationAbstract $application)
 {
     $error = false;
     foreach ($_POST['batch'] as $id) {
         if (!Languages::deleteDefinition($id)) {
             $error = true;
             break;
         }
     }
     if ($error === false) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     osc_redirect_admin(OSCOM::getLink(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group']));
 }
Example #16
0
 public static function execute()
 {
     if (!isset($_GET['search'])) {
         $_GET['search'] = '';
     }
     if (!isset($_GET['page']) || !is_numeric($_GET['page'])) {
         $_GET['page'] = 1;
     }
     if (!empty($_GET['search'])) {
         $result = Languages::find($_GET['search'], $_GET['page']);
     } else {
         $result = Languages::getAll($_GET['page']);
     }
     $result['rpcStatus'] = RPC::STATUS_SUCCESS;
     echo json_encode($result);
 }
Example #17
0
 public static function execute($data)
 {
     $source = array('language' => XML::toArray(simplexml_load_file(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/Languages/' . $data['code'] . '.xml')));
     $language = array('name' => $source['language']['data']['title'], 'code' => $source['language']['data']['code'], 'locale' => $source['language']['data']['locale'], 'charset' => $source['language']['data']['character_set'], 'date_format_short' => $source['language']['data']['date_format_short'], 'date_format_long' => $source['language']['data']['date_format_long'], 'time_format' => $source['language']['data']['time_format'], 'text_direction' => $source['language']['data']['text_direction'], 'currency' => $source['language']['data']['default_currency'], 'numeric_separator_decimal' => $source['language']['data']['numerical_decimal_separator'], 'numeric_separator_thousands' => $source['language']['data']['numerical_thousands_separator'], 'parent_language_code' => isset($source['language']['data']['parent_language_code']) ? $source['language']['data']['parent_language_code'] : '', 'parent_id' => 0);
     if (!Currencies::exists($language['currency'])) {
         $language['currency'] = DEFAULT_CURRENCY;
     }
     $language['currencies_id'] = Currencies::get($language['currency'], 'currencies_id');
     if (!empty($language['parent_language_code']) && Languages::exists($language['parent_language_code'])) {
         $language['parent_id'] = Languages::get($language['parent_language_code'], 'languages_id');
     }
     $language['id'] = Languages::get($language['code'], 'languages_id');
     $language['default_language_id'] = Languages::get(DEFAULT_LANGUAGE, 'languages_id');
     $language['import_type'] = $data['type'];
     $definitions = array();
     if (isset($source['language']['definitions']['definition'])) {
         $definitions = $source['language']['definitions']['definition'];
         if (isset($definitions['key']) && isset($definitions['value']) && isset($definitions['group'])) {
             $definitions = array(array('key' => $definitions['key'], 'value' => $definitions['value'], 'group' => $definitions['group']));
         }
     }
     unset($source);
     $OSCOM_DirectoryListing = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/Languages/' . $data['code']);
     $OSCOM_DirectoryListing->setRecursive(true);
     $OSCOM_DirectoryListing->setIncludeDirectories(false);
     $OSCOM_DirectoryListing->setAddDirectoryToFilename(true);
     $OSCOM_DirectoryListing->setCheckExtension('xml');
     foreach ($OSCOM_DirectoryListing->getFiles() as $files) {
         $definitions = array_merge($definitions, Language::extractDefinitions($data['code'] . '/' . $files['name']));
     }
     $language['definitions'] = $definitions;
     if (OSCOM::callDB('Admin\\Languages\\Import', $language)) {
         Cache::clear('languages');
         return true;
     }
     return false;
 }
Example #18
0
<?php

/*
  osCommerce Online Merchant $osCommerce-SIG$
  Copyright (c) 2010 osCommerce (http://www.oscommerce.com)

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License v2 (1991)
  as published by the Free Software Foundation.
*/
use osCommerce\OM\Core\ObjectInfo;
use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
use osCommerce\OM\Core\OSCOM;
$OSCOM_ObjectInfo = new ObjectInfo(Languages::getDefinition($_GET['dID']));
?>

<h1><?php 
echo $OSCOM_Template->getIcon(32) . osc_link_object(OSCOM::getLink(), $OSCOM_Template->getPageTitle());
?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    echo $OSCOM_MessageStack->get();
}
?>

<div class="infoBox">
  <h3><?php 
echo osc_icon('trash.png') . ' ' . $OSCOM_ObjectInfo->getProtected('definition_key');
?>
Example #19
0
<?php

/**
 * osCommerce Online Merchant
 * 
 * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
 * @license BSD License; http://www.oscommerce.com/bsdlicense.txt
 */
use osCommerce\OM\Core\HTML;
use osCommerce\OM\Core\OSCOM;
use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
$languages_array = array();
foreach (Languages::getDirectoryListing() as $directory) {
    $languages_array[] = array('id' => $directory, 'text' => $directory);
}
?>

<h1><?php 
echo $OSCOM_Template->getIcon(32) . HTML::link(OSCOM::getLink(), $OSCOM_Template->getPageTitle());
?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    echo $OSCOM_MessageStack->get();
}
?>

<div class="infoBox">
  <h3><?php 
echo HTML::icon('new.png') . ' ' . OSCOM::getDef('action_heading_import_language');
<?php

/**
 * osCommerce Online Merchant
 * 
 * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
 * @license BSD License; http://www.oscommerce.com/bsdlicense.txt
 */
use osCommerce\OM\Core\HTML;
use osCommerce\OM\Core\ObjectInfo;
use osCommerce\OM\Core\OSCOM;
use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
$groups_array = array();
foreach (ObjectInfo::to(Languages::getGroups($_GET['id']))->get('entries') as $value) {
    $groups_array[] = $value['content_group'];
}
?>

<h1><?php 
echo $OSCOM_Template->getIcon(32) . HTML::link(OSCOM::getLink(), $OSCOM_Template->getPageTitle());
?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    echo $OSCOM_MessageStack->get();
}
?>

<div class="infoBox">
  <h3><?php 
Example #21
0
<?php

/**
 * osCommerce Online Merchant
 * 
 * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
 * @license BSD License; http://www.oscommerce.com/bsdlicense.txt
 */
use osCommerce\OM\Core\HTML;
use osCommerce\OM\Core\ObjectInfo;
use osCommerce\OM\Core\OSCOM;
use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
$OSCOM_ObjectInfo = new ObjectInfo(Languages::get($_GET['id']));
?>

<h1><?php 
echo $OSCOM_Template->getIcon(32) . HTML::link(OSCOM::getLink(), $OSCOM_Template->getPageTitle());
?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    echo $OSCOM_MessageStack->get();
}
?>

<div class="infoBox">
  <h3><?php 
echo HTML::icon('trash.png') . ' ' . $OSCOM_ObjectInfo->getProtected('name');
?>
</h3>
Example #22
0
 public static function execute($id)
 {
     return Languages::get($id) !== false;
 }
</h3>

  <form name="lDefineBatch" class="dataForm" action="<?php 
echo OSCOM::getLink(null, null, 'BatchSaveDefinitions&Process&id=' . $_GET['id'] . '&group=' . $_GET['group']);
?>
" method="post">

  <p><?php 
echo OSCOM::getDef('introduction_edit_language_definitions');
?>
</p>

  <fieldset>

<?php 
foreach ($_POST['batch'] as $id) {
    $OSCOM_ObjectInfo = new ObjectInfo(Languages::getDefinition($id));
    echo '<p><label for="def[' . $OSCOM_ObjectInfo->getProtected('definition_key') . ']">' . $OSCOM_ObjectInfo->getProtected('definition_key') . '</label>' . HTML::textareaField('def[' . $OSCOM_ObjectInfo->get('definition_key') . ']', $OSCOM_ObjectInfo->get('definition_value')) . HTML::hiddenField('batch[]', $OSCOM_ObjectInfo->getInt('id')) . '</p>';
}
?>

  </fieldset>

  <p><?php 
echo HTML::button(array('priority' => 'primary', 'icon' => 'check', 'title' => OSCOM::getDef('button_save'))) . ' ' . HTML::button(array('href' => OSCOM::getLink(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group']), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel')));
?>
</p>

  </form>
</div>
Example #24
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('id' => $_GET['id'], 'groups' => $_POST['groups'], 'include_data' => isset($_POST['include_data']) && $_POST['include_data'] == 'on');
     Languages::export($data);
 }
Example #25
0
?>
" method="post">

  <p><?php 
echo OSCOM::getDef('introduction_delete_definition_group');
?>
</p>

  <p><?php 
echo '<b>' . osc_output_string_protected($_GET['group']) . '</b>';
?>
</p>

  <p>

<?php 
foreach ($OSCOM_ObjectInfo->get('entries') as $l) {
    echo Languages::get($l['languages_id'], 'name') . ': ' . (int) $l['total_entries'] . '<br />';
}
?>

  </p>

  <p><?php 
echo osc_draw_button(array('priority' => 'primary', 'icon' => 'trash', 'title' => OSCOM::getDef('button_delete'))) . ' ' . osc_draw_button(array('href' => OSCOM::getLink(null, null, 'id=' . $_GET['id']), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel')));
?>
</p>

  </form>
</div>
Example #26
0
 public static function execute(ApplicationAbstract $application)
 {
     Languages::export($_GET['id'], $_POST['groups'], isset($_POST['include_data']) && $_POST['include_data'] == 'on');
 }
Example #27
0
<?php

/*
  osCommerce Online Merchant $osCommerce-SIG$
  Copyright (c) 2010 osCommerce (http://www.oscommerce.com)

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License v2 (1991)
  as published by the Free Software Foundation.
*/
use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
use osCommerce\OM\Core\OSCOM;
$groups_array = array();
foreach (osc_toObjectInfo(Languages::getDefinitionGroups($_GET['id']))->get('entries') as $value) {
    $groups_array[] = $value['content_group'];
}
?>

<h1><?php 
echo $OSCOM_Template->getIcon(32) . osc_link_object(OSCOM::getLink(), $OSCOM_Template->getPageTitle());
?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    echo $OSCOM_MessageStack->get();
}
?>

<div class="infoBox">
  <h3><?php 
 public static function execute(ApplicationAbstract $application)
 {
     if (Languages::isGroup($_GET['id'], $_GET['group'])) {
         $application->setPageContent('groups_delete.php');
     }
 }
Example #29
0
<?php

/*
  osCommerce Online Merchant $osCommerce-SIG$
  Copyright (c) 2010 osCommerce (http://www.oscommerce.com)

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License v2 (1991)
  as published by the Free Software Foundation.
*/
use osCommerce\OM\Core\ObjectInfo;
use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
use osCommerce\OM\Core\OSCOM;
$OSCOM_ObjectInfo = new ObjectInfo(Languages::get($_GET['id']));
$groups_array = array();
foreach (osc_toObjectInfo(Languages::getGroups($OSCOM_ObjectInfo->getInt('languages_id')))->get('entries') as $group) {
    $groups_array[] = array('id' => $group['content_group'], 'text' => $group['content_group']);
}
?>

<h1><?php 
echo $OSCOM_Template->getIcon(32) . osc_link_object(OSCOM::getLink(), $OSCOM_Template->getPageTitle());
?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    echo $OSCOM_MessageStack->get();
}
?>