-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '4.0-dev' into j4/fix/tests
- Loading branch information
Showing
136 changed files
with
5,374 additions
and
3,694 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
administrator/components/com_cpanel/Entities/SystemHeader.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_cpanel | ||
* | ||
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
namespace Joomla\Component\Cpanel\Administrator\Entities; | ||
|
||
defined('_JEXEC') or die; | ||
|
||
/** | ||
* Class representing a section in the system view. | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class SystemHeader | ||
{ | ||
/** | ||
* The class for an icon to display for the header | ||
* | ||
* @var string | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
private $icon; | ||
|
||
/** | ||
* The title of the header | ||
* | ||
* @var string | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
private $title; | ||
|
||
/** | ||
* The list of items in this section | ||
* | ||
* @var SystemItem[] | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
private $items = []; | ||
|
||
/** | ||
* SystemHeader constructor. | ||
* | ||
* @param string $title The title of the header | ||
* @param string $icon The class for an icon to display for the header | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function __construct($title, $icon) | ||
{ | ||
$this->title = $title; | ||
$this->icon = $icon; | ||
} | ||
|
||
/** | ||
* Method to add an item to the section | ||
* | ||
* @param SystemItem $item The item to add to this section | ||
* | ||
* @return void | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function addItem(SystemItem $item) | ||
{ | ||
$this->items[] = $item; | ||
} | ||
|
||
/** | ||
* Get the icon associated with the section | ||
* | ||
* @return string | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function getIcon() | ||
{ | ||
return $this->icon; | ||
} | ||
|
||
/** | ||
* Get the title associated with the section | ||
* | ||
* @return string | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function getTitle() | ||
{ | ||
return $this->title; | ||
} | ||
|
||
/** | ||
* Get the items added into the section | ||
* | ||
* @return SystemItem[] | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function getItems() | ||
{ | ||
return $this->items; | ||
} | ||
|
||
/** | ||
* Does the section contain any items | ||
* | ||
* @return boolean | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function hasItems() | ||
{ | ||
return count($this->items) !== 0; | ||
} | ||
} |
97 changes: 97 additions & 0 deletions
97
administrator/components/com_cpanel/Entities/SystemItem.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_cpanel | ||
* | ||
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
namespace Joomla\Component\Cpanel\Administrator\Entities; | ||
|
||
defined('_JEXEC') or die; | ||
|
||
/** | ||
* Class representing a item in the system view. | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class SystemItem | ||
{ | ||
/** | ||
* The title of the item | ||
* | ||
* @var string | ||
*/ | ||
private $title; | ||
|
||
/** | ||
* The link of the item | ||
* | ||
* @var string | ||
*/ | ||
private $link; | ||
|
||
/** | ||
* An optional badge of the item | ||
* | ||
* @var string|null | ||
*/ | ||
private $badge; | ||
|
||
/** | ||
* Class constructor. | ||
* | ||
* @param string $title The title of the item | ||
* @param string $link The link for the item | ||
* @param string $badge The optional badge for the item | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function __construct($title, $link, $badge = '') | ||
{ | ||
$this->title = $title; | ||
$this->link = $link; | ||
|
||
if (!empty($badge)) | ||
{ | ||
$this->badge = $badge; | ||
} | ||
} | ||
|
||
/** | ||
* The item title | ||
* | ||
* @return string | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function getTitle() | ||
{ | ||
return $this->title; | ||
} | ||
|
||
/** | ||
* The item link | ||
* | ||
* @return string | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function getLink() | ||
{ | ||
return $this->link; | ||
} | ||
|
||
/** | ||
* The string to display in the notification badge if there is one. Else null. | ||
* | ||
* @return string|null | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function getBadge() | ||
{ | ||
return $this->badge; | ||
} | ||
} |
Oops, something went wrong.