Exemplo n.º 1
0
 */
use Plethora\Config;
use Plethora\Exception;
use Plethora\Route;
use Plethora\Router;
?>

<?php 
# get logged user
$user = Model\User::getLoggedUser();
# register date
$registerDate = $user->getRegisterDate()->format('Y-m-d');
# avatar
$userImage = $user->getImageStyled();
# logout anchor
$logoutHelper = \Plethora\Helper\Link::factory();
$logoutHelper->getAttributes()->addToAttribute('class', 'btn btn-default btn-flat');
$logout = $logoutHelper->code(__('Logout'), Route::factory('logout')->url());
?>

<a href="<?php 
echo Route::backendUrl();
?>
" class="logo">
    <span class="logo-mini"><b>Pl</b></span>
    <span class="logo-lg"><b>Plethora</b></span>
</a>

<nav class="navbar navbar-static-top" role="navigation">
    <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
        <span class="sr-only"><?php 
Exemplo n.º 2
0
?>
</p>
    <p><?php 
echo __('Welcome on your new website!');
?>
</p>
    <?php 
if (\Model\User::isLogged()) {
    ?>
        <p><?php 
    echo __('You are logged! Go and see whats in your management panel ;).');
    ?>
</p>
        <p>
            <?php 
    $backend = Helper\Link::factory();
    $backend->getAttributes()->addToAttribute('class', 'btn btn-danger btn-lg');
    echo $backend->code(__('go to management panel'), Route::factory('backend')->url());
    ?>
            <?php 
    echo $loginLink->code(__('logout'), Route::factory('logout')->url());
    ?>
        </p>
    <?php 
} else {
    ?>
        <p><?php 
    echo __('Click the button below to login and start managing. Enjoy!');
    ?>
</p>
        <p><?php 
Exemplo n.º 3
0
$menus = Config::get('backend.menu');
# load submenus
$subMenus = [];
foreach (array_keys(Router::getModules()) as $sModule) {
    try {
        $aModuleMenus = Config::get($sModule . '.backend.menu', [], TRUE);
        foreach ($aModuleMenus as $sName => $aModuleMenu) {
            $subMenus[$aModuleMenu['parent']][$sModule][$sName] = $aModuleMenu;
        }
    } catch (Exception $e) {
    }
}
# get logged user
$oUser = Model\User::getLoggedUser();
# user anchor
$userAnchor = \Plethora\Helper\Link::factory()->setTitle(__('User profile'))->code($oUser->getFullName(), $oUser->getProfileURL());
?>

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Menu</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand navbar-brand-logo"
               href="<?php 
echo Route::factory('home')->url();
?>
Exemplo n.º 4
0
 /**
  * Format value.
  *
  * @access   public
  * @param    string $value
  * @return   string
  * @since    1.0.0-alpha
  * @version  1.0.0-alpha
  */
 public function format($value)
 {
     $oLink = Helper\Link::factory();
     // set title attribute
     $sTitle = '';
     $sURL = '';
     $oModel = $this->getField()->getEntity()->getModel();
     $oLocales = $oModel->getLocales();
     if ($oModel->hasField($this->getConfigTitle())) {
         $sTitle = $oModel->{$this->getConfigTitle()};
     } elseif ($oLocales !== NULL && $oLocales->hasField($this->getConfigTitle())) {
         $sTitle = $oLocales->{$this->getConfigTitle()};
     }
     $sTitle = $this->titlePrefix . $sTitle . $this->titleSuffix;
     if (!empty($sTitle)) {
         $oLink->setTitle($sTitle);
     }
     // set URL of the link
     if ($this->bValueAsURL) {
         $sURL = $value;
     } elseif (!empty($this->valueFromField)) {
         $sURL = $this->getField()->getEntity()->getModel()->getValue($this->valueFromField);
     } elseif ($this->getUrl() !== NULL) {
         $sURL = $this->getUrl();
     } elseif ($this->getRouteName() !== NULL) {
         $aArgs = $this->getRouteAttributes();
         foreach ($aArgs as $sAttrKey => $sField) {
             $sAttrValue = NULL;
             if ($oModel->hasField($sField)) {
                 $sAttrValue = $oModel->{$sField};
             } elseif ($oLocales !== NULL && $oLocales->hasField($sField)) {
                 $sAttrValue = $oLocales->{$sField};
             }
             $aArgs[$sAttrKey] = Helper\String::prepareToURL($sAttrValue);
         }
         $sURL = Route::factory($this->getRouteName())->url($aArgs);
     }
     // return newly generated link code
     return $this->sPrefix . $oLink->code($value, $sURL) . $this->sSuffix;
 }
Exemplo n.º 5
0
/**
 * @author         Krzysztof Trzos
 * @package        base
 * @subpackage     views/backend/blocks/body
 * @since          1.0.0-alpha
 * @version        1.0.0-alpha
 */
use Plethora\Core;
use Plethora\Helper;
use Plethora\Route;
?>

<?php 
$sChangelogLink = Route::factory('framework_changelog')->url();
$changelogAnchor = Helper\Link::factory()->setTitle(__('changelog'))->code(Core::getVersion(), $sChangelogLink);
?>

<footer class="main-footer">
    <div class="pull-right hidden-xs">
        <b><?php 
echo __('Version');
?>
</b> <?php 
echo $changelogAnchor;
?>
    </div>
    <strong>Copyright &copy; 2016 <a href="http://plethorafw.com">Plethora Framework</a>.</strong> <?php 
echo __('All rights reserved.');
?>
</footer>