コード例 #1
0
ファイル: select_all.php プロジェクト: cretzu89/EPESI
}
define('JS_OUTPUT', 1);
define('CID', $_POST['cid']);
define('READ_ONLY_SESSION', true);
require_once '../../../../include.php';
foreach ($_POST as $k => $v) {
    $_POST[$k] = trim($v, '"');
}
$path = $_POST['path'];
$crits = Module::static_get_module_variable($path, 'crits_stuff', null);
$order = Module::static_get_module_variable($path, 'order_stuff', null);
$tab = Module::static_get_module_variable($path, 'tab', null);
$element = Module::static_get_module_variable($path, 'element', null);
$func = Module::static_get_module_variable($path, 'format_func', null);
$browsed_records = Module::static_get_module_variable($path, 'rpicker_ind', null);
ModuleManager::load_modules();
if ($tab === null || $browsed_records === null || $crits === null || $order === null || $element === null || $func === null) {
    die('alert(\'Invalid usage - variables not set (path - ' . $path . ', module vars - ' . epesi::escapeJS(print_r($_SESSION['client']['__module_vars__'][$path], true)) . ')\');');
}
$tab_info = Utils_RecordBrowserCommon::init($tab);
$records = Utils_RecordBrowserCommon::get_records($tab, $crits, array(), $order, array());
$js = '';
//foreach ($browsed_records as $r) {
//	$js .= '$(\'leightbox_rpicker_'.$element.'_'.$r.'\').checked='.($_POST['select']?1:0).';';
//}
foreach ($records as $row) {
    $js .= 'rpicker_move(\'' . $element . '\',' . $row['id'] . ',\'' . epesi::escapeJS(is_callable($func) ? htmlspecialchars_decode(strip_tags(call_user_func($func, $row, true))) : '') . '\',' . ($_POST['select'] ? 1 : 0) . ');';
}
$js .= 'Epesi.procOn--;Epesi.updateIndicator();';
//error_log($js."\n",3,'data/log.txt');
print $js;
コード例 #2
0
ファイル: select_all.php プロジェクト: cretzu89/EPESI
 */
if (!isset($_POST['select']) || !isset($_POST['path']) || !isset($_POST['cid'])) {
    die('alert(\'Invalid request\')');
}
define('JS_OUTPUT', 1);
define('CID', $_POST['cid']);
require_once '../../../../include.php';
foreach ($_POST as $k => $v) {
    $_POST[$k] = trim($v, '"');
}
$path = $_POST['path'];
$select = json_decode($_POST['select']);
$tab = Module::static_get_module_variable($path, 'tab', null);
$crits = Module::static_get_module_variable($path, 'crits_stuff', null);
$rp_path = Module::static_get_module_variable($path, 'rp_fs_path', null);
$selected =& Module::static_get_module_variable($rp_path, 'selected', array());
ModuleManager::load_modules();
if ($tab === null || $crits === null || $rp_path === null) {
    die('alert(\'Invalid usage - variables not set (path - ' . $path . ', module vars - ' . epesi::escapeJS(print_r($_SESSION['client']['__module_vars__'][$path], true)) . ')\');');
}
$tab_info = Utils_RecordBrowserCommon::init($tab);
$records = Utils_RecordBrowserCommon::get_records($tab, $crits, array('id'));
foreach ($records as $r) {
    if ($select) {
        $selected[$r['id']] = 1;
    } else {
        unset($selected[$r['id']]);
    }
}
session_commit();
print 'Epesi.procOn--;_chj(\'\',\'\',\'queue\');';