This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "quickfw".
The branch, master has been updated
via fa2424abee5d7ba951f7273e45a41d095c55404b (commit)
via b3d60aa34f6cd8c02a7771d7be82d120f03ae3af (commit)
via 96ab54e3d66e6bf7b403ffbf2daa1ec09f35b170 (commit)
from f3f07bd048e2b68ebfe271c1405742f651c6ead9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fa2424abee5d7ba951f7273e45a41d095c55404b
Author: Ivan Borzenkov <iva...@li...>
Date: Fri Nov 12 14:12:53 2010 +0300
Исправил имя класса в phpdoc
diff --git a/QFW/Init.php b/QFW/Init.php
index be198cb..72dfd73 100644
--- a/QFW/Init.php
+++ b/QFW/Init.php
@@ -17,7 +17,7 @@ class QFW
/** @var array Подключенные глобальные библиотеки */
static public $libs = array();
- /** @var DbSimple_Generic_Database|false Подключение к базе данных */
+ /** @var DbSimple_Database|false Подключение к базе данных */
static public $db = false;
/** @var mixed|false Данные о пользователе */
commit b3d60aa34f6cd8c02a7771d7be82d120f03ae3af
Author: Ivan Borzenkov <iva...@li...>
Date: Thu Nov 11 11:21:10 2010 +0300
Вынес имя поля в форме в отдельную функцию
diff --git a/lib/Modules/Scaffold/Fields.php b/lib/Modules/Scaffold/Fields.php
index c2ac617..04ad999 100644
--- a/lib/Modules/Scaffold/Fields.php
+++ b/lib/Modules/Scaffold/Fields.php
@@ -159,13 +159,14 @@ class Scaffold_Field extends Scaffold_Field_Info
/**
* Строит стандартный селект
*
+ * @param string $id первичный ключ
* @param array $data массив ключ=>значение
* @param scalar $cur текущий элемент
* @return string блок селекта
*/
- protected function selectBuild($data, $cur, $null=true)
+ protected function selectBuild($id, $data, $cur, $null=true)
{
- $text = '<select name="data['.$this->name.']">';
+ $text = '<select name="'.$this->editName($id).'">';
if ($null)
$text.= '<option value="0"'.
(!isset($data[$cur]) ? ' selected="selected"' : '').
@@ -178,6 +179,17 @@ class Scaffold_Field extends Scaffold_Field_Info
return $text;
}
+ /**
+ * Имя поля для формы
+ *
+ * @param string $id первичный ключ
+ * @return string Имя поля в name
+ */
+ protected function editName($id)
+ {
+ return 'data['.$this->name.']';
+ }
+
}
//Сервисные классы
@@ -228,7 +240,7 @@ class Scaffold_Foreign extends Scaffold_Field
public function editor($id, $value)
{
- return $this->selectBuild($this->lookup, $value);
+ return $this->selectBuild($id, $this->lookup, $value);
}
public function validator($id, $value)
@@ -282,7 +294,7 @@ class Scaffold_Text extends Scaffold_UserInput
public function editor($id, $value)
{
- return '<textarea name="data['.$this->name.']" '.
+ return '<textarea name="'.$this->editName($id).'" '.
'rows="'.$this->rows.'" cols="'.$this->cols.'">'.
QFW::$view->esc($value).'</textarea>';
}
@@ -343,7 +355,7 @@ class Scaffold_Enum extends Scaffold_Field
public function editor($id, $value)
{
- return $this->selectBuild($this->items, $value, false);
+ return $this->selectBuild($id, $this->items, $value, false);
}
}
@@ -360,8 +372,8 @@ class Scaffold_Checkbox extends Scaffold_Field
public function editor($id, $value)
{
- return '<input type="hidden" name="data['.$this->name.']" value="0" />
- <input type="checkbox" name="data['.$this->name.']" value="1" label="'.$this->title.'"
+ return '<input type="hidden" name="'.$this->editName($id).'" value="0" />
+ <input type="checkbox" name="'.$this->editName($id).'" value="1" label="'.$this->title.'"
default="'.($value?'checked':'').'" />';
}
@@ -404,20 +416,20 @@ class Scaffold_File extends Scaffold_Field
public function editor($id, $value)
{
- return '<input type="file" name="file['.$this->name.']" />
- <input type="hidden" name="data['.$this->name.']" value="0" />
- <input type="checkbox" name="data['.$this->name.']" value="1" label="Удалить" /> '.
+ return '<input type="file" name="f'.$this->editName($id).'" />
+ <input type="hidden" name="'.$this->editName($id).'" value="0" />
+ <input type="checkbox" name="'.$this->editName($id).'" value="1" label="Удалить" /> '.
$this->display($id, $value);
}
public function validator($id, $value)
{
//оставляем старый файл
- if ($_FILES['file']['error'][$this->name] == 4)
+ if ($_FILES['fdata']['error'][$this->name] == 4)
return true;
- if ($_FILES['file']['error'][$this->name] != 0)
+ if ($_FILES['fdata']['error'][$this->name] != 0)
return 'Ошибка при загрузке файла '.$this->title;
- return is_uploaded_file($_FILES['file']['tmp_name'][$this->name]);
+ return is_uploaded_file($_FILES['fdata']['tmp_name'][$this->name]);
}
public function proccess($id, $value)
@@ -428,7 +440,7 @@ class Scaffold_File extends Scaffold_Field
if ($value === false && is_file($this->path.'/'.$old))
unlink($this->path.'/'.$old);
//оставляем старое значение
- if ($_FILES['file']['error'][$this->name] == 4 && !$value)
+ if ($_FILES['fdata']['error'][$this->name] == 4 && !$value)
return $old ? $old : '';
//удяляем старый
if (is_file($this->path.'/'.$old))
@@ -437,11 +449,11 @@ class Scaffold_File extends Scaffold_Field
if ($value)
return '';
//генерим новое имя
- $info = pathinfo($_FILES['file']['name'][$this->name]);
+ $info = pathinfo($_FILES['fdata']['name'][$this->name]);
if ($id == -1)
$id = time();
$new_name = $this->name.'_'.$id.'.'.$info['extension'];
- move_uploaded_file($_FILES['file']['tmp_name'][$this->name], $this->path.'/'.$new_name);
+ move_uploaded_file($_FILES['fdata']['tmp_name'][$this->name], $this->path.'/'.$new_name);
return $new_name;
}
commit 96ab54e3d66e6bf7b403ffbf2daa1ec09f35b170
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Nov 9 14:49:09 2010 +0300
Удален старый файл из XMPP
diff --git a/lib/XMPPHP/XMPP_Old.php b/lib/XMPPHP/XMPP_Old.php
deleted file mode 100644
index 6083dad..0000000
--- a/lib/XMPPHP/XMPP_Old.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-/**
- * XMPPHP: The PHP XMPP Library
- * Copyright (C) 2008 Nathanael C. Fritz
- * This file is part of SleekXMPP.
- *
- * XMPPHP is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XMPPHP is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XMPPHP; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category xmpphp
- * @package XMPPHP
- * @author Nathanael C. Fritz <JID: fr...@ne...>
- * @author Stephan Wentz <JID: st...@ja...>
- * @author Michael Garvin <JID: ga...@ne...>
- * @copyright 2008 Nathanael C. Fritz
- */
-
-/** XMPPHP_XMPP
- *
- * This file is unnecessary unless you need to connect to older, non-XMPP-compliant servers like Dreamhost's.
- * In this case, use instead of XMPPHP_XMPP, otherwise feel free to delete it.
- * The old Jabber protocol wasn't standardized, so use at your own risk.
- *
- */
-require_once dirname(__FILE__) . '/XMPP.php';
-
- class XMPPHP_XMPPOld extends XMPPHP_XMPP {
- /**
- *
- * @var string
- */
- protected $session_id;
-
- public function __construct($host, $port, $user, $password, $resource, $server = null, $printlog = false, $loglevel = null) {
- parent::__construct($host, $port, $user, $password, $resource, $server, $printlog, $loglevel);
- if(!$server) $server = $host;
- $this->stream_start = '<stream:stream to="' . $server . '" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">';
- $this->fulljid = "{$user}@{$server}/{$resource}";
- }
-
- /**
- * Override XMLStream's startXML
- *
- * @param parser $parser
- * @param string $name
- * @param array $attr
- */
- public function startXML($parser, $name, $attr) {
- if($this->xml_depth == 0) {
- $this->session_id = $attr['ID'];
- $this->authenticate();
- }
- parent::startXML($parser, $name, $attr);
- }
-
- /**
- * Send Authenticate Info Request
- *
- */
- public function authenticate() {
- $id = $this->getId();
- $this->addidhandler($id, 'authfieldshandler');
- $this->send("<iq type='get' id='$id'><query xmlns='jabber:iq:auth'><username>{$this->user}</username></query></iq>");
- }
-
- /**
- * Retrieve auth fields and send auth attempt
- *
- * @param XMLObj $xml
- */
- public function authFieldsHandler($xml) {
- $id = $this->getId();
- $this->addidhandler($id, 'oldAuthResultHandler');
- if($xml->sub('query')->hasSub('digest')) {
- $hash = sha1($this->session_id . $this->password);
- print "{$this->session_id} {$this->password}\n";
- $out = "<iq type='set' id='$id'><query xmlns='jabber:iq:auth'><username>{$this->user}</username><digest>{$hash}</digest><resource>{$this->resource}</resource></query></iq>";
- } else {
- $out = "<iq type='set' id='$id'><query xmlns='jabber:iq:auth'><username>{$this->user}</username><password>{$this->password}</password><resource>{$this->resource}</resource></query></iq>";
- }
- $this->send($out);
-
- }
-
- /**
- * Determine authenticated or failure
- *
- * @param XMLObj $xml
- */
- public function oldAuthResultHandler($xml) {
- if($xml->attrs['type'] != 'result') {
- $this->log->log("Auth failed!", XMPPHP_Log::LEVEL_ERROR);
- $this->disconnect();
- throw new XMPPHP_Exception('Auth failed!');
- } else {
- $this->log->log("Session started");
- $this->event('session_start');
- }
- }
- }
-
-
-?>
-----------------------------------------------------------------------
Summary of changes:
QFW/Init.php | 2 +-
lib/Modules/Scaffold/Fields.php | 44 ++++++++++------
lib/XMPPHP/XMPP_Old.php | 114 ---------------------------------------
3 files changed, 29 insertions(+), 131 deletions(-)
delete mode 100644 lib/XMPPHP/XMPP_Old.php
hooks/post-receive
--
quickfw
|