Ejemplo n.º 1
0
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with Plugin Barcode. If not, see <http://www.gnu.org/licenses/>.

  ------------------------------------------------------------------------

  @package   Plugin Barcode
  @author    David Durieux
  @co-author
  @copyright Copyright (c) 2009-2013 Barcode plugin Development team
  @license   AGPL License 3.0 or (at your option) any later version
             http://www.gnu.org/licenses/agpl-3.0-standalone.html
  @link      https://forge.indepnet.net/projects/barscode
  @since     2009

  ------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file: Vincent Mazzoni
// Purpose of file:
// ----------------------------------------------------------------------
include '../../../inc/includes.php';
if (isset($_POST['type'])) {
    $pbcconf = new PluginBarcodeConfig_Type();
    if ($res = array_keys($pbcconf->find("`type`='" . $_POST['type'] . "'"))) {
        $_POST['id'] = $res[0];
        $pbcconf->update($_POST);
    }
}
Html::back();
 function getConfigType($p_type = NULL)
 {
     if (is_null($p_type)) {
         $p_type = $this->getConfig();
     }
     $pbcconf = new PluginBarcodeConfig_Type();
     if ($res = array_keys($pbcconf->find("`type`='{$p_type}'"))) {
         $id = $res[0];
         $pbcconf->getFromDB($id);
         $config['type'] = $pbcconf->fields['type'];
         $config['size'] = $pbcconf->fields['size'];
         $config['orientation'] = $pbcconf->fields['orientation'];
         $config['marginTop'] = $pbcconf->fields['marginTop'];
         $config['marginBottom'] = $pbcconf->fields['marginBottom'];
         $config['marginLeft'] = $pbcconf->fields['marginLeft'];
         $config['marginRight'] = $pbcconf->fields['marginRight'];
         $config['marginHorizontal'] = $pbcconf->fields['marginHorizontal'];
         $config['marginVertical'] = $pbcconf->fields['marginVertical'];
         $config['maxCodeWidth'] = $pbcconf->fields['maxCodeWidth'];
         $config['maxCodeHeight'] = $pbcconf->fields['maxCodeHeight'];
     } else {
         $config['type'] = 'code128';
         $config['size'] = 'A4';
         $config['orientation'] = 'Portrait';
         $config['marginTop'] = 30;
         $config['marginBottom'] = 30;
         $config['marginLeft'] = 30;
         $config['marginRight'] = 30;
         $config['marginHorizontal'] = 25;
         $config['marginVertical'] = 30;
         $config['maxCodeWidth'] = 110;
         $config['maxCodeHeight'] = 70;
     }
     return $config;
 }