Beispiel #1
0
 /**
  * Get default server information and prepare chmod info
  */
 public function before()
 {
     $this->phpVersion = phpversion();
     $this->pdo = extension_loaded('pdo');
     $this->gd = extension_loaded('gd') && function_exists('gd_info');
     // autoload is disabled, lets get chmod file & dirs from console app data
     File::inc('/Apps/Controller/Console/Main.php');
     $this->_chmodDirs = Main::$installDirs;
     // for each file or directory in list - check permissions
     foreach ($this->_chmodDirs as $object) {
         if (Str::endsWith('.php', $object)) {
             // sounds like a file
             $this->chmodCheck[$object] = File::exist($object) && File::writable($object);
         } else {
             $this->chmodCheck[$object] = Directory::exist($object) && Directory::writable($object);
         }
     }
 }
Beispiel #2
0
?>
                <a href="https://ffcms.org" class="label label-success" target="_blank"><?php 
echo __('Official website');
?>
</a>
            </div>
            <div class="panel-body">
                <ul id="ffcms-news-list">
                    <li>No internet connection</li>
                </ul>
            </div>
        </div>
    </div>
</div>
<?php 
if (App::$Properties->get('gaClientId') != null && Str::endsWith('apps.googleusercontent.com', App::$Properties->get('gaClientId'))) {
    ?>
<div class="row">
    <div class="col-md-12">
        <div class="pull-right">
            <div id="embed-api-auth-container"></div>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-md-6">
        <div class="panel panel-default">
            <div class="panel-heading"><?php 
    echo __('GA: visits and users');
    ?>
</div>
 /**
  * Check if uri $source is equal to current uri point with array of $aliases and active $order set
  * @param null $source
  * @param array|null $aliases
  * @param bool $order
  * @return bool
  */
 public static function isCurrentLink($source = null, array $aliases = null, $order = false)
 {
     $elementPoint = Url::buildPathway($source);
     $currentPoint = Url::buildPathwayFromRequest();
     // use special active element order type: controller, action
     switch ($order) {
         case 'controller':
             $elementPoint = Str::firstIn($elementPoint, '/');
             $active = Str::startsWith($elementPoint, $currentPoint);
             break;
         case 'action':
             $elementArray = explode('/', $elementPoint);
             if (!Str::contains('/', $elementPoint) || count($elementArray) < 2) {
                 $active = $elementPoint === $currentPoint;
             } else {
                 $elementPoint = $elementArray[0] . '/' . $elementArray[1];
                 $active = Str::startsWith($elementPoint, $currentPoint);
             }
             break;
         case 'id':
             $elementArray = explode('/', $elementPoint);
             $elementPoint = $elementArray[0] . '/' . $elementArray[1];
             if ($elementArray[2] === null) {
                 // looks like id is not defined in element
                 if (Str::contains('?', $currentPoint)) {
                     $currentPoint = Str::firstIn($currentPoint, '?');
                 }
                 $currentArray = explode('/', $currentPoint);
                 $currentToId = implode('/', array_slice($currentArray, 0, 3));
                 $active = $elementPoint === $currentToId;
             } else {
                 $elementPoint .= '/' . $elementArray[2];
                 $active = Str::startsWith($elementPoint, $currentPoint);
             }
             break;
         default:
             $active = $elementPoint === $currentPoint;
             break;
     }
     // check if current uri equals with aliases
     if (Obj::isArray($aliases) && count($aliases) > 0) {
         foreach ($aliases as $activeUri) {
             $activeUri = trim($activeUri, '/');
             if (Str::endsWith('*', $activeUri)) {
                 $activeUri = rtrim($activeUri, '*');
                 if (Str::startsWith($activeUri, $currentPoint)) {
                     $active = true;
                 }
             } else {
                 if ($activeUri === $currentPoint) {
                     $active = true;
                 }
             }
         }
     }
     return $active;
 }