コード例 #1
0
ファイル: Utilisateur.php プロジェクト: dermoumi/saget
 public function contexte_filiere()
 {
     $redirect_to = $this->input->get('redirect');
     check_context_secteur('admin/utilisateur/contexte_filiere' . ($redirect_to ? '?redirect=' . $redirect_to : ''));
     $this->load->helper('form');
     $this->load->helper('common');
     $this->load->model('filiere_model');
     $curr_secteur = context_get('secteur_id');
     $curr_etab_secteur = context_get('etab_secteur_id');
     if ($this->input->post('filiere')) {
         $filiere = $this->filiere_model->get($this->input->post('filiere'));
         $assignment = $filiere ? $this->filiere_model->assignment($filiere->id) : null;
         if ($assignment) {
             context_set('filiere_id', $filiere->id);
             context_set('filiere_libelle', $filiere->libelle);
             context_set('e_s_filiere_id', $assignment->id);
             $this->session->keep_flashdata('flash_msg');
             $this->session->set_flashdata('flash_msg', "Filière sélectionnée");
             redirect($this->input->post('redirect_route') ? $this->input->post('redirect_route') : 'admin');
         } else {
             $this->session->set_flashdata('flash_msg_fail', "Erreur lors de la sélection de filière");
         }
     }
     $data = array('filieres' => $this->filiere_model->list_context(), 'curr_filiere_id' => context_get('filiere_id'), 'redirect_route' => $redirect_to);
     $this->show('utilisateur/contexte_filiere', $data);
 }
コード例 #2
0
ファイル: template.php プロジェクト: veriKami/jake
/**
 * Preprocessor for theme('page').
 */
function jake_preprocess_page(&$vars)
{
    // Help link
    if (!empty($vars['help'])) {
        $vars['help_link'] = l('?', $_GET['q'], array('fragment' => 'help', 'attributes' => array('class' => 'help-link')));
    }
    // Admin link
    if (user_access('administer mn')) {
        $vars['admin_link'] = l(t('Admin'), 'admin/settings/site-information', array('attributes' => array('class' => 'admin-link')));
    }
    // Add body class for layout.
    $vars['attr']['class'] .= !empty($vars['template_files']) ? ' ' . end($vars['template_files']) : '';
    // Site name
    $vars['site_name'] = theme('site_name');
    // Display mission in a block
    if (!empty($vars['mission']) && drupal_is_front_page()) {
        $mission_block = new stdClass();
        $mission_block->content = $vars['mission'];
        $vars['mission_block'] = theme('block', $mission_block);
    }
    // Truncate the slogan so it doesn't break the header
    $vars['site_slogan'] = truncate_utf8($vars['site_slogan'], 35);
    // Determine stack height for fullscreen views.
    $class = array();
    if ($stackclass = context_get('theme', 'stackclass')) {
        $class[] = $stackclass;
    }
    if (!empty($vars['tabs'])) {
        $class[] = 'tabs';
    }
    if (!empty($class)) {
        $vars['attr']['class'] .= ' with-' . implode('-', $class);
    }
}
コード例 #3
0
ファイル: template.php プロジェクト: nodefortytwo/famelab
function famelab_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL)
{
    $class = $menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf');
    if (!empty($extra_class)) {
        $class .= ' ' . $extra_class;
    }
    if ($in_active_trail) {
        $class .= ' active-trail';
    } else {
        // Get the link's URL (sadly, this function doesn't include the link object)
        $url_pattern = '/<a\\s[^>]*href=\\"([^\\"]*)\\"[^>]*>.*<\\/a>/siU';
        preg_match($url_pattern, $link, $matches);
        $link_path = substr_replace($matches[1], '', 0, 1);
        // remove first slash
        $contexts = context_get();
        if (!empty($contexts)) {
            $active_paths = array();
            foreach ($contexts['context'] as $context) {
                if (array_key_exists('menu', $context->reactions)) {
                    $active_paths[$context->reactions['menu']] = $context->reactions['menu'];
                }
            }
            if (in_array(drupal_lookup_path('source', $link_path), $active_paths)) {
                $class .= ' active-trail';
            }
        }
    }
    return '<li class="' . $class . '">' . $link . $menu . "</li>\n";
}
コード例 #4
0
ファイル: Materiel.php プロジェクト: dermoumi/saget
 public function __construct()
 {
     parent::__construct();
     $this->setup_name(TRUE, 'materiel', 'materiel');
     $this->entry_attr(array('code' => 'materiel_cod', 'libelle' => 'materiel_designation', 'lv' => 'materiel_lv', 'lj' => 'materiel_lj', 'prix' => 'materiel_cout', 'assign' => 'materiel_assign', 'qte' => 'materiel_qte'));
     // Check the main context (complexe, etablissement and annee)
     check_context();
     // Load needed model
     $this->load->model('local_model');
     // Process changing local
     if ($this->input->post('changer_local')) {
         $this->load->model('local_model');
         $local = $this->local_model->get($this->input->post('materiel_local'));
         if ($local) {
             context_set('local_id', $local->id);
             context_set('local_code', $local->code);
         }
     }
     // Check if local is valid
     $local = NULL;
     if (context_get('local_id') && context_get('local_code')) {
         $local = $this->local_model->get(context_get('local_id'));
     }
     if (!$local) {
         $local = $this->local_model->get_first();
         if ($local) {
             context_set('local_id', $local->id);
             context_set('local_code', $local->code);
         }
     }
     if (!$local) {
         context_set('local_id', NULL);
         context_set('local_code', NULL);
     }
 }
コード例 #5
0
ファイル: Etablissement.php プロジェクト: dermoumi/saget
 public function batch()
 {
     if (in_array(context_get('etab_id'), $this->input->post('check'))) {
         clear_context();
     }
     parent::batch();
 }
コード例 #6
0
ファイル: Module_model.php プロジェクト: dermoumi/saget
 public function update($id)
 {
     // TODO: Get rid of unused names
     $module_name = $this->db->get_where('module_name', array('libelle' => $this->input->post('module_libelle')))->row();
     $id_module_name = null;
     if ($module_name) {
         $id_module_name = $module_name->id;
     } else {
         $this->db->insert('module_name', array('libelle' => $this->input->post('module_libelle')));
         $id_module_name = $this->db->insert_id();
     }
     return $this->db->replace('module', array('id' => $id, 'id_e_s_filiere' => context_get('e_s_filiere_id'), 'id_module_name' => $id_module_name, 'code' => $this->input->post('module_code'), 'a1s1' => $this->input->post('module_a1s1'), 'a1s2' => $this->input->post('module_a1s2'), 'a2s1' => $this->input->post('module_a2s1'), 'a2s2' => $this->input->post('module_a2s2'), 'theorie' => $this->input->post('module_theorie'), 'pratique' => $this->input->post('module_pratique')));
 }
コード例 #7
0
ファイル: Complexe.php プロジェクト: dermoumi/saget
 public function batch()
 {
     $ids = $this->input->post('check');
     $curr_etab_id = context_get('etab_id');
     if (!empty($ids) && $curr_etab_id) {
         $this->load->model('etablissement_model');
         $curr_etablissement = $this->etablissement_model->get($curr_etab_id);
         if (in_array($curr_etablissement->id_complexe, $ids)) {
             clear_context();
         }
     }
     parent::batch();
 }
コード例 #8
0
ファイル: template.php プロジェクト: boatsman80/ichado
function ichado1_preprocess_page(&$vars)
{
    $a = 'a';
    $cur_path = current_path();
    $cur_path_alias = drupal_get_path_alias($cur_path);
    $add_breadcrumb = drupal_get_title();
    if ($cur_path == 'front') {
        drupal_add_js(drupal_get_path('theme', 'ichado1') . '/js/vktarget.js');
    }
    if ($cur_path == 'cart' || preg_match('/^checkout\\/[\\d]+$/', $cur_path) || preg_match('/^checkout\\/[\\d]+\\/complete$/', $cur_path) || preg_match('/^checkout\\/[\\d]+\\/review$/', $cur_path) || preg_match('/^news$/', $cur_path) || preg_match('/^o-nas$/', $cur_path_alias) || preg_match('/^kontakty$/', $cur_path_alias) || preg_match('/^kak-zakazat-0$/', $cur_path_alias) || preg_match('/^oplata$/', $cur_path_alias) || preg_match('/^dostavka$/', $cur_path_alias) || preg_match('/^garantii-vozvrata$/', $cur_path_alias) || $cur_path == 'user/register' || $cur_path == 'user/login') {
        $vars['title'] = '';
    }
    if ($cur_path == 'cart' || preg_match('/^checkout\\/[\\d]+$/', $cur_path) || preg_match('/^checkout\\/[\\d]+\\/review$/', $cur_path) || variable_get('auto_scroll', FALSE) || $cur_path == 'catalog' && preg_match('/cart/', $_SERVER['HTTP_REFERER'])) {
        drupal_add_js(drupal_get_path('theme', 'ichado1') . '/js/auto-scroll.js', 'file');
        variable_set('auto_scroll', FALSE);
    }
    if (preg_match('/catalog/', $cur_path) || preg_match('/catalog/', $cur_path_alias)) {
        libraries_load('jcarousel');
    }
    $vars['catalog_menu_drop'] = '';
    $context_get = context_get('context');
    if ($context_get && in_array('for_drop_down_menu', array_keys($context_get))) {
        $block = module_invoke('superfish', 'block_view', 1);
        $catalog_menu_drop = render($block['content']);
        $vars['catalog_menu_drop'] = $catalog_menu_drop;
    }
    /*
    drupal_add_js('//cdn.callbackhunter.com/cbh.js?hunter_code=7ab9ebf48fe3227cd14cdb9ba43f2cd5',
        array(
            'type'       => 'external',
            'scope'      => 'footer',
            'every_page' => TRUE,
        ));
    */
}
コード例 #9
0
ファイル: Local_model.php プロジェクト: dermoumi/saget
 public function update($id)
 {
     $id_etab = context_get('etab_id');
     $id_annee = context_get('annee_id');
     return $this->db->replace('local', array('id' => $id, 'id_etablissement' => $id_etab, 'id_annee' => $id_annee, 'code' => $this->input->post('local_code'), 'type' => $this->input->post('local_type'), 'categorie' => $this->input->post('local_categorie')));
 }
コード例 #10
0
ファイル: Groupe_model.php プロジェクト: dermoumi/saget
 public function update($id)
 {
     return $this->db->replace('groupe', array('id' => $id, 'code' => $this->input->post('groupe_code'), 'id_e_s_filiere' => context_get('e_s_filiere_id'), 'annee' => $this->input->post('groupe_annee')));
 }
コード例 #11
0
ファイル: liste.php プロジェクト: dermoumi/saget
<?php

echo form_open('admin/local/batch');
?>
    <div class="list-header">
        <h2>Liste des locaux de l'établissement &laquo;<?php 
echo context_get("etab_libelle");
?>
&raquo; :</h2>
        <div class="operation-bar">
            <?php 
echo anchor('admin/local/create', 'Ajouter');
?>
            <?php 
echo form_submit('delete', 'Supprimmer la sélection');
?>
        </div>
    </div>
    <table class="item-list">
        <thead>
            <tr>
                <th></th>
                <th style="width: 34%;">Code</th>
                <th style="width: 33%;">Catégorie</th>
                <th style="width: 33%;">Type</th>
                <th></th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <?php 
コード例 #12
0
ファイル: Materiel_model.php プロジェクト: dermoumi/saget
 public function unassign_batch($ids)
 {
     $id_local = context_get('local_id');
     $id_annee = context_get('annee_id');
     return $this->db->where_in('id_materiel', $ids)->where(array('id_local' => $id_local, 'id_annee' => $id_annee))->delete('materiel_local');
 }
コード例 #13
0
ファイル: template.php プロジェクト: edwardpku/Atrium
/**
 * Preprocessor for theme_spaces_design().
 */
function ginkgo_preprocess_spaces_design(&$vars)
{
    if (module_exists('color') && !empty($vars['color'])) {
        if ($rgb = _color_unpack($vars['color'], TRUE)) {
            $classes = context_get('theme', 'body_classes');
            $classes .= ' color';
            context_set('theme', 'body_classes', $classes);
            $hsl = _color_rgb2hsl($rgb);
            if ($hsl[2] > 0.8) {
                $hsl[2] = 0.7;
                $rgb = _color_hsl2rgb($hsl);
            }
            // This code generates color values that are blended against
            // Black/White -- IT DOES NOT PRESERVE SATURATION.
            $modifiers = array('upshift' => $hsl[2] < 0.25 ? array('+', 0.1) : array('+', 0.25), 'downshift' => array('-', 0.38));
            foreach ($modifiers as $id => $modifier) {
                $color = $rgb;
                foreach ($rgb as $k => $v) {
                    switch ($modifier[0]) {
                        case '-':
                            $color[$k] = $color[$k] * (1 - $modifier[1]);
                            break;
                        default:
                            $color[$k] = $color[$k] + (1 - $color[$k]) * $modifier[1];
                            break;
                    }
                }
                $vars[$id] = _color_pack($color, TRUE);
            }
            $vars['color'] = _color_pack($rgb, TRUE);
        }
    }
}
コード例 #14
0
/**
 * Override or insert variables into the page templates.
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 * @param $hook
 *   The name of the template being rendered ("page" in this case.)
 */
function nys_preprocess_page(&$vars, $hook)
{
    if ($node = menu_get_object()) {
        $vars['node'] = $node;
    } else {
        $vars['node'] = FALSE;
    }
    // RANDOM BACKGROUND FOR HEADER - change second number in the rand() function to the amount of background images there are to rotate randomly through
    $random_number = mt_rand(1, 5);
    $vars['random_bg'] = 'bg-' . $random_number;
    $vars['senator'] = context_get('nyss', 'senator');
    $vars['senator_theme'] = '';
    if ($vars['senator']) {
        $vars['senator_analytics'] = nyss_senator_analytics($vars['senator']->nid);
        if ($vars['senator']->field_status[0]['value']) {
            drupal_set_message(nyss_senator_inactive_message($vars['senator']), 'status');
            $vars['messages'] .= theme('status_messages');
        }
        if ($vars['senator']->field_status[0]['value'] != 'former') {
            $vars['senator_theme'] = $vars['senator']->field_theme[0]['value'];
        } else {
            $vars['senator_theme'] = 'grey';
        }
        if ($vars['senator']->field_senators_district[0]['nid']) {
            $vars['district'] = node_load($vars['senator']->field_senators_district[0]['nid']);
        }
    }
    // CUSTOM SEARCH PAGE TITLE
    if (isset($vars['template_files'][1]) && $vars['template_files'][1] == 'page-search-nyss_search') {
        $vars['title'] = t('Senator Search: ');
        if ($vars['senator'] && $vars['senator']->title != '') {
            $vars['title'] .= $vars['senator']->title;
            $vars['instructions'] = '<p>' . t('You are searching for content by Senator !title. If you are looking for content by a different senator, search from within their page on !list.', array('!title' => $vars['senator']->title, '!list' => l(t('this list'), 'senators'))) . '</p>';
        } else {
            $vars['title'] .= t('No Senator Selected');
            $vars['instructions'] = '<p>' . t('You are searching for senator content, but have not selected a senator. Pick a senator from !list and search from within their page.', array('!list' => l(t('this list'), 'senators'))) . '</p>';
        }
    }
    // Build out the Party Affiliation tag, $party_affiliation_list, as seen in the Senator Header
    if ($vars['senator'] && is_array($vars['senator']->field_party_affiliation)) {
        $parties = array();
        foreach ($vars['senator']->field_party_affiliation as $party) {
            if ($party['value']) {
                $parties[] = $party['value'];
            }
        }
        $vars['party_affiliation_list'] = '(' . implode(', ', $parties) . ')';
    }
    // Create the main navigation menu.
    if ($vars['senator'] && count($vars['senator']->field_navigation)) {
        $vars['nyss_menu'] = nyss_senator_build_menu($vars['senator']);
    } else {
        // Render the default primary links using nice menu.
        $vars['nyss_menu'] = theme('nyss_misc_primary_menu');
    }
    $vars['nyss_footer_menu'] = theme('nyss_misc_footer_menu');
    // Build the Section Header variable based on arg() or node type for the page being viewed
    if ($vars['senator'] == FALSE && arg(0) == 'blog') {
        $vars['section_header'] = t('The New York Senate Blog');
    }
    if ($vars['senator'] == TRUE && (arg(2) == 'blog' || $vars['node'] && $vars['node']->type == 'blog')) {
        $vars['section_header'] = t('!title\'s Blog', array('!title' => $vars['senator']->title));
    }
    // Classes for body element. Allows advanced theming based on context
    // (home page, node of certain type, etc.)
    $body_classes = array($vars['body_classes']);
    if (!$vars['is_front']) {
        // Add unique classes for each page and website section
        $path = drupal_get_path_alias($_GET['q']);
        list($section, ) = explode('/', $path, 2);
        $body_classes[] = 'no-sidebars';
        $body_classes[] = zen_id_safe('page-' . $path);
        $body_classes[] = zen_id_safe('section-' . $section);
        if (arg(0) == 'node' && is_numeric(arg(1))) {
            $body_classes[] = 'full-node';
        }
        if (arg(0) != 'node') {
            $body_classes[] = 'not-node';
        }
        if (arg(0) == 'node') {
            if (arg(1) == 'add') {
                if ($section == 'node') {
                    array_pop($body_classes);
                    // Remove 'section-node'
                }
                $body_classes[] = 'section-node-add';
                // Add 'section-node-add'
            } elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) {
                if ($section == 'node') {
                    array_pop($body_classes);
                    // Remove 'section-node'
                }
                $body_classes[] = 'section-node-' . arg(2);
                // Add 'section-node-edit' or 'section-node-delete'
            }
        }
    }
    if (theme_get_setting('zen_wireframes')) {
        $body_classes[] = 'with-wireframes';
        // Optionally add the wireframes style.
    }
    if ($vars['senator'] == TRUE) {
        $body_classes[] = 'senator';
        // Class for a senator
        $vars['senator_name'] = l($vars['senator']->title . nyss_senator_status_for_title($vars['senator']), $vars['senator']->path);
    }
    if ($vars['senator'] == FALSE) {
        $body_classes[] = 'not-senator';
        // Class for a non-senator
    }
    if ($vars['senator'] == TRUE && arg(2) == 'blog') {
        $body_classes[] = 'senator_blog';
        // Class for a senator's blog
    }
    $vars['body_classes'] = implode(' ', $body_classes);
    // Concatenate with spaces
    if (!empty($vars['left_forms']) || !empty($vars['left'])) {
        $vars['body_classes'] = str_replace('no-sidebars', 'one-sidebar sidebar-left', $vars['body_classes']);
    }
}
コード例 #15
0
ファイル: liste.php プロジェクト: dermoumi/saget
<?php

echo form_open('admin/module/batch');
?>
    <div class="list-header">
        <h2>Liste des modules de la filière &laquo;<?php 
echo context_get('filiere_libelle');
?>
&raquo; :</h2>
        <div class="operation-bar">
            <?php 
echo anchor('admin/module/create', 'Ajouter');
?>
            <?php 
echo form_submit('delete', 'Supprimmer la sélection');
?>
        </div>
    </div>
    <table class="item-list">
        <thead>
            <tr>
                <th></th>
                <th>Code</th>
                <th style="width: 100%;">Libellé</th>
                <th>A1S1</th>
                <th>A1S2</th>
                <th>A2S1</th>
                <th>A2S2</th>
                <th>Théorie</th>
                <th>Pratique</th>
                <th></th>
コード例 #16
0
ファイル: ajouter.php プロジェクト: dermoumi/saget
<?php

$disable_keep = empty(context_get('annee_id'));
echo form_open('admin/annee/create');
?>
    <h3>Ajout d'année:</h3>

    <div class="errors"><?php 
echo validation_errors();
?>
</div>

    <div>
        <label for="annee_promotion">Année de promotion :</label>
        <input type="number" name="annee_promotion" value="<?php 
$current_entry->id;
?>
" id="annee_promotion"/>
    </div>

    <div <?php 
if ($disable_keep) {
    echo 'class="disabled"';
}
?>
>
        <label for="keep_personnel">
            <input type="checkbox" id="keep_personnel" name="keep_personnel" value="1" <?php 
if ($disable_keep) {
    echo 'disabled';
}
コード例 #17
0
ファイル: header.php プロジェクト: dermoumi/saget
<?php

$etab_libelle = context_get('etab_libelle');
$annee_libelle = context_get('annee_libelle');
$secteur_libelle = context_get('secteur_libelle');
$filiere_libelle = context_get('filiere_libelle');
?>
<!DOCTYPE html>
<html>
<head>
    <title>SAGET Administration</title>

    <link rel="stylesheet" type="text/css" href="<?php 
echo base_url('assets/stylesheets/select2.min.css');
?>
">
    <link rel="stylesheet" type="text/css" href="<?php 
echo base_url('assets/stylesheets/combobox.css');
?>
">
    <link rel="stylesheet" type="text/css" href="<?php 
echo base_url('assets/stylesheets/dash.css');
?>
">
    
    <script type="text/javascript" src="<?php 
echo base_url('assets/javascript/jquery-2.2.0.min.js');
?>
"></script>
    <script type="text/javascript" src="<?php 
echo base_url('assets/javascript/select2.js');
コード例 #18
0
ファイル: Filiere_model.php プロジェクト: dermoumi/saget
 public function unassign_batch($ids)
 {
     $id_etab_secteur = context_get('etab_secteur_id');
     return $this->db->where_in('id_filiere', $ids)->where(array('id_etab_secteur' => $id_etab_secteur))->delete('e_s_filiere');
 }
コード例 #19
0
ファイル: common_helper.php プロジェクト: dermoumi/saget
 function check_context_filiere($redirect_to = NULL)
 {
     if (context_get('filiere_id') && context_get('filiere_libelle') && context_get('e_s_filiere_id')) {
         return true;
     }
     if ($redirect_to == NULL) {
         $ci =& get_instance();
         $redirect_to = 'admin/' . $ci->router->fetch_class();
     }
     if (check_context_secteur('admin/utilisateur/contexte_filiere?redirect=' . $redirect_to)) {
         redirect('admin/utilisateur/contexte_filiere?redirect=' . $redirect_to);
     }
     return false;
 }
コード例 #20
0
ファイル: template.php プロジェクト: KyleAMathews/dewey
/**
 * Preprocessor for page.tpl.php template file.
 */
function dewey_preprocess_page(&$vars, $hook)
{
    global $user;
    $space = spaces_get_space();
    $context = context_get();
    $vars['space'] = $space;
    $vars['context'] = $context;
    // Replace screen/all stylesheets with print
    // We want a minimal print representation here for full control.
    if (isset($_GET['print'])) {
        $css = drupal_add_css();
        unset($css['all']);
        unset($css['screen']);
        $css['all'] = $css['print'];
        $vars['styles'] = drupal_get_css($css);
        // Add print header
        $vars['print_header'] = theme('print_header');
        // Replace all body classes
        $attr['class'] = 'print';
        // Use print template
        $vars['template_file'] = 'print-page';
        // Suppress devel output
        $GLOBALS['devel_shutdown'] = FALSE;
    }
    // If user is not a member of the group, add an "Join group" button.
    if (!empty($space) && $space->controllers->variable->space_type == "og" && !in_array($space->id, array_keys($user->og_groups))) {
        $add_group = array('add-group' => array('title' => t('Join group'), 'href' => 'og/subscribe/' . $space->id));
        $vars['context_links'] = theme('links', $add_group);
    }
    // If we're on on a user page or a group page, add an add group link.
    if (empty($vars['context_links']) && !in_array($space->controllers->variable->space_type, array('og', 'user')) && $user->uid != 0) {
        $add_group = array('add-group' => array('title' => t('Add Group'), 'href' => 'node/add/group'));
        $vars['context_links'] = theme('links', $add_group);
    }
    // If we're in the discussion context, add an add discussion link.
    if (empty($vars['context_links']) && isset($context['context']['spaces-feature-discussion'])) {
        $add_discussion = array('add-discussion' => array('title' => t('Add Discussion'), 'href' => 'node/add/story'));
        $vars['context_links'] = theme('links', $add_discussion);
    }
    // Path to theme
    $vars['path'] = base_path() . path_to_theme() . '/';
    // Create login or account page.
    list($user_picture, $user_picture_preset) = dewey_comment_user_picture($user->picture, $user->uid);
    $user_picture = "<div class='picture grid-1'>" . $user_picture . "</div>";
    $vars['user_picture'] = $user_picture;
    if ($user->uid) {
        $vars['user_account'] = $user_picture . " " . l($user->name, 'user') . "   " . l('logout', 'logout');
    } else {
        $vars['user_account'] = l('Login', 'user', array('attributes' => array('class' => 'user-account')));
    }
    $vars['user_account'] = "<span class='user-links'>" . $vars['user_account'] . "</span>";
    // Set title
    if ($space) {
        if (!empty($space->group->title)) {
            $vars['space_title'] = l(strtoupper($space->group->title), '<front>');
        }
    } else {
        $vars['space_title'] = $vars['title'];
    }
    // Create the menu item for the group settings tab for group admins.
    if (!empty($space) && $space->type == 'og') {
        $result = db_result(db_query("SELECT uid\n                        FROM {og_uid}\n                        WHERE is_admin = 1\n                        AND nid = %d\n                        AND uid = %d", $space->id, $user->uid));
        if ($result || $user->uid == 1) {
            $vars['space_settings'] = theme('group_settings_dropdown', $space);
        }
    }
    // Add custom breadcrumb.
    $active_menu = "";
    if (!empty($context['context'])) {
        $contexts = array_keys($context['context']);
        foreach ($contexts as $item) {
            if (preg_match('/spaces-feature.*/', $item, $matches)) {
                $active_menu = $context['context'][$item]->reactions['menu'];
            }
        }
    }
    $breadcrumb .= "<div id='breadcrumb'";
    $breadcrumb .= l("Home", base_path(), array('external' => true)) . " > ";
    if (isset($space->id)) {
        $breadcrumb .= l($space->group->title, "");
        if (!empty($active_menu)) {
            $breadcrumb .= " > " . l(capitalizeWords($active_menu), $active_menu);
        }
    } else {
        $breadcrumb = trim($breadcrumb, " >");
    }
    $breadcrumb .= "</div>";
    $vars['breadcrumb'] = $breadcrumb;
    $vars['meta'] = '';
    // SEO optimization, add in the node's teaser, or if on the homepage, the mission statement
    // as a description of the page that appears in search engines
    if ($vars['is_front'] && $vars['mission'] != '') {
        $vars['meta'] .= '<meta name="description" content="' . dewey_trim_text($vars['mission']) . '" />' . "\n";
    } else {
        if (isset($vars['node']->teaser) && $vars['node']->teaser != '') {
            $vars['meta'] .= '<meta name="description" content="' . dewey_trim_text($vars['node']->teaser) . '" />' . "\n";
        } else {
            if (isset($vars['node']->body) && $vars['node']->body != '') {
                $vars['meta'] .= '<meta name="description" content="' . dewey_trim_text($vars['node']->body) . '" />' . "\n";
            }
        }
    }
    // SEO optimization, if the node has tags, use these as keywords for the page
    if (isset($vars['node']->taxonomy)) {
        $keywords = array();
        foreach ($vars['node']->taxonomy as $term) {
            $keywords[] = $term->name;
        }
        $vars['meta'] .= '<meta name="keywords" content="' . implode(',', $keywords) . '" />' . "\n";
    }
    // SEO optimization, avoid duplicate titles in search indexes for pager pages
    if (isset($_GET['page']) || isset($_GET['sort'])) {
        $vars['meta'] .= '<meta name="robots" content="noindex,follow" />' . "\n";
    }
}
コード例 #21
0
/**
 * Preprocessor for theme_node().
 */
function ginkgo_capi_preprocess_node(&$vars)
{
    if (!empty($vars['terms'])) {
        $label = t('Tagged');
        $terms = "<div class='field terms clear-block'><span class='field-label-inline-first'>{$label}:</span> {$vars['terms']}</div>";
        $vars['content'] = $terms . $vars['content'];
    }
    $vars['title'] = check_plain($vars['node']->title);
    $vars['layout'] = FALSE;
    // Set the title overrides if this is a blog post
    if ($vars['node']->type == 'blog') {
        // _p($vars['node']);
    }
    // Set author public_blog url
    if (context_get('context', 'blog_listing_public')) {
        $vars['node_author_url'] = '/public/blog/' . $vars['node']->name . '';
        $vars['node_url'] = '/public/post/' . $vars['node']->nid;
        $new_links = array('author_url' => array('title' => '<a href="' . $vars['node_author_url'] . '">' . ucwords($vars['node']->name) . '\'s personal blog</a>', 'html' => 1));
        $vars['node']->links = array_merge((array) $new_links, (array) $vars['node']->links);
        // _p($vars['node']->links);
        // _p($vars);
        $vars['links'] = theme('links', $vars['node']->links);
    }
    // Add node-page class.
    $vars['attr']['class'] .= $vars['node'] === menu_get_object() ? ' node-page' : '';
    // Don't show the full node when a comment is being previewed.
    $vars = context_get('comment', 'preview') == TRUE ? array() : $vars;
    // Clear out catchall template file suggestions like those made by og.
    // TODO refactor
    if (!empty($vars['template_files'])) {
        foreach ($vars['template_files'] as $k => $f) {
            if (strpos($f, 'node-' . $vars['type']) === FALSE) {
                unset($vars['template_files'][$k]);
            }
        }
    }
}
コード例 #22
0
ファイル: liste.php プロジェクト: dermoumi/saget
<?php

echo form_open('admin/formateur/batch');
?>
    <div class="list-header">
        <h2>Liste des formateurs de l'établissement &laquo;<?php 
echo context_get('etab_libelle');
?>
&raquo; :</h2>
        <div class="operation-bar">
            <?php 
echo form_submit('unassign', 'Désattribuer la sélection');
?>
        </div>
    </div>
    <table class="item-list">
        <thead>
            <tr>
                <th></th>
                <th>Matricule</th>
                <th style="width: 50%;">Nom</th>
                <th style="width: 50%;">Prenom</th>
                <th>MH Annuelle</th>
                <th>Téléphone</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <?php 
foreach ($context_entry_list as $formateur) {
    ?>
コード例 #23
0
<?php

/* 
 * Pre-processing below is relevant to the UVic custom template. 
 *
 */
if (context_get('context', 'blog_listing_public')) {
    // _p(get_defined_vars());
    // _p($node_url, "node_url");
    // _p($node_author_url, "node_author_url");
    // // $node_url = 'public_blog/%';
    // _p($links, "links");
}
if (empty($hide)) {
    ?>

<?php 
    if (!empty($pre_object)) {
        print $pre_object;
    }
    ?>

<div <?php 
    if (!empty($attr)) {
        print drupal_attributes($attr);
    }
    ?>
>
  <?php 
    if (!empty($submitted)) {
        ?>
コード例 #24
0
ファイル: liste.php プロジェクト: dermoumi/saget
</option>
        <?php 
}
?>
    </select>
    <?php 
echo form_submit('changer_local', 'Confirmer');
?>
</form>
<?php 
if (context_get('local_id') && context_get('local_code')) {
    echo form_open('admin/materiel/batch');
    ?>
    <div class="list-header">
        <h2>Liste de materiel pour le local &laquo;<?php 
    echo context_get('local_code');
    ?>
&raquo; :</h2>
        <div class="operation-bar">
            <?php 
    echo form_submit('unassign', 'Désattribuer la sélection');
    ?>
        </div>
    </div>
    <table class="item-list">
        <thead>
            <tr>
                <th></th>
                <th>Code</th>
                <th style="width: 100%;">Désignation</th>
                <th>LV</th>
コード例 #25
0
ファイル: Secteur_model.php プロジェクト: dermoumi/saget
 public function unassign_batch($ids)
 {
     $id_etab = context_get('etab_id');
     $id_annee = context_get('annee_id');
     return $this->db->where_in('id_secteur', $ids)->where(array('id_etablissement' => $id_etab, 'id_annee' => $id_annee))->delete('etablissement_secteur');
 }
コード例 #26
0
ファイル: template.php プロジェクト: neontribe/Apps-for-good
/**
 * Preprocessor for theme_node().
 */
function ginkgo_preprocess_node(&$vars) {
  if (!empty($vars['terms'])) {
    $label = t('Tagged');
    $terms = "<div class='field terms clear-block'><span class='field-label-inline-first'>{$label}:</span> {$vars['terms']}</div>";
    $vars['content'] =  $terms . $vars['content'];
  }
  $vars['title'] = check_plain($vars['node']->title);
  $vars['layout'] = FALSE;

  // Add node-page class.
  $vars['attr']['class'] .= $vars['node'] === menu_get_object() ? ' node-page' : '';

  // Don't show the full node when a comment is being previewed.
  $vars = context_get('comment', 'preview') == TRUE ? array() : $vars;

  // Clear out catchall template file suggestions like those made by og.
  // TODO refactor
  if (!empty($vars['template_files'])) {
    foreach ($vars['template_files'] as $k => $f) {
      if (strpos($f, 'node-'.$vars['type']) === FALSE) {
        unset($vars['template_files'][$k]);
      }
    }
  }
}
コード例 #27
0
ファイル: liste.php プロジェクト: dermoumi/saget
                <tr class="list-element">
                    <td colspan="4" class="empty-entry">Rien à afficher</td>
                </tr>
            <?php 
}
?>
        </tbody>
    </table>
</form>

<?php 
echo form_open('admin/filiere/batch');
?>
    <div class="list-header">
        <h2>Liste des filières du secteur &laquo;<?php 
echo context_get('secteur_libelle');
?>
&raquo; :</h2>
        <div class="operation-bar">
            <?php 
echo anchor('admin/filiere/create', 'Ajouter');
?>
            <?php 
echo form_submit('assign', 'Attribuer la sélection');
?>
            <?php 
echo form_submit('delete', 'Supprimmer la sélection');
?>
        </div>
    </div>
    <table class="item-list">