can't make text fit in..
Posted: Fri Dec 30, 2005 9:57 am
Hey guys,
I'm working on an admin panel, and for the first time i wanted to use Templates.
I built a function that i'll replace the word "#pages" with it, and inside this function there's a switch().
When i'm replacing it, it won't show up instead of the "#pages" but will show up in the top of the page.
The class:
The function: getPages(); will return it contents in the top of the page, above the logo.
Marry christmas [did i wrote it correctly?
] and happy hanukka, Tal.
I'm working on an admin panel, and for the first time i wanted to use Templates.
I built a function that i'll replace the word "#pages" with it, and inside this function there's a switch().
When i'm replacing it, it won't show up instead of the "#pages" but will show up in the top of the page.
The class:
Code: Select all
<?Php
//-----------------------------------------------------------------
// Author: Tal Gleichger
//-----------------------------------------------------------------
// Company Name: IAD
//-----------------------------------------------------------------
// Date Started: 9:43 PM 12/28/2005
//-----------------------------------------------------------------
// Date Updated: _____Never_____
//-----------------------------------------------------------------
/*****************************************************************************
All Rights Resered to IAD & GTM IL LTD
Any Code Copying is agains the law!
Any Rights deletion is recoreded and will be repot!
*****************************************************************************/
class adminTemplates{
//----------------------------------------------
// Actions:
//
// 1) Getting HTML code
// 2) Replacing HTML outputs
// 3) Returning HTML only output
//
//----------------------------------------------
private $tplfile;
private $navifile;
private $rightsfile;
private $doReplace;
private $doOutput;
public $template;
public $doGetLogo;
public $doGetNavi;
public $makeFopen_index;
public $makeFopen_navi;
public $makeFopen_rights;
public $getNavi;
public $getRights;
public function getPages(){
switch(@($_GET['a'])){
case 'test':
require "sources/admin/TPL/admin.css";
break;
}
}
public function createReplace($tplfile,$navi,$rights){
//--
// Opening the File and Getting Html inputs
//--
$this -> tplfile = $tplfile;
$this -> navifile = $navi;
$this -> rightsfile = $rights;
$this -> makeFopen_index = fopen($this -> tplfile,'r+');
$this -> makeFopen_navi = fopen($this -> navifile,'r+');
$this -> makeFopen_rights = fopen($this -> rightsfile,'r+');
$this -> template = fread($this -> makeFopen_index,filesize($tplfile));
$this -> getNavi = fread($this -> makeFopen_navi,filesize($navi));
$this -> getRights = fread($this -> makeFopen_rights,filesize($rights));
//--
// Replacing special chars and getting other file's instead
//--
$this -> doGetLogo = str_replace('#logo','<img src="sources/admin/TPL/logo.jpg" alt="" />',$this -> template);
$this -> doGetNavi = str_replace('#navi',$this -> getNavi,$this -> doGetLogo);
$this -> doGetPages = str_replace('#pages',$this -> getPages(),$this -> doGetNavi);
$this -> doGetRights = str_replace('#rights',$this -> getRights,$this -> doGetPages);
$this -> doGetContents = $this -> doGetRights;
//--
// Finishing and returning the doGetContents
//--
return $this -> doGetContents;
}
}
?>Marry christmas [did i wrote it correctly?