/** * 新着情報にセットする * * @param string $circularId 回覧ID * @return boolean (true:正常/false:異常) * @access public */ function setWhatsnew($circularId) { $posts = $this->_db->selectExecute("circular", array("circular_id" => $circularId)); if (empty($posts)) { return false; } $pageId = $this->_request->getParameter("page_id"); $whatsnewAction =& $this->_container->getComponent("whatsnewAction"); $whatsnew = array("unique_id" => $circularId, "title" => $posts[0]["circular_subject"], "description" => $posts[0]["circular_body"], "action_name" => "circular_view_main_detail", "parameters" => "circular_id=" . $circularId . "&page_id=" . $pageId, "insert_time" => $posts[0]["update_time"], "update_time" => $posts[0]["update_time"]); $result = $whatsnewAction->auto($whatsnew); if ($result === false) { return false; } return true; }
/** * 期限を取得 * * @param $format 日付フォーマット * @return array ($today,$soonDate) * @access private */ function _getSoonPeriod($format) { $configView =& $this->_container->getComponent('configView'); $moduleID = $this->_request->getParameter('module_id'); $config = $configView->getConfigByConfname($moduleID, 'soon_period'); if ($config === false) { return $config; } $soonPeriod = $config['conf_value']; $today = timezone_date_format(null, null); $soonDate = mktime(0, 0, 0, intval(substr($today, 4, 2)), intval(substr($today, 6, 2)) + $soonPeriod, intval(substr($today, 0, 4))); $format = "YmdHis"; $today = timezone_date_format(null, $format); $soonDate = date($format, $soonDate); return array($today, $soonDate); }