function showareas() { doAreaEdit(); global $indexTemplateAreas; //execute the nano site in demo to read the content areas demoExecuteNanoSite(); $sett = getDetails('settings'); $contents = $sett['def-template-areas']; $areaInfo = array(); foreach ($contents as $areaName) { $areaFile = areaDataDir("{$areaName}"); $fileContent = file_exists($areaFile) ? file_get_contents($areaFile) : ''; $areaInfo[$areaName] = $fileContent; } $saveAllTxt = lt('Save all Areas'); $biggerInp = lt('Bigger Input Box'); $smallerInp = lt('Smaller Input Box'); echo "<form action='?action=showareas&do=editarea' method='post'>"; echo "<input type='submit' value='+ {$saveAllTxt} +' class='floatright'>"; echo "<input type='hidden' name='areaCount' value='" . count($areaInfo) . "'>"; $cnt = 1; foreach ($areaInfo as $areaName => $areaContents) { $boxId = "box{$cnt}"; //md5($areaName); echo "<h2>» {$areaName}</h2>\r\n\t\t\t <input type='hidden' name='areaName{$cnt}' value='{$areaName}'>\r\n\t\t\t\t<table><tr valign='top'><td>\r\n\t\t\t\t<textarea name='areaContent{$cnt}' rows='2' cols='60' id='{$boxId}' class='areabox'>" . htmlentities($areaContents) . "</textarea>\r\n\t\t\t\t</td><td>\r\n\t\t\t\t<input type='button' onclick='makesmall(\"{$boxId}\")' value='-' title='{$smallerInp}' class='isizeh'>\r\n\t\t\t\t<input type='button' onclick='makebig(\"{$boxId}\")' value='+' title='{$biggerInp}' class='isizeh'>\r\n\t\t\t\t</td></tr></table>\r\n\t\t\t "; $cnt++; } echo "<input type='submit' value='+ {$saveAllTxt} +' class='floatright'>"; echo "</form>"; echo "<script language='javascript'>\r\n\t\t\tfunction makebig(id) {\r\n\t\t\tobj = document.getElementById(id);\r\n\t\t\tif( obj.rows < 30 ) obj.rows+= 5;\r\n\t\t\t}\r\n\t\t\tfunction makesmall(id) {\r\n\t\t\tobj = document.getElementById(id);\r\n\t\t\tif( obj.rows > 5 ) obj.rows-= 5;\r\n\t\t\t}\r\n\t\t </script>"; }
function show_content_area($areaName) { $areaFile = areaDataDir(strtolower($areaName)); if (file_exists($areaFile)) { require $areaFile; } // make it compulsory //else ignore }
function showareas() { global $indexTemplateAreas; //execute the nano site in demo to read the content areas demoExecuteNanoSite(); $contents = $indexTemplateAreas; $contents = array_unique($contents); foreach ($contents as $areaName) { $areaFile = areaDataDir("{$areaName}"); $fileContent = file_exists($areaFile) ? file_get_contents($areaFile) : ''; $boxId = md5($areaFile); echo "<h2>{$areaName}</h2>\r\n\t\t\t <form action='?action=editarea' method='post'>\r\n\t\t\t\t<textarea name='content' rows='2' cols='60' id='{$boxId}' class='areabox'>" . htmlentities($fileContent) . "</textarea>\r\n\t\t\t\t<input type='hidden' name='areaname' value='{$areaName}'><br />\r\n\t\t\t\t<input type='submit' value='Save'>\r\n\t\t\t\t<input type='button' onclick='makebig(\"{$boxId}\")' value=' + ' title='Bigger Input'>\r\n\t\t\t\t<input type='button' onclick='makesmall(\"{$boxId}\")' value=' - ' title='Smaller Input'>\r\n\t\t\t\t<input type='button' onclick='makenarrow(\"{$boxId}\")' value=' < ' title='Narrower Input'>\r\n\t\t\t\t<input type='button' onclick='makewide(\"{$boxId}\")' value=' > ' title='Wider Input'>\r\n\t\t\t </form>"; } echo "<script langua='javascript'>\r\n\t\t\tfunction makebig(id) {\r\n\t\t\tobj = document.getElementById(id);\r\n\t\t\tif( obj.rows < 30 ) obj.rows+= 3;\r\n\t\t\t}\r\n\t\t\tfunction makesmall(id) {\r\n\t\t\tobj = document.getElementById(id);\r\n\t\t\tif( obj.rows > 3 ) obj.rows-= 3;\r\n\t\t\t}\r\n\t\t\tfunction makewide(id) {\r\n\t\t\tobj = document.getElementById(id);\r\n\t\t\tif( obj.cols < 90 ) obj.cols+= 5;\r\n\t\t\t}\r\n\t\t\tfunction makenarrow(id) {\r\n\t\t\tobj = document.getElementById(id);\r\n\t\t\tif( obj.cols > 60 ) obj.cols-= 5;\r\n\t\t\t}\r\n\t\t </script>"; }
function show_content_area($areaName, $defaultContent = '') { runTweak('content-area-begin', array($areaName)); $areaFile = areaDataDir(strtolower($areaName)); if (file_exists($areaFile)) { require $areaFile; } else { echo $defaultContent; } runTweak('content-area-end', array($areaName)); }