Exemplo n.º 1
0
     }
     break;
 case 'datatable':
 default:
     if ($action && $tvid) {
         // document exists?
         $res = $modx->db->select('*', $modx->getFullTableName('site_content'), 'id=' . $docid);
         if ($modx->db->getRecordCount($res)) {
             // document with docId editable?
             $docObj = $modx->getPageInfo($docid, 0, '*');
             if ($docObj) {
                 // get the settings for the multiTV
                 $tvSettings = $modx->getTemplateVar($tvid, '*', $docid, $docObj['published']);
                 if ($tvSettings && ($tvSettings['elements'] = '@INCLUDE' . MTV_PATH . 'multitv.customtv.php')) {
                     $multiTV = new multiTV($modx, array('type' => 'tv', 'tvDefinitions' => $tvSettings, 'tvUrl' => MTV_PATH));
                     $includeFile = $multiTV->includeFile($action, 'processor');
                     // processor available?
                     if ($includeFile) {
                         include $includeFile;
                     } else {
                         $answer['error'] = true;
                         $answer['msg'] = $language['connector.noprocessor'];
                     }
                 } else {
                     $answer['error'] = true;
                     $answer['msg'] = $language['connector.nomultitv'];
                 }
             } else {
                 $answer['error'] = true;
                 $answer['msg'] = $language['connector.rights'];
             }