コード例 #1
0
 /**
  * Get table template preview
  */
 function _getTemplatePreview($a_style, $a_type, $a_t_id, $a_small_mode = false)
 {
     global $lng, $tpl;
     $kr = $kc = 7;
     if ($a_small_mode) {
         $kr = 6;
         $kc = 5;
     }
     $ts = $a_style->getTemplate($a_t_id);
     $t = $ts["classes"];
     // preview
     if ($a_type == "table") {
         $p_content = '<PageContent><Table DataTable="y"';
         if ($t["row_head"] != "") {
             $p_content .= ' HeaderRows="1"';
         }
         if ($t["row_foot"] != "") {
             $p_content .= ' FooterRows="1"';
         }
         if ($t["col_head"] != "") {
             $p_content .= ' HeaderCols="1"';
         }
         if ($t["col_foot"] != "") {
             $p_content .= ' FooterCols="1"';
         }
         $p_content .= ' Template="' . $a_style->lookupTemplateName($a_t_id) . '">';
         if (!$a_small_mode) {
             $p_content .= '<Caption>' . $lng->txt("sty_caption") . '</Caption>';
         }
         for ($i = 1; $i <= $kr; $i++) {
             $p_content .= '<TableRow>';
             for ($j = 1; $j <= $kc; $j++) {
                 if ($a_small_mode) {
                     $cell = '&lt;div style="height:2px;"&gt;&lt;/div&gt;';
                 } else {
                     $cell = 'xxx';
                 }
                 $p_content .= '<TableData><PageContent><Paragraph Characteristic="TableContent">' . $cell . '</Paragraph></PageContent></TableData>';
             }
             $p_content .= '</TableRow>';
         }
         $p_content .= '</Table></PageContent>';
     }
     if ($a_type == "vaccordion" || $a_type == "haccordion") {
         include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
         ilAccordionGUI::addCss();
         if ($a_small_mode) {
             $c = '&amp;nbsp;';
             $h = '&amp;nbsp;';
         } else {
             $c = 'xxx';
             $h = 'head';
         }
         if ($a_type == "vaccordion") {
             $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
             if ($a_small_mode) {
                 $p_content .= ' ContentWidth="70"';
             }
         } else {
             $p_content = '<PageContent><Tabs Type="HorizontalAccordion"';
             if ($a_small_mode) {
                 $p_content .= ' ContentHeight="40"';
                 $p_content .= ' ContentWidth="70"';
                 $c = '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
             } else {
                 $p_content .= ' ContentHeight="40"';
             }
         }
         $p_content .= ' Template="' . $a_style->lookupTemplateName($a_t_id) . '">';
         $p_content .= '<Tab><PageContent><Paragraph>' . $c . '</Paragraph></PageContent>';
         $p_content .= '<TabCaption>' . $h . '</TabCaption>';
         $p_content .= '</Tab>';
         $p_content .= '</Tabs></PageContent>';
     }
     //echo htmlentities($p_content);
     $txml = $a_style->getTemplateXML();
     //echo htmlentities($txml);
     $p_content .= $txml;
     include_once "./Services/COPage/classes/class.ilPCTableGUI.php";
     $r_content = ilPCTableGUI::_renderTable($p_content, "");
     return $r_content;
 }
コード例 #2
0
 /**
  * Render the table
  */
 function renderTable($a_mode = "table_edit", $a_submode = "")
 {
     $tab_node = $this->content_obj->getNode();
     $tab_node->set_attribute("Enabled", "True");
     $content = $this->dom->dump_node($tab_node);
     $trans = $this->pg_obj->getLanguageVariablesXML();
     $mobs = $this->pg_obj->getMultimediaXML();
     if ($this->getStyleId() > 0) {
         if (ilObject::_lookupType($this->getStyleId()) == "sty") {
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $style = new ilObjStyleSheet($this->getStyleId());
             $template_xml = $style->getTemplateXML();
         }
     }
     $content = $content . $mobs . $trans . $template_xml;
     return ilPCTableGUI::_renderTable($content, $a_mode, $a_submode, $this->content_obj);
 }