Exemplo n.º 1
0
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once 'pre.php';
require_once 'www/admin/admin_utils.php';
require_once '../include/utils.php';
require_once 'common/include/escapingUtils.php';
require_once 'common/trove/TroveCategory.class.php';
$categoryId = getIntFromGet('trove_cat_id');
$category = new TroveCategory($categoryId);
if ($category->isError()) {
    exit_error(_('ERROR'), $category->getErrorMessage());
}
$do = getStringFromRequest('do');
switch ($do) {
    case 'addTranslation':
        $label = new TroveCategoryLabel($category);
        $label->create(getStringFromPost('label'), getIntFromPost('language_id'));
        // TODO : gestion d'erreurs, affichage d'un flag
        break;
    case 'removeTranslation':
        $label = new TroveCategoryLabel($category, getIntFromRequest('label_id'));
        $label->remove();
        // TODO : gestion d'erreurs, affichage d'un flag
        break;
Exemplo n.º 2
0
require_once '../env.inc.php';
require_once 'pre.php';
require_once 'trove.php';
require_once 'common/include/escapingUtils.php';
require_once 'TroveCategory.class.php';
require_once 'TroveCategoryFactory.class.php';
require_once 'include/utils.php';
if (!$sys_use_trove) {
    exit_disabled();
}
$categoryId = getIntFromGet('form_cat');
// assign default if not defined
if (!$categoryId) {
    $categoryId = $default_trove_cat;
}
$category = new TroveCategory($categoryId);
$HTML->header(array('title' => _('Trove Map')));
echo '<hr />';
// We check current filtering directives and display them
$filter = getStringFromGet('discrim');
if ($filter) {
    // check and clean the array
    $filterArray = explode(',', $filter);
    $cleanArray = array();
    $count = max(6, sizeof($filterArray));
    for ($i = 0; $i < $count; $i++) {
        if (is_numeric($filterArray[$i]) && $filterArray[$i] != 0) {
            $cleanArray[] = (int) $filterArray[$i];
        }
    }
    $filterArray = array_unique($cleanArray);