Esempio n. 1
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;
 }
Esempio n. 2
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');
?>
</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>