add("form","adminform","","admin.php?com_option=templates"); $gui->add("com_header",_TEMPLATES_HEAD); $table_head = array ( array('title'=>'radio' , 'val'=>'id' , 'len'=>'1%') , array('title'=>_CMN_NAME,'val'=>'name','len'=>'50%','info'=>_CMN_INFO,'ilink'=>'admin.php?com_option=templates&task=info&cid[]=ivar1','ivar1'=>'id') , array('title'=>_CMN_PUBLISHED,'val'=>'published','len'=>'10%','align'=>'center'), array('title'=>_CMN_AUTHOR,'val'=>'author','len'=>'10%','mlink'=>'authorEmail') , array('title'=>_CMN_VER,'val'=>'version','len'=>'9%','align'=>'center') , array('title'=>_CMN_DATE,'val'=>'date','len'=>'10%','align'=>'center') , array('title'=>_CMN_WEBSITE,'val'=>'authorUrl','len'=>'10%','hlink'=>'authorUrl') ); $table_req = array ( 'name'=>'name','author'=>'author','version'=>'version','date'=>'creationDate','authorEmail'=>'authorEmail','authorUrl'=>'authorUrl'); $table_data = read_dir_xml($lm_absolute_path."templates/","templateDetails.xml",$table_req); $table_data = insert_published($table_data,"published",$lm_template); $gui->add("data_table_arr","maintable",$table_head,$table_data); $gui->add("end_form"); $gui->generate(); } function edit_template() { global $lm_absolute_path,$cid; $html_file=$lm_absolute_path."templates/".$cid[0]."/index.php"; $css_file=$lm_absolute_path."templates/".$cid[0]."/css/template_css.css"; $fp=fopen($html_file,"r"); $html=fread($fp,filesize($html_file)); fclose($fp); $fp=fopen($css_file,"r"); $css=fread($fp,filesize($css_file)); fclose($fp); $rwhtml=sprintf(_LANG_EDIT_STATUS,$html_file); $rwhtml.= is_writable($html_file) ? _CMN_WRITE:_CMN_NWRITE; $rwcss=sprintf(_LANG_EDIT_STATUS,$css_file); $rwcss.= is_writable($css_file) ? _CMN_WRITE:_CMN_NWRITE; $gui=new admin_interface(); $gui->add("form","adminform","","admin.php?com_option=templates"); $gui->add("com_header",_TEMPLATES_EDIT); $gui->add("tab_link","dtab"); $gui->add("tab_head"); $gui->add("tab",_TEMPLATES_EDIT_HTML,"$rwhtml","dtab"); $gui->add("form_hidden","html_file","",$html_file,""); $gui->add("form_textarea_big","template_html_data",_TEMPLATES_EDIT_HTML,$html,""); $gui->add("tab_end"); $gui->add("tab",_TEMPLATES_EDIT_CSS,"$rwcss","dtab"); $gui->add("form_hidden","css_file","",$css_file,""); $gui->add("form_textarea_big","template_css_data",_TEMPLATES_EDIT_CSS,$css,""); $gui->add("tab_end"); $gui->add("tab_tail"); $gui->add("end_form"); $gui->add("tab_sel","dtab","","1"); $gui->generate(); } function info_template() { global $cid,$lm_absolute_path; $xml_file=$lm_absolute_path."templates/".$cid[0]."/templateDetails.xml"; $preview_path="templates/".$cid[0]."/template_thumbnail.png"; $table_req = array ( 'name'=>'name','author'=>'author','version'=>'version','date'=>'creationDate','authorEmail'=>'authorEmail','authorUrl'=>'authorUrl',"desc"=>"Description"); if($info=read_file_xml($xml_file,$table_req)) { $gui=new admin_interface(); $gui->add("form","adminform","","admin.php?com_option=templates"); $gui->add("com_header",_TEMPLATES_INFO); $gui->add("tab_head"); $gui->add("tab_simple","",_TEMPLATES_INFO); $gui->add("html","","","