示例#1
0
文件: fn.php 项目: yrahman/playSMS
function flatly_hook_themes_apply($content)
{
    global $core_config, $user_config;
    $tpl = array('name' => 'themes_layout', 'vars' => array('CONTENT' => $content, 'HTTP_PATH_BASE' => $core_config['http_path']['base'], 'HTTP_PATH_THEMES' => $core_config['http_path']['themes'], 'THEMES_MODULE' => core_themes_get(), 'THEMES_MENU_TREE' => themes_get_menu_tree(), 'THEMES_SUBMENU' => themes_submenu(), 'CREDIT_SHOW_URL' => _u('index.php?app=ws&op=credit'), 'NAME' => $user_config['name'], 'USERNAME' => $user_config['username'], 'GRAVATAR' => $user_config['opt']['gravatar'], 'LAYOUT_FOOTER' => $core_config['main']['layout_footer'], 'Logout' => _('Logout')), 'ifs' => array('valid' => auth_isvalid()));
    $content = tpl_apply($tpl, array('core_config', 'user_config'));
    return $content;
}
示例#2
0
function play_hook_themes_apply($content)
{
    global $core_config, $web_title, $themes_default_charset, $theme_play_foot1, $theme_play_head1, $theme_play_head2, $theme_image;
    unset($tpl);
    $tpl = array('name' => 'themes_layout', 'var' => array('CONTENT' => $content, 'WEB_TITLE' => $web_title, 'THEMES_DEFAULT_CHARSET' => $themes_default_charset, 'HTTP_PATH_BASE' => $core_config['http_path']['base'], 'HTTP_PATH_THEMES' => $core_config['http_path']['themes'], 'THEMES_MODULE' => core_themes_get(), 'THEMES_MENU_TREE' => themes_get_menu_tree(), 'THEMES_BUILD_MENU' => theme_play_build_menu(), 'THEMES_PLAY_FOOT1' => $theme_play_foot1, 'THEMES_PLAY_HEAD1' => $theme_play_head1, 'THEMES_PLAY_HEAD2' => $theme_play_head2, 'NAME' => $core_config['user']['name'], 'USERNAME' => $core_config['user']['username'], 'GRAVATAR' => $core_config['user']['opt']['gravatar'], 'Home' => _('Home'), 'Logged in' => _('Logged in'), 'Logout' => _('Logout')), 'if' => array('theme_image' => !empty($theme_image) ? TRUE : FALSE, 'valid' => valid()));
    $content = tpl_apply($tpl);
    return $content;
}
示例#3
0
文件: fn.php 项目: 10corp/playSMS
function common_hook_themes_apply($content)
{
    global $core_config, $user_config;
    $themes_lang = strtolower(substr($user_config['language_module'], 0, 2));
    if ($themes_layout = trim($_REQUEST['_themes_layout_'])) {
        $themes_layout = 'themes_layout_' . $themes_layout;
    } else {
        $themes_layout = 'themes_layout';
    }
    $tpl = array('name' => $themes_layout, 'vars' => array('CONTENT' => $content, 'HTTP_PATH_BASE' => $core_config['http_path']['base'], 'HTTP_PATH_THEMES' => $core_config['http_path']['themes'], 'THEMES_MODULE' => core_themes_get(), 'THEMES_MENU_TREE' => themes_get_menu_tree(), 'THEMES_SUBMENU' => themes_submenu(), 'THEMES_LANG' => $themes_lang ? $themes_lang : 'en', 'CREDIT_SHOW_URL' => _u('index.php?app=ws&op=credit'), 'NAME' => $user_config['name'], 'USERNAME' => $user_config['username'], 'GRAVATAR' => $user_config['opt']['gravatar'], 'LAYOUT_FOOTER' => $core_config['main']['layout_footer'], 'Logout' => _('Logout')), 'ifs' => array('valid' => auth_isvalid()));
    $content = tpl_apply($tpl, array('core_config', 'user_config'));
    return $content;
}
示例#4
0
文件: fn.php 项目: 10corp/playSMS
function pluginmanager_get_status($plugin_category, $name)
{
    if ($plugin_category == "themes") {
        if (core_themes_get() == $name) {
            $ret = TRUE;
        } else {
            $ret = FALSE;
        }
    } else {
        if ($plugin_category == "language") {
            if (core_lang_get() == $name) {
                $ret = TRUE;
            } else {
                $ret = FALSE;
            }
        } else {
            $ret = TRUE;
        }
    }
    return $ret;
}
示例#5
0
文件: fn.php 项目: 10corp/playSMS
/**
 * Apply template
 * 
 * @param array $tpl
 *        	Template array
 * @param array $injected
 *        	Injected variable names
 * @return string Manipulated content
 */
function tpl_apply($tpl, $injected = array())
{
    $content = '';
    $continue = FALSE;
    if (is_array($tpl)) {
        if ($tpl_name = _tpl_name_sanitize($tpl['name'])) {
            $continue = TRUE;
        }
    }
    if ($continue) {
        // inject anti-CSRF hidden field
        $tpl['vars']['CSRF_FORM'] = _CSRF_FORM_;
        // inject global variables
        if (is_array($tpl['injects']) && !$injected) {
            $injected = $tpl['injects'];
        }
        // check from active template
        $themes = core_themes_get();
        $fn = _APPS_PATH_THEMES_ . '/' . $themes . '/templates/' . $tpl_name . '.html';
        if (file_exists($fn)) {
            $content = _tpl_apply($fn, $tpl, $injected);
            return $content;
        }
        // check from common place on themes
        $fn = _APPS_PATH_TPL_ . '/' . $tpl_name . '.html';
        if (file_exists($fn)) {
            $content = _tpl_apply($fn, $tpl, $injected);
        }
        // check from active plugin
        $c_inc = explode('_', _INC_);
        $plugin_category = $c_inc[0];
        $plugin_name = str_replace($plugin_category . '_', '', _INC_);
        $fn = _APPS_PATH_PLUG_ . '/' . $plugin_category . '/' . $plugin_name . '/templates/' . $tpl_name . '.html';
        if (file_exists($fn)) {
            $content = _tpl_apply($fn, $tpl, $injected);
            return $content;
        }
    }
    return $content;
}
示例#6
0
function playsmsd_once($param)
{
    // plugin feature
    core_call_hook();
    // plugin gateway
    core_hook(core_gateway_get(), 'playsmsd_once', array($param));
    // plugin themes
    core_hook(core_themes_get(), 'playsmsd_once', array($param));
}
示例#7
0
     // select enable_credit_unicode
     $option_enable_credit_unicode = _options(array(_('yes') => 1, _('no') => 0), $main_config['enable_credit_unicode']);
     // select brute_force_detection
     $option_brute_force_detection = _options(array(_('yes') => 1, _('no') => 0), $main_config['brute_force_detection']);
     // display
     $tpl = array('name' => 'main_config', 'vars' => array('DIALOG_DISPLAY' => _dialog(), 'ACTION_URL' => _u('index.php?app=main&inc=core_main_config&op=main_config_save'), 'Main configuration' => _('Main configuration'), 'Default settings' => _('Default settings'), 'Default site configuration' => _('Default site configuration'), 'Information page' => _('Information page'), 'Buy credit page' => _('Buy credit page'), 'Page title' => _('Page title'), 'Page content' => _('Page content'), 'Website URL' => _('Website URL'), 'Website title' => _('Website title'), 'Website email' => _('Website email'), 'Forwarded email footer' => _('Forwarded email footer'), 'Main website name' => _('Main website name'), 'Main website URL' => _('Main website URL'), 'Default sender ID' => _('Default sender ID'), 'Default timezone' => _('Default timezone'), 'Maximum username length' => _('Maximum username length'), 'Default SMS rate' => _('Default SMS rate'), 'Maximum SMS count' => _('Maximum SMS count'), 'Always remove plus sign' => _('Always remove plus sign'), 'Always add plus sign' => _('Always add plus sign'), 'Enable credit unicode SMS as normal SMS' => _('Enable credit unicode SMS as normal SMS'), 'Enable login brute force detection' => _('Enable login brute force detection'), 'Keyword separator' => _('Keyword separator'), 'Lowest credit limit to trigger notification' => _('Lowest credit limit to trigger notification'), 'Number of sent SMS per hour limit' => _('Number of sent SMS per hour limit'), 'Enable public registration' => _('Enable public registration'), 'Enable forgot password' => _('Enable forgot password'), 'Disable login as subuser' => _('Disable login as subuser'), 'Enhance privacy for subusers' => _('Enhance privacy for subusers'), 'Enable logo' => _('Enable logo'), 'Logo URL' => _('Logo URL'), 'Replace website title with logo' => _('Replace website title with logo'), 'Default SMSC' => _('Default SMSC'), 'Default prefix or country code' => _('Default prefix or country code'), 'Active themes' => _('Active themes'), 'Default language' => _('Default language'), 'Default account status upon registration' => _('Default account status upon registration'), 'Default parent upon registration' => _('Default parent upon registration'), 'Default ACL upon registration' => _('Default ACL upon registration'), 'Default credit upon registration' => _('Default credit upon registration'), 'Layout footer' => _('Layout footer'), 'Save' => _('Save'), 'HTTP_PATH_THEMES' => $core_config['http_path']['themes'], 'lang' => substr($user_config['language_module'], 0, 2), 'HINT_SENDER_ID' => _hint(_('Empty default sender ID to allow users setting their own sender ID')), 'HINT_TIMEZONE' => _hint(_('Eg: +0700 for Jakarta/Bangkok timezone')), 'HINT_ENABLE_LOGO' => _hint(_('Logo by default will be displayed at login, register and forgot password page')), 'HINT_WEBSITE_URL' => _hint(_('Access to unknown domain mapped to this server IP address will be redirected to this website URL. This website URL should be the primary address for the service.')), 'HINT_CUSTOM_SENDER_ID' => _hint(_('Allow users to select sender ID while on Send SMS page')), 'HINT_CUSTOM_FOOTER' => _hint(_('Allow users to select SMS footer while on Send SMS page')), 'HINT_SMS_LIMIT_PER_HOUR' => _hint(_('Fill with zero to disable limit')), 'HINT_DEFAULT_PARENT' => _hint(_('Default parent selected upon registration when the default account status on registration setting set to Subuser')), 'HINT_DEFAULT_ACL' => _hint(_('ACL DEFAULT will not restrict access to menus')), 'HINT_USERNAME_LENGTH' => _hint(_('Maximum username length must be a number between 4 to 100')), 'HINT_REPLACE_ZERO' => _hint(_('Default prefix or country code to replace prefix 0 on destination number')), 'HINT_CREDIT_LOWEST_LIMIT' => _hint(_('Set credit value bigger than 0 to set credit lowest limit that will trigger notification')), 'HINT_KEYWORD_SEPARATOR' => _hint(_('Define a single character as keyword separator replacing default keyword separator a space')), 'web_title' => $main_config['web_title'], 'email_service' => $main_config['email_service'], 'email_footer' => $main_config['email_footer'], 'main_website_name' => $main_config['main_website_name'], 'main_website_url' => $main_config['main_website_url'], 'gateway_number' => $main_config['gateway_number'], 'gateway_timezone' => $main_config['gateway_timezone'], 'username_length' => $main_config['username_length'] >= 3 && $main_config['username_length'] <= 100 ? $main_config['username_length'] : 30, 'default_rate' => $main_config['default_rate'], 'sms_max_count' => $main_config['sms_max_count'], 'credit_lowest_limit' => (double) $main_config['credit_lowest_limit'], 'sms_limit_per_hour' => (int) $main_config['sms_limit_per_hour'], 'default_replace_zero' => $main_config['default_replace_zero'], 'default_credit' => (double) $main_config['default_credit'], 'keyword_separator' => substr($main_config['keyword_separator'], 0, 1), 'logo_url' => $main_config['logo_url'], 'layout_footer' => $main_config['layout_footer'], 'information_title' => $main_config['information_title'], 'information_content' => $main_config['information_content'], 'option_default_user_status' => $option_default_user_status, 'option_default_parent' => $option_default_parent, 'option_default_acl' => $option_default_acl, 'option_enable_logo' => $option_enable_logo, 'option_logo_replace_title' => $option_logo_replace_title, 'option_enable_register' => $option_enable_register, 'option_enable_forgot' => $option_enable_forgot, 'option_disable_login_as' => $option_disable_login_as, 'option_enhance_privacy_subuser' => $option_enhance_privacy_subuser, 'option_gateway_module' => $option_gateway_module, 'option_themes_module' => $option_themes_module, 'option_language_module' => $option_language_module, 'option_plus_sign_remove' => $option_plus_sign_remove, 'option_plus_sign_add' => $option_plus_sign_add, 'option_enable_credit_unicode' => $option_enable_credit_unicode, 'option_brute_force_detection' => $option_brute_force_detection), 'injects' => array('core_config'));
     _p(tpl_apply($tpl));
     break;
 case "main_config_save":
     // logo
     $enable_logo = $_POST['edit_enable_logo'];
     $logo_url = trim($_POST['edit_logo_url']);
     $logo_replace_title = $_POST['edit_logo_replace_title'];
     if (!$logo_url) {
         $themes_logo = _APPS_PATH_THEMES_ . '/' . core_themes_get() . '/images/logo.png';
         $themes_logo_url = _HTTP_PATH_THEMES_ . '/' . core_themes_get() . '/images/logo.png';
         $default_logo = _APPS_PATH_THEMES_ . '/common/images/logo.png';
         $default_logo_url = _HTTP_PATH_THEMES_ . '/common/images/logo.png';
         $logo_url = file_exists($themes_logo) ? $themes_logo_url : $default_logo_url;
         // force to disable logo when neither themes_logo or default_logo exists
         if (!file_exists($default_logo)) {
             $logo_url = '';
             $enable_logo = 0;
         }
     }
     // disable logo_replace_title when logo disabled
     if (!$enable_logo) {
         $logo_replace_title = 0;
     }
     // allow default account status 3 and 4 only
     $edit_default_user_status = (int) $_POST['edit_default_user_status'];
示例#8
0
        if ($main_key && $main_val) {
            $core_config['main'][$main_key] = $main_val;
        }
    }
}
// themes icons overrides
$icons = $themes_config[core_themes_get()]['icon'];
if (is_array($icons)) {
    foreach ($icons as $icon_action => $icon_url) {
        if ($icon_action && $icon_url) {
            $icon_config[$icon_action] = $icon_url;
        }
    }
}
// themes menus overrides
$menus = $themes_config[core_themes_get()]['menu'];
if (is_array($menus)) {
    foreach ($menus as $menu_menutab => $menu_item) {
        unset($menu_config[$menu_menutab]);
    }
    foreach ($menus as $menu_menutab => $menu_item) {
        if ($menu_menutab && $menu_item) {
            $menu_config[$menu_menutab] = $menu_item;
        }
    }
}
// fixme anton - debug
//print_r($icon_config); die();
//print_r($menu_config); die();
//print_r($plugin_config); die();
//print_r($themes_config); die();
示例#9
0
文件: index.php 项目: 10corp/playSMS
            }
            break;
        case 'call':
            // _APP_=call to access subroutine in a plugin
            // can be used to replace callback.php in clickatell or dlr.php and geturl.php in kannel
            if (_CAT_ && _PLUGIN_) {
                core_hook(_PLUGIN_, 'call', array($_REQUEST));
            }
            break;
        case 'page':
            // _APP_=page to access a page inside themes
            // by default this is used for displaying 'forgot password' page and 'register an account' page
            // login, logout, register, forgot password, noaccess
            logger_audit();
            if (_INC_) {
                $fn = $core_config['apps_path']['themes'] . '/' . core_themes_get() . '/page_' . _INC_ . '.php';
                if (file_exists($fn)) {
                    include $fn;
                } else {
                    $fn = $core_config['apps_path']['themes'] . '/common/page_' . _INC_ . '.php';
                    if (file_exists($fn)) {
                        include $fn;
                    }
                }
            }
    }
} else {
    // no _APP_ then load default page
    if (auth_isvalid()) {
        $query_string = '';
        if ($core_config['main']['default_inc']) {
示例#10
0
文件: fn.php 项目: yrahman/playSMS
/**
 * Generate HTML input tag
 * @param  string $type        Input type
 * @param  string $name        Input name
 * @param  string $value       Input default value
 * @param  array  $tag_params  Additional input tag parameters
 * @param  string $css_id      CSS ID
 * @param  string $css_class   CSS class name
 * @return string              HTML input tag
 */
function themes_input($type = 'text', $name = '', $value = '', $tag_params = array(), $css_id = '', $css_class = '')
{
    $ret = '';
    if (core_themes_get()) {
        $ret = core_hook(core_themes_get(), 'themes_input', array($type, $name, $value, $tag_params, $css_id, $css_class));
    }
    if (!$ret) {
        if (is_array($tag_params)) {
            foreach ($tag_params as $key => $val) {
                $params .= ' ' . $key . '="' . $val . '"';
            }
        }
        $ret = '<input type="' . $type . '" name="' . $name . '" value="' . $value . '" id="' . $css_id . '" class="playsms-input ' . $css_class . '" ' . $params . '>';
    }
    return $ret;
}
示例#11
0
/**
 * This file is part of playSMS.
 *
 * playSMS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * playSMS 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 playSMS. If not, see <http://www.gnu.org/licenses/>.
 */
defined('_SECURE_') or die('Forbidden');
if (!auth_isvalid()) {
    auth_block();
}
$fn = _APPS_PATH_THEMES_ . '/' . core_themes_get() . '/welcome.php';
if (file_exists($fn)) {
    include $fn;
} else {
    $information_title = $core_config['main']['information_title'] ? $core_config['main']['information_title'] : _('Welcome information');
    $information_content = $core_config['main']['information_content'] ? $core_config['main']['information_content'] : _('Go to manage site menu to edit this page');
    list($information_title, $information_content) = core_display_html(array($information_title, $information_content));
    $tpl = array('name' => 'welcome', 'vars' => array('INFORMATION_TITLE' => htmlspecialchars_decode($information_title), 'INFORMATION_CONTENT' => htmlspecialchars_decode($information_content)), 'injects' => array('user_config'));
    $tpl['vars'][$doc . '_ACTIVE'] = 'class=active';
    _p(tpl_apply($tpl));
}
示例#12
0
文件: main.php 项目: yrahman/playSMS
defined('_SECURE_') or die('Forbidden');
$continue = TRUE;
if (function_exists('bindtextdomain')) {
    bindtextdomain('messages', _APPS_PATH_PLUG_ . '/language/');
    bind_textdomain_codeset('messages', 'UTF-8');
    textdomain('messages');
}
// load plugin
if ($continue && _INC_) {
    $p = explode('_', _INC_, 2);
    $plugin_category = $p[0];
    $plugin_name = $p[1];
    $plugin_dir = _APPS_PATH_PLUG_ . '/' . $plugin_category . '/' . $plugin_name;
    $file_name = _ROUTE_ ? _ROUTE_ . '.php' : $plugin_name . '.php';
    $plugin_file = $plugin_dir . '/' . $file_name;
    if (file_exists($plugin_file)) {
        if (function_exists('bindtextdomain')) {
            bindtextdomain('messages', $plugin_dir . '/language/');
            bind_textdomain_codeset('messages', 'UTF-8');
            textdomain('messages');
        }
        include_once $plugin_file;
    }
}
if (function_exists('bindtextdomain')) {
    bindtextdomain('messages', _APPS_PATH_THEMES_ . '/' . core_themes_get() . '/language/');
    bind_textdomain_codeset('messages', 'UTF-8');
    textdomain('messages');
}
$content = ob_get_clean();
_p(themes_apply($content));
示例#13
0
文件: init.php 项目: 10corp/playSMS
<?php

defined('_SECURE_') or die('Forbidden');
include $core_config['apps_path']['themes'] . "/" . core_themes_get() . "/config.php";
include $core_config['apps_path']['themes'] . "/" . core_themes_get() . "/fn.php";
示例#14
0
function webservices_output($operation, $requests, $returns)
{
    global $core_config;
    // default returns
    $returns = array('modified' => TRUE, 'param' => array('operation' => $operation, 'content' => '', 'content-type' => 'text/json', 'charset' => 'utf-8'));
    // plugin feature
    for ($c = 0; $c < count($core_config['plugins']['list']['feature']); $c++) {
        if ($ret_intercept = core_hook($core_config['plugins']['list']['feature'][$c], 'webservices_output', array($operation, $requests, $returns))) {
            if ($ret_intercept['modified']) {
                $returns['modified'] = TRUE;
                $returns['param']['operation'] = $ret_intercept['param']['operation'] ? $ret_intercept['param']['operation'] : $returns['param']['operation'];
                $returns['param']['content'] = $ret_intercept['param']['content'] ? $ret_intercept['param']['content'] : $returns['param']['content'];
                $returns['param']['content-type'] = $ret_intercept['param']['content-type'] ? $ret_intercept['param']['content-type'] : $returns['param']['content-type'];
                $returns['param']['charset'] = $ret_intercept['param']['charset'] ? $ret_intercept['param']['charset'] : $returns['param']['charset'];
            }
        }
    }
    // plugin gateway
    $smscs = gateway_getall_smsc_names();
    foreach ($smscs as $smsc) {
        $smsc_data = gateway_get_smscbyname($smsc);
        $gateways[] = $smsc_data['gateway'];
    }
    if (is_array($gateways)) {
        $gateways = array_unique($gateways);
        foreach ($gateways as $gateway) {
            if ($ret_intercept = core_hook($gateway, 'webservices_output', array($operation, $requests, $returns))) {
                if ($ret_intercept['modified']) {
                    $returns['modified'] = TRUE;
                    $returns['param']['operation'] = $ret_intercept['param']['operation'] ? $ret_intercept['param']['operation'] : $returns['param']['operation'];
                    $returns['param']['content'] = $ret_intercept['param']['content'] ? $ret_intercept['param']['content'] : $returns['param']['content'];
                    $returns['param']['content-type'] = $ret_intercept['param']['content-type'] ? $ret_intercept['param']['content-type'] : $returns['param']['content-type'];
                    $returns['param']['charset'] = $ret_intercept['param']['charset'] ? $ret_intercept['param']['charset'] : $returns['param']['charset'];
                }
            }
        }
    }
    // plugin themes
    if ($ret_intercept = core_hook(core_themes_get(), 'webservices_output', array($operation, $requests, $returns))) {
        if ($ret_intercept['modified']) {
            $returns['modified'] = TRUE;
            $returns['param']['operation'] = $ret_intercept['param']['operation'] ? $ret_intercept['param']['operation'] : $returns['param']['operation'];
            $returns['param']['content'] = $ret_intercept['param']['content'] ? $ret_intercept['param']['content'] : $returns['param']['content'];
            $returns['param']['content-type'] = $ret_intercept['param']['content-type'] ? $ret_intercept['param']['content-type'] : $returns['param']['content-type'];
            $returns['param']['charset'] = $ret_intercept['param']['charset'] ? $ret_intercept['param']['charset'] : $returns['param']['charset'];
        }
    }
    return $returns;
}
示例#15
0
function playsmsd_once($param)
{
    // plugin feature
    core_call_hook();
    // plugin gateway
    $smscs = gateway_getall_smsc_names();
    foreach ($smscs as $smsc) {
        $smsc_data = gateway_get_smscbyname($smsc);
        $gateways[] = $smsc_data['gateway'];
    }
    if (is_array($gateways)) {
        $gateways = array_unique($gateways);
        foreach ($gateways as $gateway) {
            core_hook($gateway, 'playsmsd_once', array($param));
        }
    }
    // plugin themes
    core_hook(core_themes_get(), 'playsmsd_once', array($param));
}
示例#16
0
文件: index.php 项目: yrahman/playSMS
                    bind_textdomain_codeset('messages', 'UTF-8');
                    textdomain('messages');
                }
                core_hook(_PLUGIN_, 'call', array($_REQUEST));
            }
            break;
        case 'page':
            // _APP_=page to access a page inside themes
            // by default this is used for displaying 'forgot password' page and 'register an account' page
            // login, logout, register, forgot password, noaccess
            logger_audit();
            if (_INC_) {
                $fn = $core_config['apps_path']['themes'] . '/' . core_themes_get() . '/page_' . _INC_ . '.php';
                if (file_exists($fn)) {
                    if (function_exists('bindtextdomain')) {
                        bindtextdomain('messages', $core_config['apps_path']['themes'] . '/' . core_themes_get() . '/language/');
                        bind_textdomain_codeset('messages', 'UTF-8');
                        textdomain('messages');
                    }
                    include $fn;
                } else {
                    $fn = $core_config['apps_path']['themes'] . '/common/page_' . _INC_ . '.php';
                    if (file_exists($fn)) {
                        include $fn;
                    }
                }
            }
    }
} else {
    // no _APP_ then load default page
    if (auth_isvalid()) {
示例#17
0
文件: config.php 项目: 10corp/playSMS
<?php

/**
 * This file is part of playSMS.
 *
 * playSMS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * playSMS 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 playSMS. If not, see <http://www.gnu.org/licenses/>.
 */
defined('_SECURE_') or die('Forbidden');
// insert to left menu array
$menutab = $core_config['menutab']['features'];
$menu_config[$menutab][] = array("index.php?app=main&inc=feature_sms_subscribe&op=sms_subscribe_list", _('Manage subscribe'));
$subscribe_icon_add_message = "<img src=\"" . $core_config['http_path']['themes'] . "/" . core_themes_get() . "/images/edit_action.gif\" alt=\"" . _('Add message') . "\" title=\"" . _('Add message') . "\" border=0>";
$subscribe_icon_view_members = "<img src=\"" . $core_config['http_path']['themes'] . "/" . core_themes_get() . "/images/view_action.gif\" alt=\"" . _('View members') . "\" title=\"" . _('View members') . "\" border=0>";
$subscribe_icon_view_messages = "<img src=\"" . $core_config['http_path']['themes'] . "/" . core_themes_get() . "/images/view_action.gif\" alt=\"" . _('View messages') . "\" title=\"" . _('View messages') . "\" border=0>";
$plugin_config['sms_subscribe']['durations'] = array(_('Unlimited') => 0, _('1 Day') => 1001, _('2 Days') => 1002, _('1 Week') => 101, _('2 Weeks') => 102, _('1 Month') => 1, _('6 Months') => 6);
示例#18
0
        $c_site_config = site_config_get((int) $s[0]['uid']);
        if (strtolower($c_site_config['domain']) == strtoloweR($_SERVER['HTTP_HOST'])) {
            $site_config = array_merge($c_site_config, $s[0]);
        }
    }
}
if (!$core_config['daemon_process'] && trim($_SERVER['HTTP_HOST']) && trim($site_config['domain']) && strtolower(trim($_SERVER['HTTP_HOST'])) == strtolower(trim($site_config['domain']))) {
    $core_config['main'] = array_merge($core_config['main'], $site_config);
}
// verify selected themes_module exists
$fn1 = _APPS_PATH_PLUG_ . '/themes/' . core_themes_get() . '/config.php';
$fn2 = _APPS_PATH_PLUG_ . '/themes/' . core_themes_get() . '/fn.php';
if (!(file_exists($fn1) && file_exists($fn2))) {
    logger_print('Fail to load themes ' . core_themes_get(), 1, 'init');
    ob_end_clean();
    die(_('FATAL ERROR') . ' : ' . _('Fail to load themes') . ' ' . core_themes_get());
}
// verify selected language_module exists
$fn1 = _APPS_PATH_PLUG_ . '/language/' . core_lang_get() . '/config.php';
$fn2 = _APPS_PATH_PLUG_ . '/language/' . core_lang_get() . '/fn.php';
if (!(file_exists($fn1) && file_exists($fn2))) {
    logger_print('Fail to load language ' . core_lang_get(), 1, 'init');
    ob_end_clean();
    die(_('FATAL ERROR') . ' : ' . _('Fail to load language') . ' ' . core_lang_get());
}
if (auth_isvalid()) {
    // set user lang
    core_setuserlang($_SESSION['username']);
} else {
    core_setuserlang();
}
示例#19
0
文件: fn.php 项目: 10corp/playSMS
/**
 * Popup compose message form
 *
 * @param string $to
 *        Default destination
 * @param string $message
 *        Default or previous message
 * @param string $return_url
 *        If empty this would be $_SERVER['REQUEST_URI']
 * @param string $button_icon
 *        If empty this would be a reply icon
 * @return string Javascript PopupSendsms()
 */
function themes_popup_sendsms($to = "", $message = "", $return_url = "", $button_icon = "")
{
    global $icon_config;
    $ret = '';
    $return_url = $return_url ? $return_url : $_SERVER['REQUEST_URI'];
    $button_icon = $button_icon ? $button_icon : $icon_config['reply'];
    if (core_themes_get()) {
        $ret = core_hook(core_themes_get(), 'themes_popup_sendsms', array($to, $message, $return_url, $button_icon));
    }
    if (!$ret) {
        $ret = core_hook('common', 'themes_popup_sendsms', array($to, $message, $return_url, $button_icon));
    }
    if (!$ret) {
        $ret = "<a href=# onClick=\"javascript:PopupSendSms('" . urlencode($to) . "', '" . urlencode($message) . "', '" . _('Compose message') . "', '" . urlencode($return_url) . "');\">" . $button_icon . "</a>";
    }
    return $ret;
}