Overview

Packages

  • Agora
  • None

Classes

  • Agora
  • Agora_Api
  • Agora_Driver
  • Agora_Driver_SplitSql
  • Agora_Driver_Sql
  • Agora_Exception
  • Agora_Factory_Driver
  • Agora_Form_Forum
  • Agora_Form_Message
  • Agora_Form_Search
  • Agora_View
  • Horde_Form_Renderer_MessageForm
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Message form class.
 4:  *
 5:  * Copyright 2005-2012 Horde LLC (http://www.horde.org/)
 6:  *
 7:  * See the enclosed file COPYING for license information (GPL). If you
 8:  * did not receive this file, see http://www.horde.org/licenses/gpl.
 9:  *
10:  * @package Agora
11:  */
12: class Agora_Form_Message extends Horde_Form {
13: 
14:     function validate(&$vars, $canAutoFill = false)
15:     {
16:         global $conf;
17: 
18:         if (!parent::validate($vars, $canAutoFill)) {
19:             if (!$GLOBALS['registry']->getAuth() && !empty($conf['forums']['captcha'])) {
20:                 $vars->remove('captcha');
21:                 $this->removeVariable($varname = 'captcha');
22:                 $this->insertVariableBefore('newcomment', _("Spam protection"), 'captcha', 'figlet', true, null, null, array(Agora::getCAPTCHA(true), $conf['forums']['figlet_font']));
23:             }
24:             return false;
25:         }
26: 
27:         return true;
28:     }
29: 
30:     function &getRenderer($params = array())
31:     {
32:         $renderer = new Horde_Form_Renderer_MessageForm($params);
33:         return $renderer;
34:     }
35: 
36: }
37: 
38: /**
39:  * Message renderer class.
40:  *
41:  * @package Agora
42:  */
43: class Horde_Form_Renderer_MessageForm extends Horde_Form_Renderer {
44: 
45:     function _renderVarInputEnd(&$form, &$var, &$vars)
46:     {
47:         if ($var->hasDescription()) {
48:             // The description is actually the quote button
49:             echo ' ' . $var->getDescription();
50:         }
51:     }
52: 
53:     function close($focus = false)
54:     {
55:         echo '</form>' . "\n";
56: 
57:         if (Horde_Util::getGet('reply_focus')) {
58:             echo '<script type="text/javascript">document.getElementById("message_body").focus()</script>';
59:         }
60:     }
61: 
62: }
63: 
API documentation generated by ApiGen