Changeset 352 for trunk/Modules/FrontPage/FrontPage.php
- Timestamp:
- Jan 18, 2012, 8:23:18 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/FrontPage/FrontPage.php
r351 r352 7 7 var $ShortTitle = ''; 8 8 9 function ShowLinks($GroupId) 10 { 11 global $Database; 12 13 $DbResult = $Database->query('SELECT * FROM `HyperlinkGroup` WHERE `Id`='.$GroupId); 14 $HyperlinkGroup = $DbResult->fetch_assoc(); 15 9 function ShowLinks($HyperlinkGroup) 10 { 16 11 $Output = ''; 17 $DbResult = $ Database->query('SELECT * FROM `Hyperlink` WHERE (`Group`='.$GroupId.') AND (`Enable` = 1)');12 $DbResult = $this->Database->query('SELECT * FROM `Hyperlink` WHERE (`Group`='.$HyperlinkGroup['Id'].') AND (`Enable` = 1)'); 18 13 while($HyperLink = $DbResult->fetch_assoc()) 19 14 { … … 270 265 271 266 $Database->select_db($Config['Database']['Database']); 272 267 268 $DbResult = $Database->query('SELECT * FROM `HyperlinkGroup`'); 269 while($DbRow = $DbResult->fetch_assoc()) 270 $HyperlinkGroups[$DbRow['Id']] = $DbRow; 271 272 273 273 // Show pannels 274 274 //if(IsInternetAddr()) echo('Internet'); else echo('LAN'); 275 275 //$Output .= $this->InfoBar(); 276 276 $Output .= '<table id="MainTable"><tr>'; 277 $DbResult = $ Database->select('PanelColumn', '*');277 $DbResult = $this->Database->select('PanelColumn', '*'); 278 278 while($PanelColumn = $DbResult->fetch_assoc()) 279 279 { … … 284 284 while($Panel = $DbResult2->fetch_assoc()) 285 285 { 286 if($Panel['Module'] == 'HyperlinkGroup') $Output .= $this->ShowLinks($ Panel['Parameters']);286 if($Panel['Module'] == 'HyperlinkGroup') $Output .= $this->ShowLinks($HyperlinkGroups[$Panel['Parameters']]); 287 287 else if($Panel['Module'] == 'OnlineHostList') $Output .= $this->Panel('Online počítače', $this->OnlineHostList()); 288 288 else if($Panel['Module'] == 'UserOptions') … … 302 302 } 303 303 304 class Hyperlink extends Model 305 { 306 function __construct($Database, $System) 307 { 308 parent::__construct($Database, $System); 309 $this->Name = 'Hyperlink'; 310 $this->AddPropertyString('Name'); 311 $this->AddPropertyString('URL'); 312 $this->AddPropertyOneToMany('Group', 'HyperlinkGroup'); 313 $this->AddPropertyString('IconFile'); 314 $this->AddPropertyString('PermissionModule'); 315 $this->AddPropertyString('PermissionOperation'); 316 $this->AddPropertyBoolean('Enable'); 317 } 318 } 319 320 class HyperlinkGroup extends Model 321 { 322 function __construct($Database, $System) 323 { 324 parent::__construct($Database, $System); 325 $this->Name = 'HyperlinkGroup'; 326 $this->AddPropertyString('Name'); 327 } 328 } 329 330 class Panel extends Model 331 { 332 function __construct($Database, $System) 333 { 334 parent::__construct($Database, $System); 335 $this->Name = 'Panel'; 336 $this->AddPropertyString('Module'); 337 $this->AddPropertyString('Parameters'); 338 $this->AddPropertyInteger('Order'); 339 $this->AddPropertyOneToMany('PanelColumn', 'PanelColumn'); 340 } 341 } 342 343 class PanelColumn extends Model 344 { 345 function __construct($Database, $System) 346 { 347 parent::__construct($Database, $System); 348 $this->Name = 'PanelColumn'; 349 $this->AddPropertyString('Width'); 350 } 351 } 352 304 353 class ModuleFrontPage extends Module 305 354 { … … 313 362 $this->Description = 'Main page of community network portal'; 314 363 $this->Dependencies = array('User', 'News', 'TV', 'Map', 'Chat', 'WebCam'); 315 $this->Models = array( );364 $this->Models = array('Hyperlink', 'HyperlinkGroup', 'Panel', 'PanelColumn'); 316 365 } 317 366
Note:
See TracChangeset
for help on using the changeset viewer.