InDefero

Sign in or create your account | Project List | Help

InDefero Git Source Tree

Root/src/IDF/Form/TabsConf.php

Source at commit 7383e18dff19e7e6a1e56d55cdfbfa109e91bfb3 created 2 years 1 month ago.
By Loic d'Anterroches, Fixed issue 4, with fine control over the tabs access.
1<?php
2/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3/*
4# ***** BEGIN LICENSE BLOCK *****
5# This file is part of InDefero, an open source project management application.
6# Copyright (C) 2008 Céondo Ltd and contributors.
7#
8# InDefero is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12#
13# InDefero is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program; if not, write to the Free Software
20# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21#
22# ***** END LICENSE BLOCK ***** */
23
24
25/**
26 * Configuration of the tabs access.
27 */
28class IDF_Form_TabsConf extends Pluf_Form
29{
30    public $conf = null;
31    public function initFields($extra=array())
32    {
33        $this->conf = $extra['conf'];
34        $ak = array('downloads_access_rights' => __('Downloads'),
35                    'source_access_rights' => __('Source'),
36                    'issues_access_rights' => __('Issues'),);
37        foreach ($ak as $key=>$label) {
38            $this->fields[$key] = new Pluf_Form_Field_Varchar(
39                                      array('required' => true,
40                                            'label' => $label,
41                                            'initial' => $this->conf->getVal($key, 'all'),
42                                            'widget_attrs' => array('choices' =>
43                                          array(
44                                                __('Open to all') => 'all',
45                                                __('Signed in users') => 'login',
46                                                __('Project members') => 'members',
47                                                __('Project owners') => 'owners',
48                                                __('Closed') => 'none',
49                                                )
50                                                                    ),
51                                            'widget' => 'Pluf_Form_Widget_SelectInput',
52                                            ));
53        }
54    }
55}
56
57
58

Archive Download this file

Branches:
dev
develop
master
newdiff
svn

Tags:
v1.0