Code Duplication    Length = 52-52 lines in 2 locations

class/APCal.php 2 locations

@@ 1214-1265 (lines=52) @@
1211
         * @param  bool   $for_print
1212
         * @return string
1213
         */
1214
        public function get_weekly($get_target = '', $query_string = '', $for_print = false)
1215
        {
1216
            // $PHP_SELF = $_SERVER['SCRIPT_NAME'] ;
1217
            // if( $get_target == '' ) $get_target = $PHP_SELF ;
1218
1219
            require_once "$this->base_path/include/patTemplate.php";
1220
            $tmpl = new PatTemplate();
1221
            $tmpl->readTemplatesFromFile("$this->images_path/weekly.tmpl.html");
1222
1223
            // setting skin folder
1224
            $tmpl->addVar('WholeBoard', 'SKINPATH', $this->images_url);
1225
1226
            // Static parameter for the request
1227
            $tmpl->addVar('WholeBoard', 'GET_TARGET', $get_target);
1228
            $tmpl->addVar('WholeBoard', 'QUERY_STRING', $query_string);
1229
            $tmpl->addVar('WholeBoard', 'PRINT_LINK', "$this->base_url/print.php?cid=$this->now_cid&smode=Weekly&caldate=$this->caldate");
1230
            $tmpl->addVar('WholeBoard', 'LANG_PRINT', _APCAL_BTN_PRINT);
1231
            if ($for_print) {
1232
                $tmpl->addVar('WholeBoard', 'PRINT_ATTRIB', "width='0' height='0'");
1233
            }
1234
1235
            $prevMonth = date('Y-n-j', mktime(0, 0, 0, $this->month, 0, $this->year));
1236
            $nextMonth = date('Y-n-j', mktime(0, 0, 0, $this->month + 1, 1, $this->year));
1237
            $prevWeek  = date('Y-n-j', mktime(0, 0, 0, $this->month, $this->date - 7, $this->year));
1238
            $nextWeek  = date('Y-n-j', mktime(0, 0, 0, $this->month, $this->date + 7, $this->year));
1239
            $tmpl->addVar('WholeBoard', 'TODAYLINK', $this->make_cal_link($get_target, 'Weekly', $this->now_cid, date('Y-n-j')));
1240
            $tmpl->addVar('WholeBoard', 'PREVIOUSMONTHLINK', $this->make_cal_link($get_target, 'Weekly', $this->now_cid, $prevMonth));
1241
            $tmpl->addVar('WholeBoard', 'PREVIOUSWEEKLINK', $this->make_cal_link($get_target, 'Weekly', $this->now_cid, $prevWeek));
1242
            $tmpl->addVar('WholeBoard', 'NEXTWEEKLINK', $this->make_cal_link($get_target, 'Weekly', $this->now_cid, $nextWeek));
1243
            $tmpl->addVar('WholeBoard', 'NEXTMONTHLINK', $this->make_cal_link($get_target, 'Weekly', $this->now_cid, $nextMonth));
1244
            $tmpl->addVar('WholeBoard', 'YEARLYVIEW', $this->make_cal_link($get_target, 'Yearly', $this->now_cid, $this->caldate));
1245
            $tmpl->addVar('WholeBoard', 'MONTHLYVIEW', $this->make_cal_link($get_target, 'Monthly', $this->now_cid, $this->caldate));
1246
            $tmpl->addVar('WholeBoard', 'DAILYVIEW', $this->make_cal_link($get_target, 'Daily', $this->now_cid, $this->caldate));
1247
            $tmpl->addVar('WholeBoard', 'LISTVIEW', $this->make_cal_link($get_target, 'List', $this->now_cid, $this->caldate));
1248
1249
            // ���ƥ��꡼����ܥå���
1250
            $tmpl->addVar('WholeBoard', 'CATEGORIES_SELFORM', $this->get_categories_selform($get_target));
1251
            $tmpl->addVar('WholeBoard', 'CID', $this->now_cid);
1252
1253
            // Variables required in header part etc.
1254
            $tmpl->addVars('WholeBoard', $this->get_calendar_information('W'));
1255
1256
            $tmpl->addVar('WholeBoard', 'LANG_JUMP', _APCAL_BTN_JUMP);
1257
1258
            // BODY of the calendar
1259
            $tmpl->addVar('WholeBoard', 'CALENDAR_BODY', $this->get_weekly_html($get_target, $query_string));
1260
1261
            // content generated from PatTemplate
1262
            $ret = $tmpl->getParsedTemplate('WholeBoard');
1263
1264
            return $ret;
1265
        }
1266
1267
        // ������������Τ�ɽ����patTemplate����)
1268
@@ 1275-1326 (lines=52) @@
1272
         * @param  bool   $for_print
1273
         * @return string
1274
         */
1275
        public function get_daily($get_target = '', $query_string = '', $for_print = false)
1276
        {
1277
            // $PHP_SELF = $_SERVER['SCRIPT_NAME'] ;
1278
            // if( $get_target == '' ) $get_target = $PHP_SELF ;
1279
1280
            require_once "$this->base_path/include/patTemplate.php";
1281
            $tmpl = new PatTemplate();
1282
            $tmpl->readTemplatesFromFile("$this->images_path/daily.tmpl.html");
1283
1284
            // setting skin folder
1285
            $tmpl->addVar('WholeBoard', 'SKINPATH', $this->images_url);
1286
1287
            // Static parameter for the request
1288
            $tmpl->addVar('WholeBoard', 'GET_TARGET', $get_target);
1289
            $tmpl->addVar('WholeBoard', 'QUERY_STRING', $query_string);
1290
            $tmpl->addVar('WholeBoard', 'PRINT_LINK', "$this->base_url/print.php?cid=$this->now_cid&smode=Daily&caldate=$this->caldate");
1291
            $tmpl->addVar('WholeBoard', 'LANG_PRINT', _APCAL_BTN_PRINT);
1292
            if ($for_print) {
1293
                $tmpl->addVar('WholeBoard', 'PRINT_ATTRIB', "width='0' height='0'");
1294
            }
1295
1296
            $prevMonth = date('Y-n-j', mktime(0, 0, 0, $this->month, 0, $this->year));
1297
            $nextMonth = date('Y-n-j', mktime(0, 0, 0, $this->month + 1, 1, $this->year));
1298
            $prevDay   = date('Y-n-j', mktime(0, 0, 0, $this->month, $this->date - 1, $this->year));
1299
            $nextDay   = date('Y-n-j', mktime(0, 0, 0, $this->month, $this->date + 1, $this->year));
1300
            $tmpl->addVar('WholeBoard', 'TODAYLINK', $this->make_cal_link($get_target, 'Daily', $this->now_cid, date('Y-n-j')));
1301
            $tmpl->addVar('WholeBoard', 'PREVIOUSMONTHLINK', $this->make_cal_link($get_target, 'Daily', $this->now_cid, $prevMonth));
1302
            $tmpl->addVar('WholeBoard', 'PREVIOUSDAYLINK', $this->make_cal_link($get_target, 'Daily', $this->now_cid, $prevDay));
1303
            $tmpl->addVar('WholeBoard', 'NEXTDAYLINK', $this->make_cal_link($get_target, 'Daily', $this->now_cid, $nextDay));
1304
            $tmpl->addVar('WholeBoard', 'NEXTMONTHLINK', $this->make_cal_link($get_target, 'Daily', $this->now_cid, $nextMonth));
1305
            $tmpl->addVar('WholeBoard', 'YEARLYVIEW', $this->make_cal_link($get_target, 'Yearly', $this->now_cid, $this->caldate));
1306
            $tmpl->addVar('WholeBoard', 'MONTHLYVIEW', $this->make_cal_link($get_target, 'Monthly', $this->now_cid, $this->caldate));
1307
            $tmpl->addVar('WholeBoard', 'WEEKLYVIEW', $this->make_cal_link($get_target, 'Weekly', $this->now_cid, $this->caldate));
1308
            $tmpl->addVar('WholeBoard', 'LISTVIEW', $this->make_cal_link($get_target, 'List', $this->now_cid, $this->caldate));
1309
1310
            // ���ƥ��꡼����ܥå���
1311
            $tmpl->addVar('WholeBoard', 'CATEGORIES_SELFORM', $this->get_categories_selform($get_target));
1312
            $tmpl->addVar('WholeBoard', 'CID', $this->now_cid);
1313
1314
            // Variables required in header part etc.
1315
            $tmpl->addVars('WholeBoard', $this->get_calendar_information('D'));
1316
1317
            $tmpl->addVar('WholeBoard', 'LANG_JUMP', _APCAL_BTN_JUMP);
1318
1319
            // BODY of the calendar
1320
            $tmpl->addVar('WholeBoard', 'CALENDAR_BODY', $this->get_daily_html($get_target, $query_string));
1321
1322
            // content generated from PatTemplate
1323
            $ret = $tmpl->getParsedTemplate('WholeBoard');
1324
1325
            return $ret;
1326
        }
1327
1328
        // ���������Υإå������ɬ�פʾ����Ϣ��������֤��ʷ�֡����֡������̡�
1329