Exemplo n.º 1
0
 private static function onInstallDefaultGB(Module_Guestbook $module, $dropTable)
 {
     if (false !== ($gb = GWF_Guestbook::getByID(1))) {
         return '';
     }
     $gb = new GWF_Guestbook(array('gb_id' => 1, 'gb_uid' => 0, 'gb_title' => $module->lang('default_title'), 'gb_descr' => $module->lang('default_descr'), 'gb_date' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'gb_options' => GWF_Guestbook::DEFAULT_OPTIONS));
     if (false === $gb->insert()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return '';
 }
Exemplo n.º 2
0
 public function validate_message(Module_Guestbook $m, $arg)
 {
     $arg = $_POST['message'] = trim($arg);
     $len = GWF_String::strlen($arg);
     $max = $m->cfgMaxMessageLen();
     if ($len < 1 || $len > $max) {
         return $m->lang('err_gbm_message', 1, $max);
     }
     return false;
 }
Exemplo n.º 3
0
 public function getEditButton(Module_Guestbook $module)
 {
     return GWF_Button::edit($this->getEditHref(), $module->lang('btn_edit_entry'));
 }