forked from kangisworking/xe-module-newposts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewposts.model.php
More file actions
73 lines (67 loc) · 1.46 KB
/
newposts.model.php
File metadata and controls
73 lines (67 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/**
* vi:set sw=4 ts=4 noexpandtab fileencoding=utf8:
* @class newpostsModel
* @author NURIGO (Contact@nurigo.net)
* @brief newpostsModel
*/
class newpostsModel extends newposts
{
/**
* @brief constructor
*
*/
function init()
{
}
/**
* @brief get newposts module config
*
**/
function getModuleConfig()
{
if (!$GLOBALS['__newposts_config__'])
{
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('newposts');
$GLOBALS['__newposts_config__'] = $config;
}
return $GLOBALS['__newposts_config__'];
}
/**
* @brief get config list by module srl
*
**/
function getConfigListByModuleSrl($module_srl)
{
if (!$module_srl) return false;
$args = new stdClass();
$args->module_srl = $module_srl;
$output = executeQueryArray("newposts.getConfigByModuleSrl", $args);
if (!$output->toBool() || !$output->data) return false;
$config_list = $output->data;
foreach($config_list as $key=>$val)
{
$extra_vars = unserialize($val->extra_vars);
if ($extra_vars)
{
foreach ($extra_vars as $key2 => $val2)
{
$config_list[$key]->{$key2} = $val2;
}
}
}
return $config_list;
}
/**
* @brief get registered sender ids
*/
function getRegisteredSenderIds()
{
$oTextmessageModel = &getModel('textmessage');
$result = $oTextmessageModel->getSenderNumbers();
return $result;
}
}
/* End of file newposts.model.php */
/* Location: ./modules/newposts/newposts.model.php */