|
From: <pan...@us...> - 2009-02-14 17:20:54
|
Revision: 510
http://acmcontester.svn.sourceforge.net/acmcontester/?rev=510&view=rev
Author: panzaboi
Date: 2009-02-14 17:20:44 +0000 (Sat, 14 Feb 2009)
Log Message:
-----------
Updates
Modified Paths:
--------------
website/config/config.ini
website/library/Application.php
Added Paths:
-----------
website/application/models/
website/application/models/Form/
website/application/models/Form/SmallLogin.php
Property changes on: website/application/models
___________________________________________________________________
Added: tsvn:logminsize
+ 5
Property changes on: website/application/models/Form
___________________________________________________________________
Added: tsvn:logminsize
+ 5
Added: website/application/models/Form/SmallLogin.php
===================================================================
--- website/application/models/Form/SmallLogin.php (rev 0)
+++ website/application/models/Form/SmallLogin.php 2009-02-14 17:20:44 UTC (rev 510)
@@ -0,0 +1,85 @@
+<?php
+
+class Form_SmallLogin extends Zend_Dojo_Form
+{
+ public $elementDecorators = array(
+ 'DijitElement',
+ array('Label', array('class' => 'label2')),
+ array('HtmlTag', array('tag' => 'div', 'class' => 'line'))
+ );
+
+ public $buttonDecorators = array(
+ 'DijitElement',
+ array('HtmlTag', array('tag' => 'div', 'class' => 'line tr'))
+ );
+
+ public function init()
+ {
+ $translate = Zend_Registry::get('Zend_Translate');
+ $router = Zend_Controller_Front::getInstance()->getRouter();
+
+ $this->setAction($router->assemble(array('action' => 'login', 'controller' => 'index'), null));
+ $this->setMethod('post');
+ $this->setName('loginform');
+ $this->setAttrib('class', 'form');
+
+ $this->addElement('ValidationTextBox', 'username', array(
+ 'decorators' => $this->elementDecorators,
+ 'filters' => array('StringTrim', 'StringToLower'),
+ 'validators' => array(
+ array('StringLength', false, array(5, 50)),
+ ),
+ 'required' => true,
+ 'maxlength' => 50,
+ 'trim' => true,
+ 'lowercase' => true,
+ 'regExp' => '[\w]{5,50}',
+ 'invalidMessage' => sprintf($translate->_('enter_username_between'), 5, 50),
+ 'title' => $translate->_('username'),
+ 'label' => $translate->_('username').':',
+ 'class' => 'text',
+ ));
+
+ $this->addElement('PasswordTextBox', 'password', array(
+ 'decorators' => $this->elementDecorators,
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ 'Alnum',
+ array('StringLength', false, array(5, 32)),
+ ),
+ 'required' => true,
+ 'trim' => true,
+ 'regExp' => '[\S]{5,32}',
+ 'invalidMessage' => sprintf($translate->_('enter_password_between'), 5, 32),
+ 'title' => $translate->_('password'),
+ 'label' => $translate->_('password').':',
+ 'class' => 'text',
+ ));
+
+ $this->addElement('Button', 'signupbutton', array(
+ 'decorators' => $this->buttonDecorators,
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => $translate->_('signup'),
+ 'class' => 'signup2',
+ 'onclick' => 'return goToUrl("'.$router->assemble(array('action' => 'register', 'controller' => 'user'), null).'")'
+ ));
+
+ $this->addElement('SubmitButton', 'loginbutton', array(
+ 'decorators' => $this->buttonDecorators,
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => $translate->_('login'),
+ 'class' => 'submit2'
+ ));
+ }
+
+ public function loadDefaultDecorators()
+ {
+ $this->setDecorators(array(
+ 'FormElements',
+ 'DijitForm',
+ array('HtmlTag', array('tag' => 'div', 'class' => 'box2 c'))
+ ));
+ }
+}
\ No newline at end of file
Modified: website/config/config.ini
===================================================================
--- website/config/config.ini 2009-02-14 11:04:36 UTC (rev 509)
+++ website/config/config.ini 2009-02-14 17:20:44 UTC (rev 510)
@@ -70,6 +70,7 @@
general.titlesep = " - "
general.extention = "html"
general.roleid = "2"
+general.defaultmodelspath = "/application/models/";
front.defaultmodule = "default"
Modified: website/library/Application.php
===================================================================
--- website/library/Application.php 2009-02-14 11:04:36 UTC (rev 509)
+++ website/library/Application.php 2009-02-14 17:20:44 UTC (rev 510)
@@ -61,13 +61,6 @@
protected function _initialize()
{
- // Set Include paths
- set_include_path(
- self::$_docroot . PATH_SEPARATOR
- . self::$_docroot . '/application' . PATH_SEPARATOR
- . get_include_path()
- );
-
// Auto-loader
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
@@ -78,6 +71,12 @@
// Setup Config
$_config = $this->_setupConfig();
+ // Set Include paths
+ set_include_path(
+ self::$_docroot . $_config->general->defaultmodelspath . PATH_SEPARATOR .
+ get_include_path()
+ );
+
// Setup DB
$this->_setupDB();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|