コード例 #1
0
 /**
  * Static render table function
  */
 static function _renderTable($content, $a_mode = "table_edit", $a_submode = "", $a_table_obj = null)
 {
     global $ilUser;
     $content = "<dummy>" . $content . "</dummy>";
     $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
     $args = array('/_xml' => $content, '/_xsl' => $xsl);
     $xh = xslt_create();
     //echo "<b>XML</b>:".htmlentities($content).":<br>";
     //echo "<b>XSLT</b>:".htmlentities($xsl).":<br>";
     $med_disabled_path = ilUtil::getImagePath("media_disabled.png");
     $wb_path = ilUtil::getWebspaceDir("output");
     $enlarge_path = ilUtil::getImagePath("enlarge.png");
     $params = array('mode' => $a_mode, 'med_disabled_path' => $med_disabled_path, 'media_mode' => $ilUser->getPref("ilPageEditor_MediaMode"), 'media_mode' => 'disable', 'webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path);
     $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params);
     echo xslt_error($xh);
     xslt_free($xh);
     // unmask user html
     $output = str_replace("&lt;", "<", $output);
     $output = str_replace("&gt;", ">", $output);
     $output = str_replace("&amp;", "&", $output);
     if ($a_mode == "table_edit" && !is_null($a_table_obj)) {
         switch ($a_submode) {
             case "style":
                 $output = ilPCTableGUI::_addStyleCheckboxes($output, $a_table_obj);
                 break;
             case "alignment":
                 $output = ilPCTableGUI::_addAlignmentCheckboxes($output, $a_table_obj);
                 break;
             case "width":
                 $output = ilPCTableGUI::_addWidthInputs($output, $a_table_obj);
                 break;
             case "span":
                 $output = ilPCTableGUI::_addSpanInputs($output, $a_table_obj);
                 break;
         }
     }
     return '<div style="float:left;">' . $output . '</div>';
 }