Ejemplo n.º 1
0
function fncdatetimeedit($datetime_value, $title, $token, $script = "", $datetime = "datetime")
{
    global $_CONF;
    global $LANG_CONFIG;
    global $_SCRIPTS;
    $pi_name = "assist";
    $tmplfld = assist_templatePath('admin', 'default', $pi_name);
    $tmpl = new Template($tmplfld);
    $tmpl->set_file(array('datetimeedit' => 'datetime.thtml'));
    // Loads jQuery UI datepicker
    if (version_compare(VERSION, '2.0.0') >= 0) {
        $_SCRIPTS->setJavaScriptLibrary('jquery.ui.datepicker');
        $_SCRIPTS->setJavaScriptLibrary('jquery-ui-i18n');
        $_SCRIPTS->setJavaScriptFile('datepicker', '/javascript/datepicker.js');
        $langCode = COM_getLangIso639Code();
        $toolTip = 'Click and select a date';
        // Should be translated
        $imgUrl = $_CONF['site_url'] . '/images/calendar.png';
        $_SCRIPTS->setJavaScript("jQuery(function () {" . "  geeklog.datepicker.set('datetime', '{$langCode}', '{$toolTip}', '{$imgUrl}');" . "});", TRUE, TRUE);
    }
    $datetime_month = date('m', $datetime_value);
    $datetime_day = date('d', $datetime_value);
    $datetime_year = date('Y', $datetime_value);
    $datetime_hour = date('H', $datetime_value);
    $datetime_minute = date('i', $datetime_value);
    //
    $month_options = COM_getMonthFormOptions($datetime_month);
    $day_options = COM_getDayFormOptions($datetime_day);
    $year_options = COM_getYearFormOptions($datetime_year);
    $hour_options = COM_getHourFormOptions($datetime_hour, 24);
    $minute_options = COM_getMinuteFormOptions($datetime_minute);
    $tmpl->set_var('site_url', $_CONF['site_url']);
    $tmpl->set_var('datetime_script', $script);
    $tmpl->set_var('datetime_title', $title);
    $tmpl->set_var('datetime', $datetime);
    $tmpl->set_var('datetime_year_options', $year_options);
    $tmpl->set_var('datetime_month_options', $month_options);
    $tmpl->set_var('datetime_day_options', $day_options);
    $tmpl->set_var('datetime_hour_options', $hour_options);
    $tmpl->set_var('datetime_minute_options', $minute_options);
    $tmpl->set_var('lang_yy', "年");
    $tmpl->set_var('lang_mm', "月");
    $tmpl->set_var('gltoken_name', CSRF_TOKEN);
    $tmpl->set_var('gltoken', $token);
    $tmpl->set_var('xhtml', XHTML);
    $tmpl->set_var('save_changes', $LANG_CONFIG['save_changes']);
    //
    $tmpl->parse('output', 'datetimeedit');
    $rt = $tmpl->finish($tmpl->get_var('output'));
    return $rt;
}
Ejemplo n.º 2
0
function fncDisplay()
{
    global $_CONF;
    global $LANG_ASSIST_ADMIN;
    global $_ASSIST_CONF;
    global $_DB_dbms;
    $retval = "";
    $pi_name = "assist";
    $tmplfld = assist_templatePath('admin', 'default', $pi_name);
    $T = new Template($tmplfld);
    $lang = COM_getLanguageName();
    $path = $_CONF['site_admin_url'] . '/plugins/assist/docs/';
    //$path = 'docs/';
    if (!file_exists($path . $lang . '/')) {
        $lang = 'japanese';
        //'english';
    }
    $document_url = $path . $lang . '/';
    $T->set_file('admin', 'information.thtml');
    $T->set_var('pi_name', $pi_name);
    $T->set_var('version', $_ASSIST_CONF['version']);
    $T->set_var('dbms', $_DB_dbms);
    $T->set_var('dbversion', DB_getVersion());
    $T->set_var('php_os', PHP_OS);
    $T->set_var('phpversion', phpversion());
    if ($_CONF['facebook_consumer_key'] == "") {
        $T->set_var('fbid', $LANG_ASSIST_ADMIN['err_fbid']);
    } else {
        $T->set_var('fbid', $_CONF['facebook_consumer_key']);
    }
    $T->set_var('piname', $LANG_ASSIST_ADMIN['piname']);
    $T->set_var('about_thispage', $LANG_ASSIST_ADMIN['about_admin_information']);
    $T->set_var('lang_document', $LANG_ASSIST_ADMIN['document']);
    $T->set_var('document_url', $document_url);
    $T->set_var('online', $LANG_ASSIST_ADMIN['online']);
    $T->set_var('lang_configuration', $LANG_ASSIST_ADMIN['configuration']);
    $T->set_var('lang_autotags', $LANG_ASSIST_ADMIN['autotags']);
    $T->set_var('lang_templatesetvar', $LANG_ASSIST_ADMIN['templatesetvar']);
    $T->set_var('site_url', $_CONF['site_url']);
    $T->set_var('site_admin_url', $_CONF['site_admin_url']);
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    return $retval;
}
Ejemplo n.º 3
0
function fncDisply($pi_name)
{
    global $_CONF;
    global $LANG_ASSIST_ADMIN;
    $pi_name = "assist";
    $tmplfld = assist_templatePath('admin', 'default', $pi_name);
    $templates = new Template($tmplfld);
    $templates->set_file(array('list' => 'backuprestore.thtml'));
    //@@@@@    $templates->set_var('about_thispage', $LANG_ASSIST_ADMIN['about_admin_backuprestore']);
    $templates->set_var('site_admin_url', $_CONF['site_admin_url']);
    $token = SEC_createToken();
    $retval .= SEC_getTokenExpiryNotice($token);
    $templates->set_var('gltoken_name', CSRF_TOKEN);
    $templates->set_var('gltoken', $token);
    $templates->set_var('xhtml', XHTML);
    $templates->set_var('config', $LANG_ASSIST_ADMIN['config']);
    $templates->set_var('config_backup', $LANG_ASSIST_ADMIN['config_backup']);
    $templates->set_var('config_init', $LANG_ASSIST_ADMIN['config_init']);
    $templates->set_var('config_restore', $LANG_ASSIST_ADMIN['config_restore']);
    $templates->set_var('config_update', $LANG_ASSIST_ADMIN['config_update']);
    $templates->set_var('config_backup_help', $LANG_ASSIST_ADMIN['config_backup_help']);
    $templates->set_var('config_init_help', $LANG_ASSIST_ADMIN['config_init_help']);
    $templates->set_var('config_restore_help', $LANG_ASSIST_ADMIN['config_restore_help']);
    $templates->set_var('config_update_help', $LANG_ASSIST_ADMIN['config_update_help']);
    $err_backup_file = "";
    if (file_exists($_CONF["path_data"] . "assistconfig_bak.php")) {
        $templates->set_var('restore_disable', "");
        if (is_writable($_CONF["path_data"] . "assistconfig_bak.php")) {
        } else {
            $err_backup_file = $LANG_ASSIST_ADMIN['err_backup_file_non_writable'];
        }
    } else {
        $templates->set_var('restore_disabled', "disabled");
        $err_backup_file = $LANG_ASSIST_ADMIN['err_backup_file_not_exist'];
    }
    $templates->set_var('err_backup_file', $err_backup_file);
    $templates->parse('output', 'list');
    $content = $templates->finish($templates->get_var('output'));
    $retval .= $content;
    return $retval;
}
Ejemplo n.º 4
0
function fncEdit($message = "", $wkymlmguserflg = false)
{
    global $_CONF;
    global $_TABLES;
    global $LANG_ASSIST_ADMIN;
    global $LANG_ADMIN;
    global $_ASSIST_CONF;
    global $LANG_ASSIST_INTROBODY;
    global $LANG_ASSIST_TOENV;
    global $LANG31;
    global $_SCRIPTS;
    $retval = '';
    //メッセージ表示
    if (!empty($message)) {
        $retval .= COM_startBlock($LANG_ASSIST_ADMIN['msg'], '', COM_getBlockTemplate('_msg_block', 'header'));
        $retval .= $message;
        $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
        // clean 'em up
        $fromname = COM_applyFilter($_POST['fromname']);
        $replyto = COM_applyFilter($_POST['replyto']);
        $sprefix = COM_applyFilter($_POST['sprefix']);
        $sid = COM_applyFilter($_POST['sid']);
        $testto = COM_applyFilter($_POST['testto']);
        $uidfrom = COM_applyFilter($_POST['uidfrom'], true);
        $uidto = COM_applyFilter($_POST['uidto'], true);
        // hiroron start 2010/07/13
        $dt_year = COM_applyFilter($_POST['datetime_year'], true);
        $dt_month = COM_applyFilter($_POST['datetime_month'], true);
        $dt_day = COM_applyFilter($_POST['datetime_day'], true);
        $dt_hour = COM_applyFilter($_POST['datetime_hour'], true);
        $dt_minute = COM_applyFilter($_POST['datetime_minute'], true);
        $datetime_value = COM_convertDate2Timestamp($dt_year . '-' . $dt_month . '-' . $dt_day, $dt_hour . ':' . $dt_minute . ':00');
        // 冒頭文 本文 introbody
        $introbody = COM_applyFilter($_POST['introbody'], true);
        //送信先環境
        $toenv = COM_applyFilter($_POST['toenv'], true);
        //送信先グループ
        $selectgroup = COM_applyFilter($_POST['selectgroup'], true);
        // ユーザの受信許可設定を無視して送る
        $overstyr = COM_applyFilter($_POST['overstyr'], true);
        //一括予約
        $bulkmm = COM_applyFilter($_POST['bulkmm'], true);
        $bulkcnt = COM_applyFilter($_POST['bulkcnt'], true);
    } else {
        $fromname = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_fromname'");
        $fromname = COM_stripslashes($fromname);
        if ($fromname == "") {
            $fromname = $_CONF['site_name'];
        }
        $replyto = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_replyto'");
        $replyto = COM_stripslashes($replyto);
        if ($replyto == "") {
            $replyto = $_CONF['site_mail'];
        }
        $sprefix = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_sprefix'");
        $sprefix = COM_stripslashes($sprefix);
        $sid = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_sid'");
        $sid = COM_stripslashes($sid);
        $testto = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_testto'");
        $testto = COM_stripslashes($testto);
        $uidfrom = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_uidfrom'");
        $uidfrom = COM_stripslashes($uidfrom);
        $uidto = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_uidto'");
        $uidto = COM_stripslashes($uidto);
        // hiroron start 2010/07/13
        $datetime_value = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_re_datetime'");
        // 冒頭文 本文 introbody
        $introbody = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_introbody'");
        //送信先環境
        $toenv = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_toenv'");
        //送信先グループ
        $selectgroup = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_selectgroup'");
        // ユーザの受信許可設定を無視して送る
        $overstyr = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_overstyr'");
        $bulkmm = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_bulkmm'");
        $bulkcnt = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_bulkcnt'");
    }
    $retval .= COM_startBlock($LANG_ASSIST_ADMIN['edit'], '', COM_getBlockTemplate('_admin_block', 'header'));
    $pi_name = "assist";
    $tmplfld = assist_templatePath('admin', 'default', $pi_name);
    $templates = new Template($tmplfld);
    // Loads jQuery UI datepicker
    if (version_compare(VERSION, '2.0.0') >= 0) {
        $_SCRIPTS->setJavaScriptLibrary('jquery.ui.datepicker');
        $_SCRIPTS->setJavaScriptLibrary('jquery-ui-i18n');
        $_SCRIPTS->setJavaScriptFile('datepicker', '/javascript/datepicker.js');
        $langCode = COM_getLangIso639Code();
        $toolTip = 'Click and select a date';
        // Should be translated
        $imgUrl = $_CONF['site_url'] . '/images/calendar.png';
        $_SCRIPTS->setJavaScript("jQuery(function () {" . "  geeklog.datepicker.set('datetime', '{$langCode}', '{$toolTip}', '{$imgUrl}');" . "});", TRUE, TRUE);
    }
    $templates->set_file('editor', "newsletter.thtml");
    //--
    $templates->set_var('lang_must', $LANG_ASSIST_ADMIN['must']);
    $templates->set_var('site_url', $_CONF['site_url']);
    $templates->set_var('site_admin_url', $_CONF['site_admin_url']);
    $token = SEC_createToken();
    $retval .= SEC_getTokenExpiryNotice($token);
    $templates->set_var('gltoken_name', CSRF_TOKEN);
    $templates->set_var('gltoken', $token);
    $templates->set_var('xhtml', XHTML);
    $templates->set_var('script', THIS_PLUGIN . "/" . THIS_SCRIPT);
    //-----
    $w = "";
    $logfile = $_CONF['path_log'] . 'assist_newsletter.log';
    if (!file_exists($logfile)) {
        $w .= sprintf($LANG_ASSIST_ADMIN['mail_logfile'], $logfile);
    } else {
        if (!is_writable($logfile)) {
            $w .= sprintf($LANG_ASSIST_ADMIN['mail_logfile'], $logfile);
        }
    }
    $tid = $_ASSIST_CONF['newsletter_tid'];
    $topicname = DB_getItem($_TABLES['topics'], 'topic', "tid = '{$tid}'");
    if ($topicname == "") {
        $topicname = $tid;
    }
    $w .= sprintf($LANG_ASSIST_ADMIN['mail_msg'], $topicname);
    $templates->set_var('mail_msg', $w);
    $templates->set_var('mail_msg1', $LANG_ASSIST_ADMIN['mail_msg1']);
    $templates->set_var('mail_msg2', $LANG_ASSIST_ADMIN['mail_msg2']);
    $templates->set_var('mail_msg3', $LANG_ASSIST_ADMIN['mail_msg3']);
    $templates->set_var('mail_msg4', $LANG_ASSIST_ADMIN['mail_msg4']);
    $templates->set_var('lang_fromname', $LANG_ASSIST_ADMIN['fromname']);
    //@@@@@ $templates->set_var('help_fromname', $LANG_ASSIST_ADMIN['help']);
    $templates->set_var('fromname', $fromname);
    //replyto
    $templates->set_var('lang_replyto', $LANG_ASSIST_ADMIN['replyto']);
    $templates->set_var('replyto', $replyto);
    //subject_prefix
    $templates->set_var('lang_sprefix', $LANG_ASSIST_ADMIN['sprefix']);
    $templates->set_var('sprefix', $sprefix);
    //sid
    $templates->set_var('lang_sid', $LANG_ASSIST_ADMIN['sid']);
    $templates->set_var('sid', $sid);
    //FOR GL2.0.0
    if (COM_versionCompare(VERSION, "2.0.0", '>=')) {
        //$where ="s.sid = t.id AND t.tid=\"".$tid."\"";
        //$tables="{$_TABLES['stories']} AS s ,{$_TABLES['topic_assignments']} AS ta";
        $topics = TOPIC_getChildList($tid);
        $where = "s.sid = ta.id ";
        if ($topics == "") {
            $where .= " AND tid=\"" . $tid . "\"";
        } else {
            $where .= " AND ta.tid IN ({$topics})";
        }
        $tables = "{$_TABLES['stories']} AS s ";
        $tables .= " ,{$_TABLES['topic_assignments']} AS ta";
        $optionlist_sid = "<option value=''>{$LANG_ASSIST_ADMIN['select_sid']}</option>" . LB;
        $optionlist_sid .= COM_optionList($tables, 'distinct s.sid,s.title,s.date*-1', $sid, 2, $where);
    } else {
        $where = "tid=\"" . $tid . "\"";
        $optionlist_sid = "<option value=''>{$LANG_ASSIST_ADMIN['select_sid']}</option>" . LB;
        $optionlist_sid .= COM_optionList($_TABLES['stories'], 'sid,title,date*-1', $sid, 2, $where);
    }
    $templates->set_var('optionlist_sid', $optionlist_sid);
    // 冒頭文 本文 introbody
    $templates->set_var('lang_introbody', $LANG_ASSIST_ADMIN['introbody']);
    $list_introbody = assist_getradiolist($LANG_ASSIST_INTROBODY, "introbody", $introbody);
    $templates->set_var('list_introbody', $list_introbody);
    //送信先環境
    $templates->set_var('lang_toenv', $LANG_ASSIST_ADMIN['toenv']);
    $list_toenv = assist_getradiolist($LANG_ASSIST_TOENV, "toenv", $toenv);
    $templates->set_var('list_toenv', $list_toenv);
    //送信先グループ
    $thisUsersGroups = SEC_getUserGroups();
    uksort($thisUsersGroups, 'strcasecmp');
    $optionlist_selectgroup = '';
    if ($wkymlmguserflg == true) {
        $optionlist_selectgroup .= '<option value="' . 99999 . '"';
        if ($selectgroup > 0 && $selectgroup == "99999") {
            $optionlist_selectgroup .= ' selected="selected"';
        }
        $optionlist_selectgroup .= '>' . $LANG_ASSIST_ADMIN['wkymlmguser_user'] . '</option>' . LB;
    }
    foreach ($thisUsersGroups as $groupName => $groupID) {
        if ($groupName != 'All Users') {
            $optionlist_selectgroup .= '<option value="' . $groupID . '"';
            if ($selectgroup > 0 && $selectgroup == $groupID) {
                $optionlist_selectgroup .= ' selected="selected"';
            }
            $optionlist_selectgroup .= '>' . ucwords($groupName) . '</option>' . LB;
        }
    }
    $templates->set_var('lang_selectgroup', $LANG_ASSIST_ADMIN['selectgroup']);
    $templates->set_var('optionlist_selectgroup', $optionlist_selectgroup);
    // ユーザの受信許可設定を無視して送る
    $templates->set_var('lang_overstyr', $LANG31['14']);
    if ($overstyr == 0) {
        $templates->set_var('is_checked_overstyr', '');
    } else {
        $templates->set_var('is_checked_overstyr', 'checked="checked"');
    }
    //testto
    $templates->set_var('lang_testto', $LANG_ASSIST_ADMIN['testto']);
    $templates->set_var('testto', $testto);
    //uidfrom-to
    $templates->set_var('lang_sendto', $LANG_ASSIST_ADMIN['sendto']);
    $templates->set_var('lang_uidfrom', $LANG_ASSIST_ADMIN['uidfrom']);
    $templates->set_var('uidfrom', $uidfrom);
    $templates->set_var('lang_uidto', $LANG_ASSIST_ADMIN['uidto']);
    $templates->set_var('uidto', $uidto);
    $templates->set_var('lang_sendto_remarks', $LANG_ASSIST_ADMIN['sendto_remarks']);
    if ($wkymlmguserflg == true) {
        $templates->set_var('user_wkymlmguser', $LANG_ASSIST_ADMIN['wkymlmguser_on']);
    } else {
        $templates->set_var('user_wkymlmguser', $LANG_ASSIST_ADMIN['wkymlmguser_off']);
    }
    // hiroron start 2010/07/13
    if ($datetime_value === "") {
        $datetime_value = time();
    }
    $datetime_month = date('m', $datetime_value);
    $datetime_day = date('d', $datetime_value);
    $datetime_year = date('Y', $datetime_value);
    $datetime_hour = date('H', $datetime_value);
    $datetime_minute = date('i', $datetime_value);
    $month_options = COM_getMonthFormOptions($datetime_month);
    $day_options = COM_getDayFormOptions($datetime_day);
    $year_options = COM_getYearFormOptions($datetime_year);
    $hour_options = COM_getHourFormOptions($datetime_hour, 24);
    $minute_options = COM_getMinuteFormOptions($datetime_minute);
    $templates->set_var('lang_reserv_datetime', $LANG_ASSIST_ADMIN['reserv_datetime']);
    $templates->set_var('datetime', 'datetime');
    $templates->set_var('datetime_year_options', $year_options);
    $templates->set_var('datetime_month_options', $month_options);
    $templates->set_var('datetime_day_options', $day_options);
    $templates->set_var('datetime_hour_options', $hour_options);
    $templates->set_var('datetime_minute_options', $minute_options);
    $templates->set_var('lang_yy', $LANG_ASSIST_ADMIN['yy']);
    $templates->set_var('lang_mm', $LANG_ASSIST_ADMIN['mm']);
    $templates->set_var('lang_dd', $LANG_ASSIST_ADMIN['dd']);
    // hiroron end 2010/07/13
    $templates->set_var('lang_reserv_datetime_remarks', $LANG_ASSIST_ADMIN['reserv_datetime_remarks']);
    //予約送信
    //$templates->set_var( 'lang_bulkbooking', $LANG_ASSIST_ADMIN['mail_bulkbooking']);
    $templates->set_var('minute', $LANG_ASSIST_ADMIN['minute']);
    $templates->set_var('every', $LANG_ASSIST_ADMIN['every']);
    $templates->set_var('increments', $LANG_ASSIST_ADMIN['increments']);
    $templates->set_var('bulkmm', $bulkmm);
    $templates->set_var('bulkcnt', $bulkcnt);
    // SAVE、CANCEL ボタン
    $templates->set_var('lang_save', $LANG_ADMIN['save']);
    $templates->set_var('lang_cancel', $LANG_ADMIN['cancel']);
    $templates->set_var('lang_testsend', $LANG_ASSIST_ADMIN['mail_test']);
    $templates->set_var('lang_send', $LANG_ASSIST_ADMIN['mail_send']);
    // hiroron start 2010/07/13
    $templates->set_var('lang_reserv', $LANG_ASSIST_ADMIN['mail_reserv']);
    // hiroron end 2010/07/13
    // hiroron start 2010/07/15
    $templates->set_var('list_reserv', fncListReserv());
    // hiroron end 2010/07/15
    //
    $templates->parse('output', 'editor');
    $retval .= $templates->finish($templates->get_var('output'));
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
Ejemplo n.º 5
0
function fncdelete()
{
    global $_CONF;
    global $LANG_ASSIST_ADMIN;
    $pi_name = "assist";
    $tmplfld = assist_templatePath('admin', 'default', $pi_name);
    $tmpl = new Template($tmplfld);
    $tmpl->set_file(array('delete' => 'delete.thtml'));
    $tmpl->set_var('site_admin_url', $_CONF['site_admin_url']);
    $tmpl->set_var('gltoken_name', CSRF_TOKEN);
    $tmpl->set_var('gltoken', SEC_createToken());
    $tmpl->set_var('xhtml', XHTML);
    $tmpl->set_var('script', THIS_PLUGIN . "/" . THIS_SCRIPT);
    $tmpl->set_var('deletemsg', $LANG_ASSIST_ADMIN['deletemsg_user']);
    $tmpl->set_var('lang_uidfrom', $LANG_ASSIST_ADMIN['uidfrom']);
    $tmpl->set_var('lang_uidto', $LANG_ASSIST_ADMIN['uidto']);
    $tmpl->set_var('submit', $LANG_ASSIST_ADMIN['submit']);
    $tmpl->parse('output', 'delete');
    $import = $tmpl->finish($tmpl->get_var('output'));
    $retval = "";
    $retval .= COM_startBlock($LANG_ASSIST_ADMIN['delete'], '', COM_getBlockTemplate('_admin_block', 'header'));
    $retval .= $import;
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}