Code:<?php
include_once "modules/Conteudo/FCKeditor/fckeditor.php";
function page() {
global $prefix, $db, $language, $multilingual, $bgcolor2, $module_name, $myid, $config, $fckedit;
include("header.php");
$mid = $_GET['mid'];
$cid = $_GET['cid'];
$avan = $_GET['avan'];
$title = base64_decode($_GET['title']);
$brother = $_GET['brother'];
if ($_GET['brother'] != '') {
list($mid, $cid) = $db -> sql_fetchrow($db -> sql_query("SELECT mid, cid FROM ".$prefix."_cnbc_pages WHERE pid = '$brother'"));
if ($config['allowfck'] == 1) $fckedit = 1;
}
list($is_wiki) = $db->sql_fetchrow($db->sql_query("SELECT wiki FROM ".$prefix."_cnbc_folder WHERE cid = '$cid'"));
if ( (!auto_file($myid, $mid, 'criate', 0)) AND ($mid > 0) ) die("<center><br><br>"._CNBC_DONTHAVEAUTO."<br><br></center>"); //ve se pode modificar o arquivo mae
if ( !auto_folder($myid, $cid, 'criate', 0)) die("<center><br><br>"._CNBC_DONTHAVEAUTO."<br><br></center>"); //ve se pode inserir um novo arquivo no diretorio
if ( (can_son($mid) == 0) AND ($mid != 0) ) die("<center><br><br>"._CNBC_DONTHAVEAUTO."<br><br></center>"); //ve se pode criar filhos
OpenTable();
echo "<center><b>"._ADDANEWPAGE."</b></center><br><br>";
echo "<form action=\"modules.php?name=$module_name&file=admin\" method=\"post\">";
echo "<input type=\"submit\" value=\""._SEND."\"><br><br>"
."<input type=\"hidden\" name=\"op\" value=\"page_save\">"
."<input type=\"hidden\" name=\"brother\" value=\"$brother\">"
."<input type=\"hidden\" name=\"avan\" value=\"$avan\">";
if ($avan == 1) {
if ($mid > 0) {
list($mainfile) = $db->sql_fetchrow($db->sql_query("select title from ".$prefix."_cnbc_pages WHERE pid='$mid'"));
echo "<b>"._MAINFILE.":</b> $mainfile<br>";
echo "<input type=\"hidden\" name=\"mid\" value=\"$mid\">";
} else {
echo "<b>"._MAINFILE.":</b> "._RAIZ."<br>";
echo "<input type=\"hidden\" name=\"mid\" value=\"0\">";
}
if ($cid>0) {
list($maincat) = $db->sql_fetchrow($db->sql_query("select title from ".$prefix."_cnbc_folder WHERE cid='$cid'"));
echo "<b>"._CATALOG.":</b> $maincat<br><br>";
echo "<input type=\"hidden\" name=\"cid\" value=\"$cid\">";
} else {
echo "<b>"._CATALOG.":</b> 0<br><br>";
echo "<input type=\"hidden\" name=\"cid\" value=\"0\">";
}
} else {
if ($mid > 0) echo "<input type=\"hidden\" name=\"mid\" value=\"$mid\">";
else echo "<input type=\"hidden\" name=\"mid\" value=\"0\">";
if ($cid > 0) echo "<input type=\"hidden\" name=\"cid\" value=\"$cid\">";
else echo "<input type=\"hidden\" name=\"cid\" value=\"0\">";
}
if ($is_wiki == 1 && $title != ''){
echo "<b>"._TITLE."*:</b><br>"
."<input type=\"checkbox\" name=\"atitle\" value=\"1\">"._SHOWTEXT."<br>"
."<input type=\"text\" name=\"title\" size=\"50\" value='$title' disabled><br><br>"
."<input type = \"hidden\" name = \"title\" value = '$title'>";
} else {
echo "<b>"._TITLE.":</b><br>"
."<input type=\"checkbox\" name=\"atitle\" value=\"1\">"._SHOWTEXT."<br>"
."<input type=\"text\" name=\"title\" size=\"50\"><br><br>";
}
if ($avan == 1) {
echo "<b>"._CSUBTITLE.":</b><br>"
."<input type=\"checkbox\" name=\"asubtitle\" value=\"1\">"._SHOWTEXT."<br>"
."<input type=\"text\" name=\"subtitle\" size=\"50\"><br><br>";
echo "<b>"._ACTIVATEPAGE."</b><br>"
."<input type=\"radio\" name=\"active\" value=\"1\" checked> "._YES."  <input type=\"radio\" name=\"active\" value=\"0\"> "._NO."<br><br>";
echo "<b>"._HEADERTEXT.":</b><br>"
."<input type=\"checkbox\" name=\"apage_header\" value=\"1\">"._SHOWTEXT."<br>";
if (($config['allowfck'] == 1) AND ($fckedit == 1) ) {
//$oFCKeditor = new FCKeditor('page_header');
//$oFCKeditor->Width = "100%"; $oFCKeditor->Height = "100";
//$oFCKeditor->ToolbarSet = "Basic";
//$oFCKeditor->Value = "$mypages[page_header]";
//echo $oFCKeditor->CreateHtml();
$oFCKeditor = new FCKeditor;
$oFCKeditor->ToolbarSet = "Basic";
$oFCKeditor->CreateFCKeditor('page_header', '750', 100, 'page_header', '');
} else echo "<textarea name=\"page_header\" cols=\"100\" rows=\"4\"></textarea><br><br>";
}
echo "<b>"._PAGETEXT.":</b><br>"
."<input type=\"checkbox\" name=\"atext\" value=\"1\" checked>"._SHOWTEXT."<br>"
."<font class=\"tiny\">"._PAGEBREAK."</font><br>";
if (($config['allowfck'] == 1) AND ($fckedit == 1) ) {
//$oFCKeditor = new FCKeditor('text'); $oFCKeditor->Width = "100%"; $oFCKeditor->Height = "500"; $oFCKeditor->ToolbarSet = "Default"; $oFCKeditor->Value = "$mypages[text]";
//echo $oFCKeditor->CreateHtml();
$oFCKeditor = new FCKeditor;
$oFCKeditor->CreateFCKeditor('text', '750', 500, 'text', '');
} else echo "<textarea name=\"text\" cols=\"100\" rows=\"30\"></textarea><br><br>";
if ($avan == 1) {
echo "<b>"._FOOTERTEXT.":</b><br><input type=\"checkbox\" name=\"apage_footer\" value=\"1\">"._SHOWTEXT."<br>";
if (($config['allowfck'] == 1) AND ($fckedit == 1) ) {
//$oFCKeditor = new FCKeditor('page_footer'); $oFCKeditor->Width = "100%"; $oFCKeditor->Height = "100"; $oFCKeditor->ToolbarSet = "Basic"; $oFCKeditor->Value = "$mypages[page_footer]";
//echo $oFCKeditor->CreateHtml();
$oFCKeditor = new FCKeditor;
$oFCKeditor->ToolbarSet = "Basic";
$oFCKeditor->CreateFCKeditor('page_footer', '750', 100, 'page_footer', '');
} else echo "<textarea name=\"page_footer\" cols=\"100\" rows=\"4\"></textarea><br><br>";
echo "<b>"._SIGNATURE.":</b><br><input type=\"checkbox\" name=\"asignature\" value=\"1\">"._SHOWTEXT."<br>";
if (($config['allowfck'] == 1) AND ($fckedit == 1) ) {
//$oFCKeditor = new FCKeditor('signature'); $oFCKeditor->Width = "100%"; $oFCKeditor->Height = "100"; $oFCKeditor->ToolbarSet = "Basic"; $oFCKeditor->Value = "$mypages[signature]";
//echo $oFCKeditor->CreateHtml();
$oFCKeditor = new FCKeditor;
$oFCKeditor->ToolbarSet = "Basic";
$oFCKeditor->CreateFCKeditor('signature', '750', 100, 'signature', '');
} else echo "<textarea name=\"signature\" cols=\"100\" rows=\"4\"></textarea><br><br>";
// if ($multilingual == 1) {
echo "<br><b>"._LANGUAGE.": </b><br>"
."<select name=\"clanguage\">"
."<option value=\"\">"._CNBC_ALL."</option>";
$handle=opendir('language');
while ($file = readdir($handle)) {
if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
$langFound = $matches[1];
$languageslist .= "$langFound ";
}
}
closedir($handle);
$languageslist = explode(" ", $languageslist);
sort($languageslist);
for ($i=0; $i < sizeof($languageslist); $i++) {
if($languageslist[$i]!="") {
echo "<option value=\"$languageslist[$i]\" ";
if($languageslist[$i]==$language) echo "selected";
echo ">".ucfirst($languageslist[$i])."</option>\n";
}
}
echo "</select><br><br>";
// } else {
// echo "<input type=\"hidden\" name=\"clanguage\" value=\"$language\">";
// }
if ($config['allowtheme'] == 1) {
echo "<br><b>"._CNBC_DESIGN."</b><br>"
."<select name=\"theme\">";
echo "<option value='' selected>"._CNBC_DEFAULTTHEME."</option>\n";
$handle=opendir('themes');
while ($file = readdir($handle)) {
if ( (!ereg("[.]",$file)) ) {
$themelist .= "$file ";
}
}
closedir($handle);
$themelist = explode(" ", $themelist);
sort($themelist);
for ($i=0; $i < sizeof($themelist); $i++) {
if($themelist[$i]!="") {
echo "<option value='$themelist[$i]'>$themelist[$i]</option>\n";
}
}
echo "</select><br><br>";
}
}
if ($avan == '1') echo "<br><br><a href=\"modules.php?name=$module_name&file=admin&op=page&mid=$mid&cid=$cid&fckedit=$fckedit\">"._CNBC_BASIC."</a> ... \n <br>"._CNBC_BASICTEXT."<br><br>";
else echo "<br><br><a href=\"modules.php?name=$module_name&file=admin&op=page&mid=$mid&cid=$cid&fckedit=$fckedit&avan=1\">"._CNBC_ADVANCED."</a> ... \n <br>"._CNBC_ADVANCEDTEXT."<br><br>";
echo "<input type=\"submit\" value=\""._SEND."\">"
."</form>";
CloseTable();
include("footer.php");
}
?>
|