Ejemplo n.º 1
0
 public function getHTML()
 {
     $galleryModel = new GalleryModel();
     $galleryView = new GalleryView();
     $images = $galleryModel->getImages();
     $html = $galleryView->getHTML($images);
     return $html;
 }
Ejemplo n.º 2
0
 public function __construct($engine)
 {
     parent::__construct($engine);
     $session_uid = $this->_router->getItemSegments(3);
     // upload auth
     if (!$this->_auth->hasIdentity() && $this->_acl->checkSessionUid($session_uid) == false) {
         $this->_engine->addHttpHeader("Location: " . $this->_router->getUrl('cms', 'auth'));
         exit;
     }
     $this->_gallery = GalleryModel::Instance();
     $this->_head->addStyleFile('jquery.ui.all.css', 'screen', true, '/css/jquery-ui/');
     // JqueryUI CSS
     $this->_head->addStyleFile('jquery.ui.uniform.css', 'screen', true, '/css/jquery-ui/');
     // JqueryUI CSS
     $this->_head->addStyleToImport('index', 'cms', 'base.css');
     $this->_head->addStyleFile('colorbox.css', 'screen', true, '/css/');
     $this->_head->addScriptFile('jquery-ui-' . $this->_config->jqueryui . '.min.js', true, '/scripts/jquery-ui/');
     // JqueryUI JS
     $this->_head->addScriptFile('jquery.uniform.min.js', true, '/scripts/cms/');
     // JqueryUI JS
     $this->_head->addScriptFile('jquery.colorbox.js', true, '/scripts/');
     $this->_head->addScriptFile('gallery.js', true, '/scripts/cms/');
     // JqueryUI JS
     $this->_head->addScriptFile('ckeditor.js', true, '/scripts/cms/ckeditor/');
     $this->_head->addScriptFile('base.js', true, '/scripts/cms/');
     // JqueryUI JS
     if ($this->_config->multi_locale == '1') {
         $this->_view->locale_list = $this->_function->getSiteLocaleList();
         $this->_locale_codes = $this->_function->flattenArray($this->_function->getSiteLocaleList(), 'lang_code');
         if (!$this->_session->lang_code) {
             $this->_session->lang_code = $this->_locale_codes[0];
         }
     }
     $this->_view->sidebar = $this->_view->render('modules/' . $this->_engine->getModuleName() . '/cms/templates/sidebar.tpl');
 }
Ejemplo n.º 3
0
 public function __construct($engine)
 {
     parent::__construct($engine);
     if (!$this->_auth->hasIdentity()) {
         $this->_engine->addHttpHeader("Location: /" . $this->_router->getUrl('cms', 'auth'));
         exit;
     }
     $this->_cms = IndexModel::Instance();
     $this->_gallery = GalleryModel::Instance();
     $this->_user = UsersModel::Instance();
     $this->_head->addStyleFile('jquery.ui.all.css', 'screen', true, '/css/jquery-ui/');
     // JqueryUI CSS
     $this->_head->addStyleToImport('index', 'cms', 'base.css');
     $this->_head->addScriptFile('jquery-ui-' . $this->_config->jqueryui . '.min.js', true, '/scripts/jquery-ui/');
     // JqueryUI JS
     $this->_head->addScriptFile('base.js', true, '/scripts/cms/');
     // JqueryUI JS
     $this->_head->addScriptFile('jquery.uniform.min.js', true, '/scripts/cms/');
     // JqueryUI JS
     $this->_head->addScriptFile('index.js', true, '/scripts/cms/');
     // JqueryUI JS
     $this->_head->addScriptFile('jquery.ui.datepicker-pl.js', true, '/scripts/');
     $this->_head->addScriptFile('ckeditor.js', true, '/scripts/cms/ckeditor/');
     $this->_view->sidebar = $this->_view->render('modules/' . $this->_engine->getModuleName() . '/cms/templates/sidebar.tpl');
 }
Ejemplo n.º 4
0
 public function Instance()
 {
     if (!isset(GalleryModel::$_instance)) {
         GalleryModel::$_instance = new GalleryModel();
     }
     return GalleryModel::$_instance;
 }
Ejemplo n.º 5
0
 public function __construct($engine)
 {
     parent::__construct($engine);
     $this->_cms = IndexModel::Instance();
     $this->_gallery = GalleryModel::Instance();
     $this->priority = array('1' => '3. Wspieranie współpracy społeczności lokalnych');
     $this->topic = array('1' => '3.3. Fundusz Mikroprojektów w Euroregionie Silesia');
     $this->_head->addStyleFile('style.css', 'screen', true, '/css/');
     $this->_head->addStyleFile('lightgallery.css', 'screen', true, '/css/');
     $this->_head->addScriptFile('base.js', true, '/scripts/');
     $this->_head->addScriptFile('lightgallery.js', true, '/scripts/');
     $this->_head->addScriptFile('lg-thumbnail.js', true, '/scripts/');
     $this->_head->addScriptFile('lg-fullscreen.js', true, '/scripts/');
     $this->_head->title = $this->_config->meta_data->title;
     $this->_head->keywords = $this->_config->meta_data->keywords;
     $this->_head->description = $this->_config->meta_data->description;
 }
Ejemplo n.º 6
0
 /**
  * Get number of gallery items
  *
  * @todo Cache count to save database queries
  * @return integer Number of items
  */
 public function getGalleryItemsCount()
 {
     $gallery = new GalleryModel();
     $count = $gallery->getUserItemCount($this->get_userid());
     return $count;
 }
Ejemplo n.º 7
0
 public function loop()
 {
     Asset::add('masonry', 'js/masonry.pkgd.min.js', false, '1.0', false, 'script');
     Asset::add('imagesloaded', 'js/imagesloaded.pkgd.min.js', false, '1.0', false, 'script');
     return View::make('partials.gallery.loop', ['galleries' => GalleryModel::all()])->render();
 }
Ejemplo n.º 8
0
<?php

$articlesModel = new ArticlesModel();
$galleryModel = new GalleryModel();
/**
 * Articles block
 */
$articles = array(array('label' => 'Додати статтю', 'controller' => 'articles', 'top' => true, 'action' => 'add', 'privilege' => 'add', 'params' => array()));
foreach ($articlesModel->listAll() as $item) {
    $articles[] = array('label' => $item->title, 'action' => 'view', 'controller' => 'articles', 'params' => array('id' => $item->id), 'pages' => array(array('label' => 'Редагувати', 'action' => 'edit', 'controller' => 'articles', 'privilege' => 'edit', 'params' => array('id' => $item->id)), array('label' => 'Видалити', 'action' => 'delete', 'controller' => 'articles', 'privilege' => 'delete', 'params' => array('id' => $item->id))));
}
/**
 * Gallery block
 */
$controller = 'gallery';
$gallery = array(array('label' => 'Додати картинку', 'controller' => $controller, 'top' => true, 'action' => 'add', 'privilege' => 'add', 'params' => array()));
$action = 'view';
foreach ($galleryModel->listAll() as $item) {
    $params = array('id' => $item->id);
    $gallery[] = array('label' => $item->getTitle(), 'action' => $action, 'controller' => $controller, 'params' => $params, 'pages' => array(array('label' => 'Редагувати', 'action' => 'edit', 'privilege' => 'edit', 'controller' => $controller, 'params' => $params), array('label' => 'Видалити', 'action' => 'delete', 'privilege' => 'delete', 'controller' => $controller, 'params' => $params)));
}
return array(array('id' => 'main', 'controller' => 'index', 'action' => 'index', 'label' => 'Головна', 'pages' => array(array('label' => 'Реєстрація', 'controller' => 'user', 'action' => 'register', 'privilege' => 'register'), array('id' => 'login', 'label' => 'Авторизація', 'controller' => 'user', 'action' => 'login', 'privilege' => 'login'), array('label' => 'Статті', 'controller' => 'articles', 'action' => 'list', 'pages' => $articles), array('label' => 'Галерея', 'controller' => 'gallery', 'action' => 'list', 'pages' => $gallery), array('label' => 'Дошка оголошень', 'controller' => 'mboard', 'action' => 'index', 'pages' => array(array('label' => 'Додати оголошення', 'controller' => 'mboard', 'action' => 'add', 'privilege' => 'addToMboard', 'id' => 'addM'))))));
Ejemplo n.º 9
0
    echo $words->getSilent('TripsUpComing');
    ?>
">
        <?php 
    echo $words->get('TripsShowAll');
    ?>
</a>
    </p>
    </div>
    <?php 
}
/**********************
** Profile Gallery  **
**********************/
$userid = $member->userid;
$gallery = new GalleryModel();
$statement = $userid ? $gallery->getLatestItems($userid) : false;
if ($statement) {
    ?>
    <div id="gallery" class="floatbox box">
    <?php 
    if ($showEditLinks) {
        ?>
    <span class="float_right profile-edit-link">
        <a href="/gallery/manage"><?php 
        echo $words->get('Edit');
        ?>
</a>
    </span>
    <?php 
    }
Ejemplo n.º 10
0
    public function editProcess($callbackId)
    {
        $vars =& PPostHandler::getVars($callbackId);
        if ($this->checkTripOwnership($vars['trip_id'])) {
            // Update the Tripdata
            $query = <<<SQL
UPDATE `trip_data`
SET
    `trip_name` = '{$this->dao->escape($vars['n'])}',
    `trip_descr` = '{$this->dao->escape($vars['d'])}',
    `edited` = NOW()
WHERE `trip_id` = '{$this->dao->escape($vars['trip_id'])}'
SQL;
            $this->dao->query($query);
            if (isset($vars['cg']) && $vars['cg']) {
                $Gallery = new GalleryModel();
                $galleryId = $Gallery->createGallery($vars['n']);
                if (!$galleryId) {
                    $vars['errors'][] = 'gallery_not_created';
                } else {
                    $this->assignGallery($vars['trip_id'], $galleryId);
                }
            } elseif (isset($vars['gallery']) && $vars['gallery']) {
                $this->assignGallery($vars['trip_id'], $vars['gallery']);
            }
            return PVars::getObj('env')->baseuri . 'trip/' . $vars['trip_id'];
        }
    }
Ejemplo n.º 11
0
<?php

if (!empty($atts) && is_array($atts)) {
    $nb = 5;
    if (array_key_exists($atts, 'nb')) {
        if (is_numeric($atts['nb'])) {
            $nb = $atts['nb'];
        }
    }
    if (array_key_exists($atts, 'type')) {
        switch ($atts['type']) {
            case "post":
                $p = PostModel::all($nb);
                break;
            case "gallery":
                $p = GalleryModel::all($nb);
                break;
            case "product":
                $p = ProductModel::all($nb);
                break;
            default:
                $p = PostModel::all($nb);
        }
    }
}
?>

@include('partials.home.slider', [
    'post' => $p
])
Ejemplo n.º 12
0
<?php

$words = new MOD_words();
$Gallery = new GalleryModel();
// Show the galleries/photosets
if ($galleries) {
    $request = PRequest::get()->request;
    $requestStr = implode('/', $request);
    $matches = array();
    if (preg_match('%/=page(\\d+)%', $requestStr, $matches)) {
        $page = $matches[1];
        $requestStr = preg_replace('%/=page(\\d+)%', '', $requestStr);
    } else {
        $page = 1;
    }
    if (!isset($itemsPerPage)) {
        $itemsPerPage = 6;
    }
    $p = PFunctions::paginate($galleries, $page, $itemsPerPage);
    $galleriesonpage = $p[0];
    echo '<div class="floatbox">';
    foreach ($galleriesonpage as $g) {
        static $ii = 0;
        $d = $Gallery->getLatestGalleryItem($g->id);
        $s = $Gallery->getGalleryItems($g->id, 1);
        $username = MOD_member::getUserHandle($g->user_id_foreign);
        $this->myself = $this->loggedInMember && $username == $this->loggedInMember->Username;
        $num_rows = $s ? $s : 0;
        // Only show the galleries with pictures. The belonging user might see them anyway.
        if ($d || $this->myself) {
            ?>