Skip to content

Commit 814e0b4

Browse files
author
pedro_morgan
committed
Simplifies loading of classes. No is_object check
1 parent a5b1ff2 commit 814e0b4

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

interface/lib/app.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ public function __construct()
6767

6868
public function uses($classes)
6969
{
70-
$cl = explode(',',$classes);
70+
$cl = explode(',',$classes);
7171
if(is_array($cl)) {
7272
foreach($cl as $classname){
7373
$classname = trim($classname);
74+
//* Class is not loaded so load it
7475
if(!array_key_exists($classname, $this->_loaded_classes)){
7576
require_once($this->_conf['classpath'] . '/'.$classname.'.inc.php');
7677
$this->$classname = new $classname();

interface/lib/classes/listform_actions.inc.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ public function onLoad()
4747
{
4848
global $app, $conf, $list_def_file;
4949

50-
//TODO: this is_object checking should be in the $appobject - pedro notes
51-
if(!@is_object($app->tpl)) $app->uses('tpl');
52-
if(!@is_object($app->listform)) $app->uses('listform');
53-
if(!@is_object($app->tform)) $app->uses('tform');
50+
$app->uses('tpl,listform,tform');
5451

5552
//* Clear session variable that is used when lists are embedded with the listview plugin
5653
$_SESSION['s']['form']['return_to'] = '';

interface/web/themes/pedro/templates/main.tpl.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<script src="js/scrigo.js"></script>
1010
</head>
1111
<body bgcolor="#FFFFFF" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad="loadInitContent()">
12-
###
12+
1313
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
1414
<tr bgcolor="#496FA8">
1515
<td height="30" colspan="2" align="right" valign="top" backgrosund="themes/default/images/bg_nav_1.jpg"><!--<img src="themes/default/images/mydnsconfig_logo.gif" border="0" alt="">--></td>

0 commit comments

Comments
 (0)