Ejemplo n.º 1
0
     }
     break;
 case 'addTemplate':
     $template = $this->params['template'];
     // Check if root node is selected
     if ($template === 'root') {
         // Get real Page-ID of Root-Node
         $templates = $templateMgr->getList();
         $template = $templates[0]['ID'];
     }
     // Check if a folder is selected
     $templateInfo = $templateMgr->getTemplate($template);
     if ($templateInfo['FOLDER'] == 1) {
         // Add new child node
         $new_id = $templateMgr->add($template);
         $templateMgr->setName($new_id, $itext['TXT_NEW_OBJECT']);
         //$templateMgr->setIdentifier( $new_id, $itext['TXT_NEW_OBJECT'] );
         if ($new_id != false) {
             $icons = new Icons();
             if ($template == 1) {
                 // Rootfolder
                 $koala->callJSFunction('Koala.yg_addChild', 'template', $template . '-template', 'name', $itext['TXT_NEW_OBJECT'], 'template', $new_id . '-template', 'name', $icons->icon['template_small'], 'nosub', true);
             } else {
                 // Other folder
                 $koala->callJSFunction('Koala.yg_addChild', 'templatefolder', $template . '-template', 'name', $itext['TXT_NEW_OBJECT'], 'template', $new_id . '-template', 'name', $icons->icon['template_small'], 'nosub', true);
             }
         } else {
             $koala->alert($itext['TXT_ERROR_ACCESS_DENIED']);
         }
     }
     break;
Ejemplo n.º 2
0
         $result = checkLinkInternalExternal($value);
         if ($result['TYPE'] != 'external') {
             $value = createSpecialURLfromShortURL($value);
         }
     }
     // Special handling for textareas
     if ($propertyInfo[0]['TYPE'] == 'TEXTAREA') {
         $value = str_replace('\\n', "\n", $value);
     }
     // Special handling for wysiwyg
     if ($propertyInfo[0]['TYPE'] == 'RICHTEXT') {
         $value = str_replace('\\n', "\n", $value);
         $value = convertShortURLsToSpecialURLs($value);
     }
     // Set the new property
     if ($templateMgr->setName($data[0], $value) === false) {
         $koala->alert($itext['TXT_ERROR_ACCESS_DENIED']);
     } else {
         $value = str_replace("\n", '\\n', $value);
         $jsQueue->add($data[0], HISTORYTYPE_TEMPLATE, 'OBJECT_CHANGE', sGuiUS(), 'template', NULL, NULL, $this->reponsedata[$property]->yg_id, 'name', $value);
         $koala->queueScript("Koala.yg_fadeFields(\$('" . $winID . "'), '.changed');");
         // Special case for name
         $jsQueue->add($data[0], HISTORYTYPE_TEMPLATE, 'REFRESH_WINDOW', sGuiUS(), 'name');
     }
     break;
 case 'entrymask':
     $entrymaskMgr = new Entrymasks();
     // Get the entrymask
     $entrymask = $entrymaskMgr->get($data[0]);
     $oldname = $entrymask['NAME'];
     $value = str_replace("\r", '', str_replace("\n", '\\n', $this->reponsedata[$property]->value));