1<?php
2
3
4/*
5 * Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
6 * $Id$
7 *
8 * System routing config
9 */
10
11
12class plugin_gallery_rewrite_url extends eUrlConfig
13{
14
15	public function config()
16	{
17		return array(
18
19			'config' => array(
20				'allowMain'    => true,
21				'format'       => 'path',
22				'defaultRoute' => 'index/category',
23
24				// false - disable all parameters passed to assemble method by default
25				'allowVars'    => array('cat', 'frm'),
26
27				// custom assemble/parse URL regex template
28				'varTemplates' => array('galleryCat' => '[\w\pL\s\-+.,]+'),
29			),
30
31			// rule set array
32			'rules'  => array(
33				'/'                  => 'index/category',
34				// allow only mapped vars - cat and frm parameters to be passed
35				'<cat:{galleryCat}>' => array('index/list', 'mapVars' => array('media_cat_sef' => 'cat', 'from' => 'frm')),
36			)
37		);
38	}
39
40	/**
41	 * Admin callback
42	 * Language file not loaded as all language data is inside the lan_eurl.php (loaded by default on administration URL page)
43	 */
44	public function admin()
45	{
46		// static may be used for performance - XXX LANS
47		static $admin = array(
48			'labels'    => array(
49				'name'        => LAN_PLUGIN_GALLERY_TITLE, // Module name
50				'label'       => LAN_PLUGIN_GALLERY_SEF_01, // Current profile name
51				'description' => LAN_PLUGIN_GALLERY_SEF_02,
52				'examples'    => array('{SITEURL}gallery/my-gallery-title'), //
53			),
54			'form'      => array(), // Under construction - additional configuration options
55			'callbacks' => array(), // Under construction - could be used for e.g. URL generator functionallity
56		);
57
58		return $admin;
59	}
60}
61