/**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $this->_genNode = XmlUtil::CreateChild($current, $this->_NODE, "");
     XmlUtil::AddAttribute($this->_genNode, "id", $this->getId());
     XmlUtil::AddAttribute($this->_genNode, "style", $this->getStyle());
     parent::generatePage($this->_genNode);
 }
 /**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $nodeWorking = XmlUtil::CreateChild($current, "imagevalidate", "");
     XmlUtil::AddAttribute($nodeWorking, "caption", $this->_caption);
     XmlUtil::AddAttribute($nodeWorking, "challengequestion", $this->_challengeQuestion);
     XmlUtil::AddAttribute($nodeWorking, "chars", $this->_chars);
 }
Exemple #3
0
 /**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     XmlUtil::AddAttribute($current, "ENCTYPE", 'multipart/form-data');
     $nodeWorking = XmlUtil::CreateChild($current, "file", "");
     XmlUtil::AddAttribute($nodeWorking, "caption", $this->_caption);
     XmlUtil::AddAttribute($nodeWorking, "name", $this->_name);
 }
Exemple #4
0
 /**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $node = XmlUtil::CreateChild($current, "external");
     if ($this->_name != "") {
         XmlUtil::AddAttribute($node, "name", $this->_name);
     }
     XmlUtil::AddAttribute($node, "src", $this->_src);
     XmlUtil::AddAttribute($node, "width", $this->_width);
     XmlUtil::AddAttribute($node, "height", $this->_height);
 }
Exemple #5
0
 /**
  *@desc Generate page, processing yours childs using the parent.
  *@return DOMDocument
  */
 public function makeDomObject()
 {
     $xmlDoc = XmlUtil::CreateXmlDocument();
     $root = XmlUtil::CreateChild($xmlDoc, "root");
     // Process ALL XmlnukeDocumentObject existing in Collection.
     //----------------------------------------------------------
     parent::generatePage($root);
     //----------------------------------------------------------
     return $xmlDoc;
 }
Exemple #6
0
 public function generateObject($current)
 {
     $node = XmlUtil::CreateChild($current, "faq", "");
     XmlUtil::AddAttribute($node, "title", $this->_title);
     foreach ($this->_faqs as $key => $value) {
         $nodefaq = XmlUtil::CreateChild($node, "item", "");
         XmlUtil::AddAttribute($nodefaq, "question", $key);
         $value->generateObject($nodefaq);
     }
 }
Exemple #7
0
 /**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $nodeWorking = XmlUtil::CreateChild($current, "a", "");
     $link = str_replace("&", "&", $this->_src);
     XmlUtil::AddAttribute($nodeWorking, "href", $link);
     if ($this->_target != "") {
         XmlUtil::AddAttribute($nodeWorking, "target", $this->_target);
     }
     $this->generatePage($nodeWorking);
 }
Exemple #8
0
 public function addFlash($movie, $width, $height)
 {
     $nodeWorking = XmlUtil::CreateChild($this->_nodePage, "script", "");
     XmlUtil::AddAttribute($nodeWorking, "movie", $movie);
     XmlUtil::AddAttribute($nodeWorking, "width", (string) $width);
     XmlUtil::AddAttribute($nodeWorking, "height", (string) $height);
 }
Exemple #9
0
 public function generateObject($current)
 {
     $mediaGallery = XmlUtil::CreateChild($current, "mediagallery");
     XmlUtil::AddAttribute($mediaGallery, "name", $this->_name);
     XmlUtil::AddAttribute($mediaGallery, "api", $this->_api ? "true" : "false");
     XmlUtil::AddAttribute($mediaGallery, "visible", $this->_visible ? "true" : "false");
     XmlUtil::AddAttribute($mediaGallery, "showthumbcaption", $this->_showCaptionOnThumb ? "true" : "false");
     $this->generatePage($mediaGallery);
     return $mediaGallery;
 }
Exemple #10
0
 /**
  *  Contains specific instructions to generate all XML informations
  *  This method is processed only one time
  *  Usually is the last method processed
  *
  * @param DOMNode $current
  */
 public function generateObject($current)
 {
     $nodeWorking = null;
     // Criando o objeto que conterá a lista
     switch ($this->_easyListType) {
         case EasyListType::CHECKBOX:
             XmlUtil::CreateChild($current, "caption", $this->_caption);
             $nodeWorking = $current;
             $iHid = new XmlInputHidden("qty" . $this->_name, count($this->_values));
             $iHid->generateObject($nodeWorking);
             break;
         case EasyListType::RADIOBOX:
             XmlUtil::CreateChild($current, "caption", $this->_caption);
             $nodeWorking = $current;
             break;
         case EasyListType::SELECTLIST:
         case EasyListType::SELECTIMAGELIST:
             if ($this->_readOnly) {
                 if ($this->_easyListType == EasyListType::SELECTLIST) {
                     $deliLeft = strlen($this->_readOnlyDeli) != 0 ? $this->_readOnlyDeli[0] : "";
                     $deliRight = strlen($this->_readOnlyDeli) != 0 ? $this->_readOnlyDeli[1] : "";
                     //XmlInputHidden $xih
                     //XmlInputLabelField $xlf
                     $xlf = new XmlInputLabelField($this->_caption, $deliLeft . $this->_values[$this->_selected] . $deliRight);
                     $xih = new XmlInputHidden($this->_name, $this->_selected);
                     $xlf->generateObject($current);
                     $xih->generateObject($current);
                 } elseif ($this->_easyListType == EasyListType::SELECTIMAGELIST) {
                     $img = new XmlnukeImage($this->_values[$this->_selected]);
                     $img->generateObject($current);
                 }
                 return;
             } else {
                 $nodeWorking = XmlUtil::CreateChild($current, "select", "");
                 XmlUtil::AddAttribute($nodeWorking, "caption", $this->_caption);
                 XmlUtil::AddAttribute($nodeWorking, "name", $this->_name);
                 if ($this->_required) {
                     XmlUtil::AddAttribute($nodeWorking, "required", "true");
                 }
                 if ($this->_size > 1) {
                     XmlUtil::AddAttribute($nodeWorking, "size", $this->_size);
                 }
                 if ($this->_easyListType == EasyListType::SELECTIMAGELIST) {
                     XmlUtil::AddAttribute($nodeWorking, "imagelist", "true");
                     XmlUtil::AddAttribute($nodeWorking, "thumbnailsize", $this->_thumbnailSize);
                     XmlUtil::AddAttribute($nodeWorking, "notfoundimage", $this->_notFoundImage);
                     XmlUtil::AddAttribute($nodeWorking, "noimage", $this->_noImage);
                 }
             }
             break;
         case EasyListType::UNORDEREDLIST:
             XmlUtil::CreateChild($current, "b", $this->_caption);
             $nodeWorking = XmlUtil::CreateChild($current, "ul", "");
             break;
     }
     $i = 0;
     foreach ($this->_values as $key => $value) {
         switch ($this->_easyListType) {
             case EasyListType::CHECKBOX:
                 //					XmlInputCheck $iCk
                 $iCk = new XmlInputCheck($value, $this->_name . $i++, $key);
                 $iCk->setType(InputCheckType::CHECKBOX);
                 $iCk->setChecked($key == $this->_selected);
                 $iCk->setReadOnly($this->_readOnly);
                 $iCk->generateObject($nodeWorking);
                 break;
             case EasyListType::RADIOBOX:
                 //					XmlInputCheck $iCk
                 $iCk = new XmlInputCheck($value, $this->_name, $key);
                 $iCk->setType(InputCheckType::RADIOBOX);
                 $iCk->setChecked($key == $this->_selected);
                 $iCk->setReadOnly($this->_readOnly);
                 $iCk->generateObject($nodeWorking);
                 break;
             case EasyListType::SELECTLIST:
             case EasyListType::SELECTIMAGELIST:
                 $node = XmlUtil::CreateChild($nodeWorking, "option", "");
                 XmlUtil::AddAttribute($node, "value", $key);
                 if ($key == $this->_selected) {
                     XmlUtil::AddAttribute($node, "selected", "yes");
                 }
                 XmlUtil::AddTextNode($node, $value);
                 break;
             case EasyListType::UNORDEREDLIST:
                 XmlUtil::CreateChild($nodeWorking, "li", $value);
                 break;
         }
     }
 }
Exemple #11
0
 /**
  *@desc Generate $page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $nodeWorking = XmlUtil::CreateChild($current, "editlist", "");
     XmlUtil::AddAttribute($nodeWorking, "module", $this->_module);
     XmlUtil::AddAttribute($nodeWorking, "title", $this->_title);
     XmlUtil::AddAttribute($nodeWorking, "name", $this->_name);
     if ($this->_new) {
         XmlUtil::AddAttribute($nodeWorking, "new", "true");
     }
     if ($this->_edit) {
         XmlUtil::AddAttribute($nodeWorking, "edit", "true");
     }
     if ($this->_view) {
         XmlUtil::AddAttribute($nodeWorking, "view", "true");
     }
     if ($this->_delete) {
         XmlUtil::AddAttribute($nodeWorking, "delete", "true");
     }
     if ($this->_readonly) {
         XmlUtil::AddAttribute($nodeWorking, "readonly", "true");
     }
     if ($this->_selecttype == SelectType::CHECKBOX) {
         XmlUtil::AddAttribute($nodeWorking, "selecttype", "check");
     }
     if ($this->_extraParam != null) {
         foreach ($this->_extraParam as $key => $value) {
             $param = XmlUtil::CreateChild($nodeWorking, "param", "");
             XmlUtil::AddAttribute($param, "name", $key);
             XmlUtil::AddAttribute($param, "value", $value);
         }
     }
     $processor = new ParamProcessor();
     if ($this->_customButton != null) {
         for ($i = 0, $customButtonsLength = sizeof($this->_customButton); $i < $customButtonsLength; $i++) {
             //			CustomButtons $cb
             $cb = $this->_customButton[$i];
             if ($cb->enabled) {
                 $nodeButton = XmlUtil::CreateChild($nodeWorking, "button");
                 if ($cb->url != "") {
                     $cb->url = str_replace("&", "&amp;", $processor->GetFullLink($cb->url));
                 }
                 XmlUtil::AddAttribute($nodeButton, "custom", $i + 1);
                 XmlUtil::AddAttribute($nodeButton, "acao", $cb->action);
                 XmlUtil::AddAttribute($nodeButton, "alt", $cb->alternateText);
                 XmlUtil::AddAttribute($nodeButton, "url", $cb->url);
                 XmlUtil::AddAttribute($nodeButton, "img", $cb->icon);
                 XmlUtil::AddAttribute($nodeButton, "multiple", $cb->multiple);
                 XmlUtil::AddAttribute($nodeButton, "message", $cb->message);
             }
         }
     }
     $qtd = 0;
     $qtdPagina = 0;
     $page = 0;
     $started = !$this->_enablePages;
     $first = true;
     $firstRow = true;
     $summaryFields = array();
     if (!$this->_it instanceof IteratorInterface) {
         throw new InvalidArgumentException('You have to pass an IteratorInterface object to the XmlEditList');
     }
     // Generate XML With Data
     while ($this->_it->hasNext()) {
         //com.xmlnuke.anydataset.SingleRow
         $registro = $this->_it->moveNext();
         // Insert fields if none is passed.
         if (sizeof($this->_fields) == 0) {
             foreach ($registro->getFieldNames() as $key => $fieldname) {
                 $fieldtmp = new EditListField(true);
                 $fieldtmp->editlistName = $fieldname;
                 $fieldtmp->fieldData = $fieldname;
                 $fieldtmp->fieldType = EditListFieldType::TEXT;
                 $this->addEditListField($fieldtmp);
                 if (sizeof($this->_fields) == 1) {
                     $this->addEditListField($fieldtmp);
                 }
             }
         }
         // Fill values
         if ($this->_enablePages) {
             $page = intval($qtd / $this->_qtdRows) + 1;
             $started = $page == $this->_curPage;
         }
         if ($started) {
             //\DOMNode
             $row = XmlUtil::CreateChild($nodeWorking, "row", "");
             $currentNode = null;
             if (is_null($this->_fields)) {
                 throw new InvalidArgumentException("No such EditListField Object", 850);
             }
             foreach ($this->_fields as $chave => $field) {
                 if ($field->newColumn || $currentNode == null) {
                     $currentNode = XmlUtil::CreateChild($row, "field", "");
                     if ($firstRow) {
                         if (!$first) {
                             XmlUtil::AddAttribute($currentNode, "name", $field->editlistName);
                         } else {
                             $first = false;
                         }
                         XmlUtil::AddAttribute($currentNode, "source", $field->fieldData);
                     }
                 } else {
                     XmlUtil::CreateChild($currentNode, "br", "");
                 }
                 $this->renderColumn($currentNode, $registro, $field);
                 // Check if this fields requires summary
                 if ($field->summary != EditListFieldSummary::NONE) {
                     $summaryFields[$field->fieldData] += $this->_context->Language()->getDoubleVal($registro->getField($field->fieldData));
                 }
             }
             $firstRow = false;
             $qtdPagina++;
         }
         $qtd += 1;
     }
     // Generate SUMMARY Information
     if (sizeof($summaryFields) > 0) {
         $anydata = new AnyDataset();
         $anydata->appendRow();
         foreach ($this->_fields as $chave => $field) {
             switch ($field->summary) {
                 case EditListFieldSummary::SUM:
                     $value = $summaryFields[$field->fieldData];
                     break;
                 case EditListFieldSummary::AVG:
                     $value = $summaryFields[$field->fieldData] / $qtdPagina;
                     break;
                 case EditListFieldSummary::COUNT:
                     $value = $qtdPagina;
                     break;
                 default:
                     $value = "";
                     break;
             }
             $anydata->addField($field->fieldData, $value);
         }
         $ittemp = $anydata->getIterator();
         $registro = $ittemp->moveNext();
         $row = XmlUtil::CreateChild($nodeWorking, "row", "");
         XmlUtil::AddAttribute($row, "total", "true");
         foreach ($this->_fields as $chave => $field) {
             $currentNode = null;
             if ($field->newColumn || $currentNode == null) {
                 $currentNode = XmlUtil::CreateChild($row, "field", "");
             } else {
                 XmlUtil::CreateChild($currentNode, "br", "");
             }
             $this->renderColumn($currentNode, $registro, $field);
         }
     }
     // Create other properties
     XmlUtil::AddAttribute($nodeWorking, "cols", sizeof($this->_fields));
     if ($this->_enablePages) {
         if ($this->_curPage > 1) {
             XmlUtil::AddAttribute($nodeWorking, "pageback", strval($this->_curPage - 1));
         }
         if (!$started) {
             XmlUtil::AddAttribute($nodeWorking, "pagefwd", strval($this->_curPage + 1));
         }
         XmlUtil::AddAttribute($nodeWorking, "curpage", strval($this->_curPage));
         XmlUtil::AddAttribute($nodeWorking, "offset", strval($this->_qtdRows));
         XmlUtil::AddAttribute($nodeWorking, "pages", strval($page));
     }
     if ($this->_customsubmit != "") {
         XmlUtil::AddAttribute($nodeWorking, "customsubmit", $this->_customsubmit);
     }
     if (!is_null($this->_objXmlHeader)) {
         $nodeHeader = XmlUtil::CreateChild($nodeWorking, "xmlheader", "");
         $this->_objXmlHeader->generateObject($nodeHeader);
     }
     return $nodeWorking;
 }
Exemple #12
0
 /**
  *@desc Contains specific instructions to generate all XML informations-> This method is processed only one time-> Usually is the last method processed->
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $objBoxButtons = XmlUtil::CreateChild($current, "buttons", "");
     $clickEvent = "";
     foreach ($this->_values as $button) {
         //			InputButton $button
         if ($button->buttonType == ButtonType::CLICKEVENT) {
             $clickEvent .= ($clickEvent == "" ? "" : "|") . $button->name;
         }
         $nodeWorking = null;
         switch ($button->buttonType) {
             case ButtonType::CLICKEVENT:
             case ButtonType::SUBMIT:
                 $nodeWorking = XmlUtil::CreateChild($objBoxButtons, "submit", "");
                 break;
             case ButtonType::RESET:
                 $nodeWorking = XmlUtil::CreateChild($objBoxButtons, "reset", "");
                 break;
             case ButtonType::BUTTON:
                 $nodeWorking = XmlUtil::CreateChild($objBoxButtons, "button", "");
                 XmlUtil::AddAttribute($nodeWorking, "onclick", $button->onClick);
                 break;
         }
         XmlUtil::AddAttribute($nodeWorking, "caption", $button->caption);
         XmlUtil::AddAttribute($nodeWorking, "name", $button->name);
     }
     // Add Click Event
     $clickEventNode = XmlUtil::selectSingleNode($current, "clickevent");
     if (is_null($clickEventNode)) {
         $clickEventNode = XmlUtil::CreateChild($current, "clickevent", $clickEvent);
     } else {
         $clickEventNode->nodeValue = $clickEventNode->nodeValue . "|" . $clickEvent;
     }
 }
Exemple #13
0
 public function generateObject($current)
 {
     $node = XmlUtil::CreateChild($current, "tabview", "");
     foreach ($this->_tabs as $key => $value) {
         $title = $value[0];
         $type = $value[1];
         $content = $value[2];
         $nodetab = XmlUtil::CreateChild($node, "tabitem", "");
         XmlUtil::AddAttribute($nodetab, "title", $title);
         if ($this->_tabDefault == $key) {
             XmlUtil::AddAttribute($nodetab, "default", "true");
         }
         if ($type == "OBJ") {
             $content->generateObject($nodetab);
         } else {
             XmlUtil::AddAttribute($nodetab, "url", $content);
         }
     }
 }
Exemple #14
0
 public function generateObject($current)
 {
     $node = XmlUtil::CreateChild($current, "uialert", "");
     XmlUtil::AddAttribute($node, "type", $this->_uialert);
     XmlUtil::AddAttribute($node, "name", $this->_name);
     XmlUtil::AddAttribute($node, "title", $this->_title);
     if ($this->_autoHide > 0) {
         XmlUtil::AddAttribute($node, "autohide", $this->_autoHide);
     }
     if ($this->_openAction) {
         XmlUtil::AddAttribute($node, "openaction", $this->_openAction);
         XmlUtil::AddAttribute($node, "openactiontext", $this->_openActionText);
     }
     if ($this->_width > 0) {
         XmlUtil::AddAttribute($node, "width", $this->_width);
     }
     if ($this->_height > 0) {
         XmlUtil::AddAttribute($node, "height", $this->_height);
     }
     foreach ($this->_buttons as $key => $value) {
         $btn = XmlUtil::CreateChild($node, "button", $value);
         XmlUtil::AddAttribute($btn, "text", $key);
     }
     $body = XmlUtil::CreateChild($node, "body");
     parent::generatePage($body);
 }
Exemple #15
0
 /**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $nodeWorking = XmlUtil::CreateChild($current, "label", "");
     XmlUtil::AddAttribute($nodeWorking, "caption", $this->_caption);
     $this->generatePage($nodeWorking);
 }
Exemple #16
0
 /**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $node = $current;
     if ($this->_bold) {
         $node = XmlUtil::CreateChild($node, "b", "");
     }
     if ($this->_italic) {
         $node = XmlUtil::CreateChild($node, "i", "");
     }
     if ($this->_underline) {
         $node = XmlUtil::CreateChild($node, "u", "");
     }
     XmlUtil::AddTextNode($node, $this->_text);
     if ($this->_breakline) {
         XmlUtil::CreateChild($node, "br", "");
     }
 }
Exemple #17
0
 public function CreatePage()
 {
     parent::CreatePage();
     // Doesnt necessary get PX, because PX is protected!
     $deleteMode = false;
     //Strings
     $action = strtolower($this->_action);
     $id = $this->_context->get("id");
     $group = $this->_context->get("group");
     $contents = "";
     $titleIndex = $this->_context->get("titleIndex");
     $summaryIndex = $this->_context->get("summaryIndex");
     $groupKeyword = $this->_context->get("groupKeyword");
     $myWords = $this->WordCollection();
     $this->setHelp($myWords->Value("DESCRIPTION"));
     $this->setTitlePage($myWords->Value("TITLE"));
     //XmlNode
     $block = $this->_px->addBlockCenter($myWords->Value("WORKINGAREA"));
     $this->addMenuOption($myWords->Value("TXT_BACK"), "module:Xmlnuke.Admin.ListXML");
     /*
     XmlNode paragraph;
     XmlNode form;
     XmlNode boxButton;
     XmlNode editNode; // (For Index)
     processor.XMLFilenameProcessor xmlFile;
     */
     // Open Index File
     $indexFile = new XMLFilenameProcessor("index");
     //XmlDocument
     $index = $this->_context->getXMLDataBase()->getDocument($indexFile->FullQualifiedName(), null);
     // --------------------------------------
     // CHECK ACTION
     // --------------------------------------
     if ($action == "edit" || $action == "new") {
         $contents = $this->_context->get("contents");
         $contents = stripslashes($contents);
         $this->_context->setSession("texto", $contents);
         /*echo "<PRE>";
         		echo htmlentities($contents);
         		echo "</PRE>";*/
         try {
             $title = "";
             $summary = "";
             //XmlNode $node;
             // Get edited XML and update info about INDEX.
             //XmlDocument
             $xml = XmlUtil::CreateXmlDocumentFromStr($contents);
             //$node = XmlUtil::SelectSingleNode($xml->documentElement, "/page/meta/title");
             $node = XmlUtil::SelectSingleNode($xml->documentElement, "meta/title");
             if ($node != null) {
                 $title = $node->nodeValue;
             }
             //$node = XmlUtil::SelectSingleNode($xml->documentElement,"/page/meta/abstract");
             $node = XmlUtil::SelectSingleNode($xml->documentElement, "meta/abstract");
             if ($node != null) {
                 $summary = $node->nodeValue;
             }
             //$node = XmlUtil::SelectSingleNode($xml->documentElement,"/page/meta/modified");
             $node = XmlUtil::SelectSingleNode($xml->documentElement, "meta/modified");
             if ($node != null) {
                 $node->nodeValue = date("D M j Y G:i:s");
             }
             //$node = XmlUtil::SelectSingleNode($xml->documentElement,"/page/meta/groupkeyword");
             $node = XmlUtil::SelectSingleNode($xml->documentElement, "meta/groupkeyword");
             if ($node != null) {
                 $node->nodeValue = $groupKeyword;
             }
             if ($id != "_all") {
                 if ($action == "edit") {
                     //$editNode = XmlUtil::SelectSingleNode($index->documentElement, "/xmlindex/group[id='" . $group . "']/page[id='" . $id . "']");
                     $editNode = XmlUtil::SelectSingleNode($index->documentElement, "group[id='" . $group . "']/page[id='" . $id . "']");
                     if ($titleIndex == "") {
                         $titleIndex = $title;
                     }
                     XmlUtil::SelectSingleNode($editNode, "title")->nodeValue = $titleIndex;
                     if ($summaryIndex == "") {
                         $summaryIndex = $summary;
                     }
                     XmlUtil::SelectSingleNode($editNode, "summary")->nodeValue = $summaryIndex;
                 } else {
                     //$editNode = XmlUtil::SelectSingleNode($index->documentElement,"/xmlindex/group[id='" . $group . "']");
                     $editNode = XmlUtil::SelectSingleNode($index->documentElement, "group[id='" . $group . "']");
                     $newNode = XmlUtil::CreateChild($editNode, "page", "");
                     XmlUtil::CreateChild($newNode, "id", $id);
                     XmlUtil::CreateChild($newNode, "title", $title);
                     XmlUtil::CreateChild($newNode, "summary", $summary);
                     $titleIndex = $title;
                     $summaryIndex = $summary;
                 }
             }
             $xmlFile = new XMLFilenameProcessor($id);
             $this->_context->getXMLDataBase()->saveDocumentXML($xmlFile->FullQualifiedName(), $xml);
             $this->_context->getXMLDataBase()->saveDocumentXML($indexFile->FullQualifiedName(), $index);
             $this->_context->getXMLDataBase()->saveIndex();
             $paragraph = $this->_px->addParagraph($block);
             FileUtil::DeleteFilesFromPath($this->_cacheFile);
             FileUtil::DeleteFilesFromPath(new XSLCacheFilenameProcessor(""));
             $this->_px->addBold($paragraph, $myWords->Value("SAVED"));
         } catch (Exception $ex) {
             $paragraph = $this->_px->addParagraph($block);
             $this->_px->AddErrorMessage($paragraph, $contents, $ex);
         }
     }
     // Get the group from the Index and Update Edit Fields
     //$editNode = XmlUtil::SelectSingleNode( $index->documentElement,"/xmlindex/group[page[id='" . $id . "']]/id");
     $editNode = XmlUtil::SelectSingleNode($index->documentElement, "group[page[id='" . $id . "']]/id");
     if ($editNode != null) {
         $group = $editNode->nodeValue;
         //$editNode = XmlUtil::SelectSingleNode($index->documentElement,"/xmlindex/group[id='" . $group . "']/page[id='" . $id . "']");
         $editNode = XmlUtil::SelectSingleNode($index->documentElement, "group[id='" . $group . "']/page[id='" . $id . "']");
         $titleIndex = XmlUtil::SelectSingleNode($editNode, "title")->nodeValue;
         $summaryIndex = XmlUtil::SelectSingleNode($editNode, "summary")->nodeValue;
     }
     if ($action == "delete") {
         $paragraph = $this->_px->addParagraph($block);
         $this->_px->addHref($paragraph, "module:Xmlnuke.Admin.ManageXML?id=" . $this->_context->get("id") . "&action=confirmdelete", $myWords->Value("CONFIRMDELETE", $this->_context->get("id")), null);
         $deleteMode = true;
     }
     if ($action == "confirmdelete") {
         $paragraph = $this->_px->addParagraph($block);
         //$editNode = XmlUtil::SelectSingleNode($index->documentElement,"/xmlindex/group[id='" . $group . "']");
         $editNode = XmlUtil::SelectSingleNode($index->documentElement, "group[id='" . $group . "']");
         $delNode = XmlUtil::SelectSingleNode($editNode, "page[id='" . $id . "']");
         if ($delNode != null) {
             $editNode->removeChild($delNode);
         }
         $this->_context->getXMLDataBase()->saveDocumentXML($indexFile->FullQualifiedName(), $index);
         //util.FileUtil.DeleteFile(new processor.XMLFilenameProcessor(_context.get("id"), this._context));
         $this->_context->getXMLDataBase()->saveIndex();
         $this->_px->addBold($paragraph, $myWords->Value("DELETED"));
         $deleteMode = true;
     }
     // --------------------------------------
     // EDIT XML PAGE
     // --------------------------------------
     // If doesnt have an ID, list all pages or add new!
     if ($id == "") {
         $action = "new";
     } else {
         $this->addMenuOption($myWords->Value("PREVIEWMENU"), "engine:xmlnuke?xml=" . $id . "&xsl=[param:xsl]&lang=[param:lang]", "preview");
         $this->addMenuOption($myWords->Value("NEWXMLMENU"), "module:Xmlnuke.Admin.ManageXML", null);
         $langAvail = $this->_context->LanguagesAvailable();
         $processorFile = new XMLFilenameProcessor($id);
         foreach (array_keys($langAvail) as $key) {
             if ($key != strtolower($this->_context->Language()->getName())) {
             }
             $repositorio = new XmlnukeDB($this->_context->XmlHashedDir(), $this->_context->XmlPath(), $key);
             $fileToCheck = $processorFile->FullName($id, "", $key) . $processorFile->Extension();
             if ($repositorio->existsDocument($fileToCheck)) {
                 $this->addMenuOption($myWords->ValueArgs("EDITXMLMENU", array($langAvail[$key])), "module:Xmlnuke.Admin.ManageXML?id=" . $id . "&lang=" . $key, null);
             } else {
                 $this->addMenuOption($myWords->ValueArgs("CREATEXMLMENU", array($langAvail[$key])), "module:Xmlnuke.Admin.ManageXML?id=" . $id . "&lang=" . $key, null);
             }
         }
         $action = "edit";
     }
     // Show form to Edit/Insert
     if (!$deleteMode) {
         $paragraph = $this->_px->addParagraph($block);
         //XmlNodeS
         $table = $this->_px->addTable($paragraph);
         $row = $this->_px->addTableRow($table);
         $col = $this->_px->addTableColumn($row);
         $form = $this->_px->addForm($col, "module:Xmlnuke.Admin.ManageXML", "", "form", true);
         $xmlExist = true;
         if ($id != "") {
             $xmlTestExist = new XMLFilenameProcessor($id);
             $xmlExist = $this->_context->getXMLDataBase()->existsDocument($xmlTestExist->FullQualifiedName());
         }
         $canUseNew = $action != "new" && !$xmlExist;
         //Trecho acrescentado para manter o conteudo do textarea mesmo no caso de erro.
         $contents = $this->_context->getSession("texto");
         //echo $contents;
         if ($action == "new" || $canUseNew) {
             $action = "new";
             // This is necessary, because user can Create a predefined ID...
             if (!$canUseNew || $id == "") {
                 $this->_px->addTextBox($form, $myWords->Value("XMLBOX"), "id", "", 20, true, INPUTTYPE::TEXT);
             } else {
                 $this->_px->addLabelField($form, $myWords->Value("XMLBOX"), $id);
                 $this->_px->addHidden($form, "id", $id);
             }
             $this->_px->addLabelField($form, $myWords->Value("LANGUAGEBOX"), strtolower($this->_context->Language()->getName()));
             //if($contents!="")
             //{
             $contents = "<page>\n" . "  <meta>\n" . "    <title>Put your title here</title>\n" . "    <abstract>Put page abstract informations here</abstract>\n" . "    <created>" . date("D M j Y G:i:s") . "</created>\n" . "    <modified/>\n" . "    <keyword>xmlnuke</keyword>\n" . "    <groupkeyword>all</groupkeyword>\n" . "  </meta>\n" . "  <blockcenter>\n" . "    <title>Block Title</title>\n" . "    <body>\n" . "      <p>This is the first paragraph</p>\n" . "    </body>\n" . "  </blockcenter>\n" . "</page>\n";
             //}
             session_unregister("texto");
         } else {
             $this->_px->addLabelField($form, $myWords->Value("LANGUAGEBOX"), strtolower($this->_context->Language()->getName()));
             $this->_px->addHidden($form, "id", $id);
             $xmlFile = new XMLFilenameProcessor($id);
             //XmlDocument
             $xml = $this->_context->getXMLDataBase()->getDocument($xmlFile->FullQualifiedName(), null);
             //if($contents!="")
             $contents = str_replace("&amp;", "&", XmlUtil::GetFormattedDocument($xml));
             $editNode = XmlUtil::SelectSingleNode($xml->documentElement, "meta/groupkeyword");
             if ($editNode != null) {
                 $groupKeyword = $editNode->nodeValue;
             }
             session_unregister("texto");
         }
         if ($id != "_all") {
             $this->_px->addCaption($form, $myWords->Value("SITEMAPINFO"));
             $this->_px->addTextBox($form, $myWords->Value("INDEXBOX"), "titleIndex", $titleIndex, 60, true, INPUTTYPE::TEXT);
             $selectNode = $this->_px->addSelect($form, $myWords->Value("LISTEDBOX"), "group");
             $this->_px->addTextBox($form, $myWords->Value("INDEXSUMMARYBOX"), "summaryIndex", $summaryIndex, 60, true, INPUTTYPE::TEXT);
             $this->_px->addCaption($form, $myWords->Value("PAGEINFO"));
             //XmlNode
             $selectPageNode = $this->_px->addSelect($form, $myWords->Value("SHOWMENUBOX"), "groupKeyword");
             $this->_px->addOption($selectPageNode, $myWords->Value("NOTLISTEDOPTION"), "-", null);
             //XmlNodeList
             //$groupList = XmlUtil::SelectNodes($index->documentElement,"/xmlindex/group");
             $groupList = XmlUtil::SelectNodes($index->documentElement, "/group");
             foreach ($groupList as $node) {
                 $value = XmlUtil::SelectSingleNode($node, "title")->nodeValue;
                 $this->_px->addOption($selectNode, XmlUtil::SelectSingleNode($node, "title")->nodeValue . " (" . XmlUtil::SelectSingleNode($node, "/id")->nodeValue . ")", XmlUtil::SelectSingleNode($node, "/id")->nodeValue, XmlUtil::SelectSingleNode($node, "/id")->nodeValue == $group);
                 $this->_px->addOption($selectPageNode, XmlUtil::SelectSingleNode($node, "title")->nodeValue . " (" . XmlUtil::SelectSingleNode($node, "/keyword")->nodeValue . ")", XmlUtil::SelectSingleNode($node, "/keyword")->nodeValue, XmlUtil::SelectSingleNode($node, "/keyword")->nodeValue == $groupKeyword);
             }
         }
         $this->_px->addHidden($form, "action", $action);
         $this->_px->addCaption($form, $myWords->Value("XMLEDITINFO"));
         $this->_px->addMemo($form, $myWords->Value("XMLCONTENTBOX"), "contents", $contents, 80, 30, "soft");
         $boxButton = $this->_px->addBoxButtons($form);
         $this->_px->addSubmit($boxButton, "", $myWords->Value("TXT_SAVE"));
     }
     return $this->_px;
 }
Exemple #18
0
 /**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $nodeWorking = XmlUtil::CreateChild($current, "editform", "");
     XmlUtil::AddAttribute($nodeWorking, "action", $this->_action);
     XmlUtil::AddAttribute($nodeWorking, "title", $this->_title);
     XmlUtil::AddAttribute($nodeWorking, "name", $this->_formname);
     if ($this->_target != "") {
         XmlUtil::AddAttribute($nodeWorking, "target", $this->_target);
     }
     if ($this->_jsValidate) {
         XmlUtil::AddAttribute($nodeWorking, "jsvalidate", "true");
         XmlUtil::AddAttribute($nodeWorking, "decimalseparator", $this->_decimalSeparator);
         XmlUtil::AddAttribute($nodeWorking, "dateformat", $this->_dateformat);
         $this->_customSubmit .= ($this->_customSubmit != "" ? " &amp;&amp; " : "") . $this->_formname . "_checksubmit()";
     }
     if ($this->_ajaxcallback != null) {
         $ajaxId = $this->_ajaxcallback->getId();
         $this->_customSubmit .= ($this->_customSubmit != "" ? " &amp;&amp; " : "") . "AIM.submit(this, {'onStart' : startCallback{$ajaxId}, 'onComplete' : completeCallback{$ajaxId}})";
     }
     if ($this->_customSubmit != "") {
         XmlUtil::AddAttribute($nodeWorking, "customsubmit", $this->_customSubmit);
     }
     if ($this->_disableAutoComplete) {
         XmlUtil::AddAttribute($nodeWorking, "autocomplete", "off");
     }
     $this->generatePage($nodeWorking);
 }
Exemple #19
0
 /**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $block = "";
     switch ($this->_position) {
         case BlockPosition::Center:
             $block = "blockcenter";
             break;
         case BlockPosition::Left:
             $block = "blockleft";
             break;
         case BlockPosition::Right:
             $block = "blockright";
             break;
     }
     if ($block == "") {
         throw new InvalidArgumentException("XmlBlockCollection: You selected an unknown Block Position.");
     }
     $objBlockCenter = XmlUtil::CreateChild($current, $block, "");
     XmlUtil::CreateChild($objBlockCenter, "title", $this->_title);
     parent::generatePage(XmlUtil::CreateChild($objBlockCenter, "body", ""));
 }
Exemple #20
0
 /**
  * @desc Generate page, processing yours childs.
  * @param DOMNode $current
  * @return void
  */
 public function generateObject($current)
 {
     $datetimebox = XmlUtil::CreateChild($current, "datetimebox");
     $date = DateUtil::TimeStampFromStr($this->_date, $this->_dateformat);
     XmlUtil::AddAttribute($datetimebox, "name", $this->_name);
     XmlUtil::AddAttribute($datetimebox, "caption", $this->_caption);
     XmlUtil::AddAttribute($datetimebox, "day", date('j', $date));
     // Day without leading zeros
     XmlUtil::AddAttribute($datetimebox, "month", date('n', $date));
     // Month without leading zeros
     XmlUtil::AddAttribute($datetimebox, "year", date('Y', $date));
     XmlUtil::AddAttribute($datetimebox, "dateformat", INPUTTYPE::DATE);
     XmlUtil::AddAttribute($datetimebox, "date", $this->_date);
     if ($this->_showHour) {
         $time = explode(":", $this->_time);
         XmlUtil::AddAttribute($datetimebox, "showhour", "true");
         XmlUtil::AddAttribute($datetimebox, "hour", $this->removeLeadingZero($time[0]));
         // Hour without leading zeros
         XmlUtil::AddAttribute($datetimebox, "minute", $this->removeLeadingZero($time[1]));
     }
     XmlUtil::AddAttribute($datetimebox, "yearmin", $this->_yearmin);
     XmlUtil::AddAttribute($datetimebox, "yearmax", $this->_yearmax);
     XmlUtil::AddAttribute($datetimebox, "showday", $this->_showDay ? 'true' : 'false');
 }
Exemple #21
0
 public function generateObject($current)
 {
     $editForm = $current;
     while ($editForm != null && $editForm->tagName != "editform") {
         $editForm = $editForm->parentNode;
     }
     if ($editForm == null) {
         throw new InvalidArgumentException("XmlInputSortableList must be inside a XmlFormCollection");
     }
     $node = XmlUtil::CreateChild($current, "sortablelist", "");
     XmlUtil::AddAttribute($node, "name", $this->_name);
     XmlUtil::AddAttribute($node, "caption", $this->_caption);
     XmlUtil::AddAttribute($node, "connectkey", $this->getConnectKey());
     XmlUtil::AddAttribute($node, "columns", $this->_columns);
     XmlUtil::AddAttribute($node, "fullsize", $this->_fullSize ? "true" : "false");
     foreach ($this->_items as $index => $column) {
         $columnNode = XmlUtil::CreateChild($node, "column", "");
         XmlUtil::AddAttribute($columnNode, "id", $index);
         foreach ($column as $key => $value) {
             $info = explode("|", $key);
             $nodeitem = XmlUtil::CreateChild($columnNode, "item", "");
             XmlUtil::AddAttribute($nodeitem, "key", $info[0]);
             XmlUtil::AddAttribute($nodeitem, "state", $info[1]);
             if (is_array($value)) {
                 XmlUtil::AddAttribute($nodeitem, "title", $value[0]);
                 $value[1]->generateObject($nodeitem);
             } else {
                 $value->generateObject($nodeitem);
             }
         }
     }
 }
Exemple #22
0
 /**
  * Make a buttom
  *
  * @param DualListButton $button
  * @param string $name
  * @param DOMNode $duallist
  * @param string $from
  * @param string $to
  * @param string $all
  */
 private function makeButton($button, $name, $duallist, $from, $to, $all)
 {
     $newbutton = XmlUtil::CreateChild($duallist, "button", "");
     XmlUtil::AddAttribute($newbutton, "name", $name);
     if ($button->type == DualListButtonType::Image) {
         XmlUtil::AddAttribute($newbutton, "type", "image");
         XmlUtil::AddAttribute($newbutton, "src", $button->href);
         XmlUtil::AddAttribute($newbutton, "value", $button->text);
     } else {
         XmlUtil::AddAttribute($newbutton, "type", "button");
         XmlUtil::AddAttribute($newbutton, "value", $button->text);
     }
     XmlUtil::AddAttribute($newbutton, "from", $from);
     XmlUtil::AddAttribute($newbutton, "to", $to);
     XmlUtil::AddAttribute($newbutton, "all", $all);
 }
Exemple #23
0
 /**
  *@desc Contains specific instructions to generate all XML informations. This method is processed only one time. Usually is the last method processed.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     if ($this->_readonly) {
         // XmlInputLabelField ic
         $ic = new XmlInputLabelField($this->_caption, $this->_value);
         $ic->generateObject($current);
         // XmlInputHidden $ih
         $ih = new XmlInputHidden($this->_name, $this->_value);
         $ih->generateObject($current);
     } else {
         $nodeWorking = XmlUtil::CreateChild($current, "memo", "");
         XmlUtil::AddAttribute($nodeWorking, "caption", $this->_caption);
         XmlUtil::AddAttribute($nodeWorking, "name", $this->_name);
         XmlUtil::AddAttribute($nodeWorking, "cols", $this->_cols);
         XmlUtil::AddAttribute($nodeWorking, "rows", $this->_rows);
         XmlUtil::AddAttribute($nodeWorking, "wrap", $this->_wrap);
         if ($this->_visualEditor) {
             XmlUtil::AddAttribute($nodeWorking, "visualedit", "true");
             XmlUtil::AddAttribute($nodeWorking, "visualeditbasehref", $this->_visualEditorBaseHref);
         } elseif ($this->_maxLength > 0) {
             XmlUtil::AddAttribute($nodeWorking, "maxlength", $this->_maxLength);
         }
         XmlUtil::AddTextNode($nodeWorking, $this->_value);
     }
 }
Exemple #24
0
 /**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $node = XmlUtil::CreateChild($current, "code", $this->_text);
     if ($this->_title != "") {
         XmlUtil::AddAttribute($node, "information", $this->_title);
     }
 }
Exemple #25
0
 public function generateObject($current)
 {
     $node = XmlUtil::CreateChild($current, "progressbar", "");
     XmlUtil::AddAttribute($node, "name", $this->_name);
     XmlUtil::AddAttribute($node, "value", $this->_value);
 }
Exemple #26
0
 /**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     $nodeWorking = XmlUtil::CreateChild($current, "hidden", "");
     XmlUtil::AddAttribute($nodeWorking, "name", $this->_name);
     XmlUtil::AddAttribute($nodeWorking, "value", $this->_value);
 }
Exemple #27
0
 /**
  *@desc Contains specific instructions to generate all XML informations-> This method is processed only one time-> Usually is the last method processed->
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     if ($this->_readonly) {
         //			XmlInputLabelField $ic;
         if ($this->_checked) {
             //				XmlInputHidden $ih
             $ih = new XmlInputHidden($this->_name, $this->_value);
             $ic = new XmlInputLabelField($this->_caption, "[X]");
             $ih->generateObject($current);
         } else {
             $ic = new XmlInputLabelField($this->_caption, "[ ]");
         }
         $ic->generateObject($current);
     } else {
         //			XmlNode $nodeWorking;
         if ($this->_inputCheckType == InputCheckType::CHECKBOX) {
             $nodeWorking = XmlUtil::CreateChild($current, "checkbox", "");
         } else {
             $nodeWorking = XmlUtil::CreateChild($current, "radiobox", "");
         }
         XmlUtil::AddAttribute($nodeWorking, "caption", $this->_caption);
         XmlUtil::AddAttribute($nodeWorking, "name", $this->_name);
         XmlUtil::AddAttribute($nodeWorking, "value", $this->_value);
         if ($this->_checked) {
             XmlUtil::AddAttribute($nodeWorking, "selected", "yes");
         }
     }
 }
Exemple #28
0
 public function generateObject($current)
 {
     $node = XmlUtil::CreateChild($current, "inputgroup", "");
     XmlUtil::AddAttribute($node, "name", $this->_name);
     if ($this->_caption) {
         XmlUtil::AddAttribute($node, "caption", $this->_caption);
     }
     if ($this->_canhide) {
         XmlUtil::AddAttribute($node, "canhide", "true");
     }
     if ($this->_breakline) {
         XmlUtil::AddAttribute($node, "breakline", "true");
     }
     if (!$this->_visible) {
         XmlUtil::AddAttribute($node, "visible", "false");
     }
     parent::generatePage($node);
 }
Exemple #29
0
 /**
  *@desc Generate page, processing yours childs.
  *@param DOMNode $current
  *@return void
  */
 public function generateObject($current)
 {
     XmlUtil::CreateChild($current, "caption", $this->_caption);
 }
Exemple #30
0
 public function generateObject($current)
 {
     $node = XmlUtil::CreateChild($current, "flash", "");
     XmlUtil::AddAttribute($node, "major", $this->_majorVersion);
     XmlUtil::AddAttribute($node, "minor", $this->_minorVersion);
     XmlUtil::AddAttribute($node, "revision", $this->_revision);
     if ($this->_movie != "") {
         XmlUtil::AddAttribute($node, "movie", $this->getMovie());
     }
     if ($this->_width != "") {
         XmlUtil::AddAttribute($node, "width", $this->getWidth());
     }
     if ($this->_height != "") {
         XmlUtil::AddAttribute($node, "height", $this->getHeight());
     }
     foreach ($this->_extraParams as $key => $value) {
         $param = XmlUtil::CreateChild($node, "param");
         XmlUtil::AddAttribute($param, "name", $key);
         XmlUtil::AddAttribute($param, "value", str_replace("&", "&amp;", $value));
     }
     parent::generatePage($node);
 }