1: <?php
2:
3: if (!defined('XOOPS_ROOT_PATH')) exit();
4:
5: require_once XOOPS_MODULE_PATH . "/legacyRender/class/AbstractFilterForm.class.php";
6:
7: define('TPLFILE_SORT_KEY_TPL_ID', 1);
8: define('TPLFILE_SORT_KEY_TPL_REFID', 2);
9: define('TPLFILE_SORT_KEY_TPL_MODULE', 3);
10: define('TPLFILE_SORT_KEY_TPL_TPLSET', 4);
11: define('TPLFILE_SORT_KEY_TPL_FILE', 5);
12: define('TPLFILE_SORT_KEY_TPL_DESC', 6);
13: define('TPLFILE_SORT_KEY_TPL_LASTMODIFIED', 7);
14: define('TPLFILE_SORT_KEY_TPL_LASTIMPORTED', 8);
15: define('TPLFILE_SORT_KEY_TPL_TYPE', 9);
16: define('TPLFILE_SORT_KEY_MAXVALUE', 9);
17:
18: define('TPLFILE_SORT_KEY_DEFAULT', TPLFILE_SORT_KEY_TPL_FILE);
19:
20: class LegacyRender_TplfileFilterForm extends LegacyRender_AbstractFilterForm
21: {
22: var $mSortKeys = array(
23: TPLFILE_SORT_KEY_TPL_ID => 'tpl_id',
24: TPLFILE_SORT_KEY_TPL_REFID => 'tpl_refid',
25: TPLFILE_SORT_KEY_TPL_MODULE => 'tpl_module',
26: TPLFILE_SORT_KEY_TPL_TPLSET => 'tpl_tplset',
27: TPLFILE_SORT_KEY_TPL_FILE => 'tpl_file',
28: TPLFILE_SORT_KEY_TPL_DESC => 'tpl_desc',
29: TPLFILE_SORT_KEY_TPL_LASTMODIFIED => 'tpl_lastmodified',
30: TPLFILE_SORT_KEY_TPL_LASTIMPORTED => 'tpl_lastimported',
31: TPLFILE_SORT_KEY_TPL_TYPE => 'tpl_type'
32: );
33:
34: var $mTplset = null;
35: var $mModule = null;
36:
37: function getDefaultSortKey()
38: {
39: return TPLFILE_SORT_KEY_DEFAULT;
40: }
41:
42: function fetch()
43: {
44: parent::fetch();
45: $this->additionalFetch();
46: }
47:
48: function additionalFetch()
49: {
50: if (isset($_REQUEST['tpl_module'])) {
51: $this->mNavi->addExtra('tpl_module', xoops_getrequest('tpl_module'));
52: $this->_mCriteria->add(new Criteria('tpl_module', array(XOBJ_DTYPE_STRING, xoops_getrequest('tpl_module'))));
53:
54: $handler =& xoops_gethandler('module');
55: $this->mModule =& $handler->getByDirname(xoops_getrequest('tpl_module'));
56: }
57:
58: if (isset($_REQUEST['tpl_type'])) {
59: $this->mNavi->addExtra('tpl_type', xoops_getrequest('tpl_type'));
60: $this->_mCriteria->add(new Criteria('tpl_type', array(XOBJ_DTYPE_STRING, xoops_getrequest('tpl_type'))));
61: }
62:
63: if (isset($_REQUEST['tpl_file'])) {
64: $this->mNavi->addExtra('tpl_file', xoops_getrequest('tpl_file'));
65: $this->_mCriteria->add(new Criteria('tpl_file', '%' . xoops_getrequest('tpl_file') . '%', 'LIKE'));
66: }
67:
68: $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
69: }
70: }
71:
72: ?>
73: