Ejemplo n.º 1
0
    $draw->author_id = $user->_id;
    $draw->_ref_author = $user;
    $draw->file_type = "image/svg+xml";
    $draw->file_name = "Sans titre";
    // context
    if ($object && $object->_id) {
        $draw->setObject($object);
    } else {
        $draw->setObject($user);
    }
    $draw->loadTargetObject();
}
$file_categories = CFilesCategory::listCatClass($draw->_class);
$category = new CDrawingCategory();
$where = array("user_id" => " = '{$user->_id}'");
$categories_user = $category->loadList($where);
$where = array("function_id" => " = '{$user->function_id}'");
$categories_function = $category->loadList($where);
$where = array("group_id" => " = '{$user->_ref_function}->group_id'");
$categories_group = $category->loadList($where);
/** @var CDrawingCategory[] $categories */
$categories = $categories_user + $categories_function + $categories_group;
foreach ($functions as $_function) {
    $where = array("function_id" => " = '{$_function->_id}'");
    $categories_function = $category->loadList($where);
    $categories = array_merge($categories, $categories_function);
}
foreach ($categories as $_category) {
    $_category->countFiles();
}
//smarty
Ejemplo n.º 2
0
<?php

/**
 * $Id$
 *  
 * @category Drawing
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
$cat = new CDrawingCategory();
$cats = $cat->loadList(null, "name");
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("cats", $cats);
$smarty->display("configure.tpl");