예제 #1
0
<?php

/**
* @version 			SEBLOD 3.x Core ~ $Id: default.php sebastienheraud $
* @package			SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder)
* @url				http://www.seblod.com
* @editor			Octopoos - www.octopoos.com
* @copyright		Copyright (C) 2013 SEBLOD. All Rights Reserved.
* @license 			GNU General Public License version 2 or later; see _LICENSE.php
**/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
Helper_Include::addScriptDeclaration($this->config['javascript']);
if (JCck::getConfig_Param('validation', 2) > 1 && $this->config['validation'] != '') {
    Helper_Include::addValidation($this->config['validation'], $this->config['validation_options']);
    $js = 'if (task == "form.cancel") { Joomla.submitform(task, document.getElementById("seblod_form")); } else { if (jQuery("#seblod_form").validationEngine("validate",task) === true) { if (jQuery("#seblod_form").isStillReady() === true) { jQuery("#seblod_form input[name=\'config[unique]\']").val("seblod_form"); Joomla.submitform(task, document.getElementById("seblod_form")); } } }';
} else {
    $js = 'if (jQuery("#seblod_form").isStillReady() === true) { jQuery("#seblod_form input[name=\'config[unique]\']").val("seblod_form"); Joomla.submitform(task, document.getElementById("seblod_form")); }';
}
?>

<script type="text/javascript">
<?php 
echo $this->config['submit'];
?>
 = function(task) { <?php 
echo $js;
?>
 }
</script>
예제 #2
0
 public static function validate($config, $id = 'adminForm')
 {
     $config['validation'] = count($config['validation']) ? implode(',', $config['validation']) : '"null":{}';
     $config['validation_options'] = new JRegistry(array('validation_background_color' => '#242424', 'validation_color' => '#ffffff', 'validation_position' => 'topRight', 'validation_scroll' => 0));
     Helper_Include::addValidation($config['validation'], $config['validation_options'], $id);
     if (isset($config['fields']) && count($config['fields'])) {
         JFactory::getDocument()->addScriptDeclaration('var cck_dev = ' . json_encode($config['fields']) . ';');
     }
 }
예제 #3
0
<?php

/**
* @version 			SEBLOD 3.x Core ~ $Id: default.php sebastienheraud $
* @package			SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder)
* @url				http://www.seblod.com
* @editor			Octopoos - www.octopoos.com
* @copyright		Copyright (C) 2013 SEBLOD. All Rights Reserved.
* @license 			GNU General Public License version 2 or later; see _LICENSE.php
**/
defined('_JEXEC') or die;
if ((int) $config['error'] == 1) {
    return;
}
if (JCck::getConfig_Param('validation', 2) > 1 && $config['validation'] != '') {
    Helper_Include::addValidation($config['validation'], $config['validation_options'], $formId);
    $js = 'if (jQuery("#' . $formId . '").validationEngine("validate",task) === true) { if (jQuery("#' . $formId . '").isStillReady() === true) { jQuery("#' . $formId . ' input[name=\'config[unique]\']").val("' . $formId . '"); JCck.Core.submitForm("save", document.getElementById("' . $formId . '")); } }';
} else {
    $js = 'if (jQuery("#' . $formId . '").isStillReady() === true) { jQuery("#' . $formId . ' input[name=\'config[unique]\']").val("' . $formId . '"); JCck.Core.submitForm("save", document.getElementById("' . $formId . '")); }';
}
?>
<script type="text/javascript">
<?php 
echo $config['submit'];
?>
 = function(task) { <?php 
echo $js;
?>
 }
</script>
<?php 
예제 #4
0
파일: dev.php 프로젝트: densem-2013/exikom
 public static function validate($config, $id = 'adminForm')
 {
     $config['validation'] = count($config['validation']) ? implode(',', $config['validation']) : '"null":{}';
     $config['validation_options'] = new JRegistry(array('validation_background_color' => '#242424', 'validation_color' => '#ffffff', 'validation_position' => 'topRight', 'validation_scroll' => 0));
     // require_once JPATH_BASE.'/components/com_cck/helpers/helper_include.php'; // todo: include for manual use of JCckDev (but not for add-on.. :/)
     Helper_Include::addValidation($config['validation'], $config['validation_options'], $id);
     if (isset($config['fields']) && count($config['fields'])) {
         JFactory::getDocument()->addScriptDeclaration('var cck_dev = ' . json_encode($config['fields']) . ';');
     }
 }