Example #1
0
 public function __construct()
 {
     $ext = new Standard();
     $this->extensions[$ext->getName()] = $ext;
     $ext = new JSON();
     $this->extensions[$ext->getName()] = $ext;
     $ext = new Curl();
     $this->extensions[$ext->getName()] = $ext;
 }
Example #2
0
 /**
  * Add CSS ID to main image so we can replace it
  * @param   object
  * @param   string
  * @param   array
  * @return  string
  */
 protected function addImageToTemplate(\Isotope\Template $objTemplate, $strType, array $arrFile)
 {
     parent::addImageToTemplate($objTemplate, $strType, $arrFile);
     $objTemplate->uid = spl_object_hash($this);
     if ($strType == 'gallery') {
         $objTemplate->link = $arrFile['main'];
     }
 }
Example #3
0
 /**
  * Returns the file system for the given name
  *
  * @param string $name Key for the file system
  * @return \Aimeos\MW\Filesystem\Iface File system object
  * @throws \Aimeos\MW\Filesystem\Exception If an no configuration for that name is found
  */
 public function get($name)
 {
     $key = $this->getConfig($name);
     if (is_string($key)) {
         if (!isset($this->objects[$key])) {
             $this->objects[$key] = new \Aimeos\MW\Filesystem\Laravel($this->fsm->disk($key), $this->tempdir);
         }
         return $this->objects[$key];
     }
     return parent::get($name);
 }
Example #4
0
 public function parse($result, $rawdata)
 {
     if (isset($this->available) && strlen($this->available)) {
         preg_match_all($this->available, $rawdata, $matches);
         $registered = empty($matches[0]);
         if (!$registered) {
             if (isset($result->registered) && $result->registered) {
                 return;
             }
         }
     }
     parent::parse($result, $rawdata);
 }
Example #5
0
 public function __construct(array $data)
 {
     if (!array_key_exists('name', $data)) {
         throw new \Exception('Name of target is not set');
     }
     $this->name = Standard::normalizeName($data['name']);
     if (!$this->name) {
         throw new \Exception('Empty target name');
     }
     if (!array_key_exists('namespace', $data)) {
         throw new \Exception('Namespace of target is not set');
     }
     $this->namespace = Standard::normalizeNamespace($data['namespace']);
     if (!$this->namespace) {
         throw new \Exception('Empty target namespace');
     }
     $this->withAnnotations = array_key_exists('withAnnotations', $data) && $data['withAnnotations'];
     $this->useClassNotations = array_key_exists('useClassNotations', $data) && $data['useClassNotations'];
     $this->withInitFunction = array_key_exists('withInitFunction', $data) && $data['withInitFunction'];
 }
Example #6
0
<?php

require_once 'models/Http.php';
require_once 'models/User.php';
require_once 'views/Standard.php';
require_once 'views/Register.php';
$username = Http::get('username');
$email = Http::get('email');
$register_form = Register::render($username, $email);
$reason = Register::renderReason(Http::get('reason'));
$information = Register::renderInformation();
echo Standard::render($information . $reason, $register_form, User::generateLoginState());
Example #7
0
 /**
  * Default constructor used to initialize the stated class instance with its factory.
  */
 public function __construct()
 {
     parent::__construct();
     //Call the startup factory to initialize this proxy
     $this->initializeObjectWithFactory();
 }
Example #8
0
$username = Http::get('name');
$logged_in_as = User::getCurrentLogin();
$viewerinfo = User::getUser($logged_in_as);
$userinfo = User::getUser($username);
if ($viewerinfo == false) {
    $error = Userpage::renderNoPrivilege($username);
    echo Standard::render('', $error);
    die;
}
if ($userinfo == false) {
    $error = Userpage::renderNotExist($username);
    echo Standard::render('', $error);
    die;
}
if ($username == $logged_in_as || $userinfo['privilege'] > $viewerinfo['privilege'] && $viewerinfo['privilege'] <= 4) {
    $privilege = Userpage::renderPrivileged($username, $userinfo['email'], $privileges, $userinfo['privilege'], $viewerinfo['privilege'], $viewerinfo['username']);
    $sidebar = Userpage::renderPrivilegedStatistics();
    $sidebar .= Userpage::renderReason(Http::get('reason'));
    if (Http::get('reason') == 'success') {
        $sidebar .= Userpage::renderSuccessTime(Http::get('time'));
    } else {
        if (Http::get('reason') == 'nothing_changed') {
            $sidebar .= Userpage::renderNothingChanged();
        }
    }
    echo Standard::render($sidebar, $privilege, User::generateLoginState());
} else {
    $error = Userpage::renderNoPrivilege($username);
    echo Standard::render('', $error);
    die;
}
Example #9
0
<?php

require_once 'models/Http.php';
require_once 'models/Media.php';
require_once 'models/User.php';
require_once 'views/SearchError.php';
require_once 'views/Standard.php';
require_once 'views/Thumbnail.php';
$page = Http::getOrOne('page') - 1;
$media = new Media();
$tags = explode(' ', trim(Http::get('tags')));
$result = $media->getPage($tags, $page, 25);
$html = Thumbnail::generateThumbnails($result['media']);
$html .= Thumbnail::generatePageCounter($result['pagecount'], $page, 'search/', Http::get('tags'));
$error = SearchError::maybeWriteError($result['unused']);
$sidebar = Standard::renderSidebar();
echo Standard::render($error . $sidebar, $html, User::generateLoginState(), Http::get('tags'));
Example #10
0
<?php

require_once 'models/Http.php';
require_once 'models/User.php';
require_once 'views/Standard.php';
require_once 'views/UploadPage.php';
$notice = '';
if (Http::has('newid')) {
    $notice = UploadPage::renderSuccess(Http::get('newid'));
} else {
    if (Http::has('reason')) {
        $notice = UploadPage::renderFail(Http::get('reason'));
    }
}
$upload_form = UploadPage::render(Http::get('description'), Http::get('taglist'), Http::get('newid'), Http::get('autolink'));
echo Standard::render(UploadPage::renderInformation($notice), $upload_form, User::generateLoginState());
Example #11
0
 /**
  * Render a single answer in the PDF
  * @param \Jazzee\ApplicantPDF $pdf
  * @param \Jazzee\Entity\Page $page
  * @param \Jazzee\Entity\Answer $answer
  */
 protected function renderPdfAnswerFromArray(\Jazzee\Entity\Page $page, \Jazzee\ApplicantPDF $pdf, array $answerData)
 {
     $locationSummary = '';
     $schoolName = '';
     $schoolType = '';
     foreach ($answerData['elements'] as $element) {
         if ($element['id'] == 'locationSummary') {
             $locationSummary = $element['displayValue'];
         }
         if ($element['id'] == 'schoolName') {
             $schoolName = $element['displayValue'];
         }
         if ($element['id'] == 'schoolType') {
             $schoolType = $element['displayValue'];
         }
     }
     $pdf->addText("Type: ", 'b');
     $pdf->addText("{$schoolType}\n", 'p');
     $pdf->addText("School: ", 'b');
     $pdf->addText("{$schoolName}\n", 'p');
     $pdf->addText("Location: ", 'b');
     $pdf->addText("{$locationSummary}\n", 'p');
     parent::renderPdfAnswerFromArray($page, $pdf, $answerData);
 }
Example #12
0
<?php

require_once 'models/Http.php';
require_once 'models/User.php';
require_once 'views/Standard.php';
require_once 'views/Login.php';
if ($username = User::getCurrentLogin()) {
    if (!User::getUser($username)) {
        User::logout();
    }
    header("Location: /user/{$username}");
    die;
}
$reason = Http::get('reason');
$result = Login::renderReason($reason);
echo Standard::render($result, Login::render(Http::get('username')));
Example #13
0
<?php

require_once 'models/Http.php';
require_once "models/Media.php";
require_once "models/User.php";
require_once "views/Thumbnail.php";
require_once "views/Standard.php";
$page = Http::getOrOne('page') - 1;
$media = new Media();
$results = $media->getPage([], $page, 25);
$html = Thumbnail::generateThumbnails($results['media']);
$html .= Thumbnail::generatePageCounter($results['pagecount'], $page);
$sidebar = Standard::renderSidebar();
echo Standard::render($sidebar, $html, User::generateLoginState());
Example #14
0
 /**
  * Returns the item values as array.
  *
  * @return array Associative list of item properties and their values
  */
 public function toArray()
 {
     $list = parent::toArray();
     $list['typo3.pageid'] = $this->getPageId();
     return $list;
 }
Example #15
0
 public function testFormat()
 {
     $format = new Standard();
     $result = $format->format('info', 'test message', array('test' => 1));
     $this->assertRegExp('/^\\d{2} \\w{3} \\d{4} \\d{2}:\\d{2}\\.\\d{2} \\+\\d{4} \\[info\\] "test message" array \\(  \'test\' => 1,\\)$/', $result);
 }
Example #16
0
 /**
  * Branching pages list the children of each branch
  * 
  * @return array
  */
 public function listDisplayElements()
 {
     $elements = parent::listDisplayElements();
     $weight = count($elements);
     $elements[] = new \Jazzee\Display\Element('page', $this->_applicationPage->getPage()->getVar('branchingElementLabel'), $weight++, 'branchingPageSelection', $this->_applicationPage->getPage()->getId());
     foreach ($this->_applicationPage->getPage()->getChildren() as $child) {
         foreach ($child->getApplicationPageJazzeePage()->listDisplayElements() as $displayElement) {
             if ($displayElement->getType() != 'page' and !in_array($displayElement->getName(), array('attachment', 'answerPublicStatus', 'answerPrivateStatus'))) {
                 $elements[] = new \Jazzee\Display\Element($displayElement->getType(), $this->_applicationPage->getTitle() . ' ' . $displayElement->getTitle(), $weight++, $displayElement->getName(), $displayElement->getPageId());
             }
         }
     }
     $elements[] = new \Jazzee\Display\Element('page', 'Attacment', $weight++, 'attachment', $this->_applicationPage->getPage()->getId());
     return $elements;
 }
Example #17
0
 public function parse($result, $rawdata, $query)
 {
     $rawdata = utf8_encode($rawdata);
     parent::parse($result, $rawdata, $query);
 }
Example #18
0
<?php

require_once "models/User.php";
require_once "views/Standard.php";
require_once "views/Support.php";
echo Standard::render(Support::getBar(), Support::getText(), User::generateLoginState());
 public static function fromArray($data)
 {
     $settings = new ReportOptions();
     foreach ($data as $key => $value) {
         if (property_exists(get_class($settings), $key)) {
             if (is_array($value)) {
                 if ($key == "standard") {
                     $settings->{$key} = Standard::fromArray($value);
                 }
             } else {
                 $settings->{$key} = $value;
             }
         }
     }
     return $settings;
 }
Example #20
0
<?php

require_once 'models/Http.php';
require_once 'models/Media.php';
require_once 'models/User.php';
require_once 'views/MediaPage.php';
require_once 'views/Standard.php';
$media = new Media();
$media_id = Http::get('id');
$comments = $media->getComments($media_id, 0, 50);
$media_tags = $media->getAllTags($media_id);
$media_data = $media->getMedia($media_id);
$statistics = $media->getMediaStatistics($media_id);
$user = User::getUser(User::getCurrentLogin());
$user_affiliation = $media->getUserVotes($media_id, $user['user_ID']);
$media_code = MediaPage::render($media_data, $media_tags, $comments);
$from = $media_data['from_id'];
$to = $media_data['to_id'];
$control_code = MediaPage::renderControls($media_data['media_ID'], $user_affiliation, $statistics, $from, $to);
$error_code = MediaPage::renderWarning(Http::get('reason'));
echo Standard::render($control_code . $error_code, $media_code, User::generateLoginState());
Example #21
0
<?php

require_once 'models/Media.php';
require_once 'models/User.php';
require_once 'views/Standard.php';
require_once 'views/Tag.php';
$media = new Media();
$tags = $media->getAllTagsGloballyByCount();
$taghtml = Tag::render($tags);
echo Standard::render('Here you can see the most common tags in the database. Any non-whitespace broken sequence of characters constitutes a single tag. The number in the parentheses represent the amount of media that is tagged with that tag. If tags have the same number of media, then they will be sorted alphabetically.', $taghtml, User::generateLoginState());