Exemple #1
0
 function process($params, $options)
 {
     $seoKey = Util::getArrayKey($params, "category_id");
     $collectionDao = new \com\indigloo\sc\dao\Collection();
     $zmember = $collectionDao->uizmemberOnSeoKey(Nest::ui_category(), $seoKey);
     if (is_null($zmember) || !isset($zmember["ui_code"])) {
         $controller = new \com\indigloo\sc\controller\Http404();
         $controller->process();
         exit;
     }
     $code = $zmember["ui_code"];
     $catName = $zmember["name"];
     $postDao = new \com\indigloo\sc\dao\Post();
     $qparams = Url::getRequestQueryParams();
     $gpage = Url::tryQueryParam("gpage");
     $gpage = empty($gpage) ? "1" : $gpage;
     $pageSize = Config::getInstance()->get_value("search.page.items");
     $paginator = new Pagination($qparams, $pageSize);
     $postDBRows = $postDao->getPagedOnCategory($paginator, $code);
     $pageHeader = $catName;
     $pageBaseUrl = "/category/{$seoKey}";
     $pageTitle = SeoData::getPageTitleWithNumber($gpage, $catName);
     $metaKeywords = SeoData::getMetaKeywords($catName);
     $metaDescription = SeoData::getMetaDescriptionWithNumber($gpage, $catName);
     $file = APP_WEB_DIR . '/view/tiles-page.php';
     include $file;
 }
Exemple #2
0
 function spewFeatured($params, $options)
 {
     $collectionDao = new \com\indigloo\sc\dao\Collection();
     $groupDao = new \com\indigloo\sc\dao\Group();
     $row = $collectionDao->glget(Nest::fgroups());
     $feature_slug = empty($row) ? "" : $row["t_value"];
     $groups = $groupDao->slugToGroupsMap($feature_slug);
     $title = "Featured groups";
     $file = APP_WEB_DIR . "/view/group/cards.php";
     include $file;
 }
Exemple #3
0
<?php

include 'sc-app.inc';
include APP_WEB_DIR . '/inc/header.inc';
use com\indigloo\sc\util\Nest;
//public data
//do not put user role check here
set_exception_handler('webgloo_ajax_exception_handler');
$groupDao = new \com\indigloo\sc\dao\Group();
$collectionDao = new \com\indigloo\sc\dao\Collection();
$row = $collectionDao->glget(Nest::fgroups());
$feature_slug = empty($row) ? "" : $row["t_value"];
$fgroups = $groupDao->slugToGroupsMap($feature_slug);
$html = \com\indigloo\sc\html\Group::getCloud($fgroups);
echo $html;
Exemple #4
0
    $gWeb = \com\indigloo\core\Web::getInstance();
    $fvalues = array();
    $fUrl = \com\indigloo\Url::tryFormUrl("fUrl");
    try {
        $fhandler = new Form\Handler("web-form-1", $_POST);
        $fvalues = $fhandler->getValues();
        if ($fhandler->hasErrors()) {
            throw new UIException($fhandler->getErrors());
        }
        $group_slug = "";
        $slugs = Util::tryArrayKey($fvalues, "g");
        if (!is_null($slugs)) {
            //remove duplicate entries
            $slugs = array_unique($slugs);
            //input - new groups are names / old ones are slugs
            $slugs = array_map(array("\\com\\indigloo\\util\\StringUtil", "convertNameToKey"), $slugs);
            //db slugs are space separated for sphinx indexing
            $group_slug = implode(Constants::SPACE, $slugs);
        }
        $collectionDao = new \com\indigloo\sc\dao\Collection();
        $collectionDao->glset(Nest::fgroups(), $group_slug);
        //success
        $gWeb->store(Constants::FORM_MESSAGES, array("featured groups list updated!"));
        header("Location: " . $fUrl);
    } catch (UIException $ex) {
        $gWeb->store(Constants::STICKY_MAP, $fvalues);
        $gWeb->store(Constants::FORM_ERRORS, $ex->getMessages());
        header("Location: " . $fUrl);
        exit(1);
    }
}
Exemple #5
0
Fichier : edit.php Projet : rjha/sc
                <div class="span12">
                    <?php 
FormMessage::render();
?>
                </div>

                <div class="span6">
                    
                    <form  id="web-form1"  name="web-form1" action="/qa/form/edit.php" enctype="multipart/form-data"  method="POST">  
                        <table class="form-table">
                           <tr>
                                <td> <label>Category</label>

                                <?php 
$options = array('name' => 'category', 'default' => $postDBRow['cat_code'], 'empty' => true);
$collectionDao = new \com\indigloo\sc\dao\Collection();
$catRows = $collectionDao->uizmembers(\com\indigloo\sc\util\Nest::ui_category());
echo \com\indigloo\ui\SelectBox::render($catRows, $options);
?>
                                </td>
                            </tr>

                            <tr>
                                <td>
                                    <label>Details*&nbsp;(max 512 chars)</label>
                                    <textarea  id="description" maxlength="512" name="description" class="required h130 w500" cols="50" rows="4" ><?php 
echo $sticky->get('description', $postDBRow['description']);
?>
</textarea>
                                    <br>
                                   <span id="description_counter"></span>