OK ... I searched a little bit through the .php files of QuickEdit, NewsPublisherTagging and the handlers for Template Variables:
assets/modules/quick_edit/output.class.inc.php line 168-206:
$cvs = $modx->getTemplateVars('*', 'id, name', '', 1, 'name');
foreach ($cvs as $content) {
if (isset ($content['id']) || in_array($content['name'], $editable)) {
if (isset ($content['id'])) {
$cv_obj->set($content['id']);
} else {
$cv_obj->set($content['name']);
}
if ($cv_obj && $cv_obj->checkPermissions()) {
// Get the menu
$menu = $cv_obj->group;
// Check for special CV types //
// One checkbox and not a binding
if ($cv_obj->type == 'checkbox' && !strpos($cv_obj->elements, '||') && substr($cv_obj->elements, 0, 1) != '@') {
$class = ($cv_obj->content ? 'unchecked' : 'checked');
$change_value = ($cv_obj->content ? '' : (strpos($cv_obj->elements, '==') ? substr(strstr($cv_obj->elements, '=='), 2) : $cv_obj->elements));
$menus[$menu][] .=<<<EOD
<a class="{$class}" href="javascript: qe.ajaxSave('{$cv_obj->id}', '{$cv_obj->name}', '{$change_value}');" title="{$QE_lang['edit']} {$cv_obj->description}">{$cv_obj->caption}</a>
EOD;
// Everything else
} else {
$menus[$menu][] .=<<<EOD
<a href="javascript: qe.open('{$cv_obj->id}');" title="{$QE_lang['edit']} {$cv_obj->description}">{$cv_obj->caption}</a>
EOD;
}
}
}
It seems, that QuickEdit asks, if the checkbox is a @-binding, but it doesn´t really do the SQL-query ...
snippet.NewsPublisherTagging.1.4-1.0.php line 176-184:
// tagging
$tags = array();
foreach($_POST as $n=>$v) {
if( substr($n, 0, 5)=='tags-' && $v=='on' ){
array_push($tags, substr($n, 5));
unset($_POST[$n]);
}
}
$tags_tvcontent = implode('||', $tags);
NewsPublisherTagging doesn´t even ask, if the checkbox is a @-binding ...
manager/includes/tmplvars.commands.inc.php line 7-47
global $BINDINGS; // Array of supported bindings. must be upper case
$BINDINGS = array('FILE','CHUNK','DOCUMENT','SELECT','EVAL','INHERIT','DIRECTORY');
function ProcessTVCommand($value, $name=''){
global $modx;
$etomite = &$modx;
$nvalue = trim($value);
if (substr($nvalue,0,1)!='@') return $value;
else {
list($cmd,$param) = ParseCommand($nvalue);
switch ($cmd) {
case "FILE":
...
case "SELECT": // selects a record from the cms database
$rt = array();
$replacementVars= array(
'DBASE'=> $modx->db->config['dbase'],
'PREFIX'=> $modx->db->config['table_prefix']
);
foreach($replacementVars as $key=> $value) {
$modx->setPlaceholder($key, $value);
}
$param = $modx->mergePlaceholderContent($param);
$rs = $modx->db->query("SELECT $param;");
$output = $rs;
break;
... this seems to be the appropriate way to solve @-bindings. But how can I refer to this code or include this code in QuickEdit or NewsPublisherTagging?
I would be very happy to get some help ...
thanks a lot ...