Bugfixes and updates on the forms and database access as well as the pagination
This commit is contained in:
@@ -142,11 +142,12 @@ abstract class Pageination implements IPageination
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* will set the entries per page
|
* @desc will set the entries per page
|
||||||
|
* @param int $entriesPerPage
|
||||||
*/
|
*/
|
||||||
private static function setEntriesPerPage( )
|
public static function setEntriesPerPage( int $entriesPerPage = 0 )
|
||||||
{
|
{
|
||||||
self::$_entries_per_page = Config::getInstance()->getConfig()[View::NIBIRU_SETTINGS]['entriesperpage'];
|
self::$_entries_per_page = $entriesPerPage ? $entriesPerPage : Config::getInstance()->getConfig()[View::NIBIRU_SETTINGS]['entriesperpage'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ class FormAttributes
|
|||||||
$this->_element = str_replace(' CONTEXT', '', $this->_element);
|
$this->_element = str_replace(' CONTEXT', '', $this->_element);
|
||||||
$this->_element = str_replace(' CHECKED', '', $this->_element);
|
$this->_element = str_replace(' CHECKED', '', $this->_element);
|
||||||
$this->_element = str_replace(' VALUE', '', $this->_element);
|
$this->_element = str_replace(' VALUE', '', $this->_element);
|
||||||
|
$this->_element = str_replace(' PATTERN', '', $this->_element);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,22 +32,34 @@ final class Pdo extends Mysql implements IPdo
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function query( $string = self::PLACE_NO_QUERY )
|
public static function query( $string = self::PLACE_NO_QUERY )
|
||||||
{
|
{
|
||||||
$query = parent::getInstance( self::getSettingsSection() )->getConn()->query( $string );
|
|
||||||
while($row = $query->fetch())
|
|
||||||
{
|
|
||||||
$keys = array_keys($row);
|
|
||||||
for($i=0;sizeof($keys)>$i;$i += 2)
|
|
||||||
{
|
|
||||||
$row_values[] = $row[$keys[$i]];
|
|
||||||
$key_values[] = $keys[$i];
|
|
||||||
}
|
|
||||||
$result = array_combine($key_values, $row_values);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
if(!strstr($string, IOdbc::PLACE_SQL_UPDATE))
|
||||||
}
|
{
|
||||||
|
if(!strstr($string, IOdbc::PLACE_SQL_INSERT))
|
||||||
|
{
|
||||||
|
$query = parent::getInstance( self::getSettingsSection() )->getConn()->query( $string );
|
||||||
|
while($row = $query->fetch())
|
||||||
|
{
|
||||||
|
$keys = array_keys($row);
|
||||||
|
for($i=0;sizeof($keys)>$i;$i += 2)
|
||||||
|
{
|
||||||
|
$row_values[] = $row[$keys[$i]];
|
||||||
|
$key_values[] = $keys[$i];
|
||||||
|
}
|
||||||
|
$result = array_combine($key_values, $row_values);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$query = parent::getInstance( self::getSettingsSection() )->getConn();
|
||||||
|
$query->exec($string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class TypePassword extends FormAttributes implements IForm
|
|||||||
self::FORM_ATTRIBUTE_CLASS => '',
|
self::FORM_ATTRIBUTE_CLASS => '',
|
||||||
self::FORM_ATTRIBUTE_PLACEHOLDER => '',
|
self::FORM_ATTRIBUTE_PLACEHOLDER => '',
|
||||||
self::FORM_ATTRIBUTE_REQUIRED => '',
|
self::FORM_ATTRIBUTE_REQUIRED => '',
|
||||||
self::FORM_VALUE
|
self::FORM_VALUE => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
public function loadElement( $attributes )
|
public function loadElement( $attributes )
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ class TypeTelefon extends FormAttributes implements IForm
|
|||||||
self::FORM_ATTRIBUTE_CLASS => '',
|
self::FORM_ATTRIBUTE_CLASS => '',
|
||||||
self::FORM_ATTRIBUTE_ID => '',
|
self::FORM_ATTRIBUTE_ID => '',
|
||||||
self::FORM_ATTRIBUTE_PLACEHOLDER => '',
|
self::FORM_ATTRIBUTE_PLACEHOLDER => '',
|
||||||
self::FORM_ATTRIBUTE_REQUIRED => ''
|
self::FORM_ATTRIBUTE_REQUIRED => '',
|
||||||
|
self::FORM_ATTRIBUTE_PATTERN => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
public function loadElement( $attributes )
|
public function loadElement( $attributes )
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ interface IForm
|
|||||||
const FORM_ATTRIBUTE_MAXLENGTH = 'maxlength';
|
const FORM_ATTRIBUTE_MAXLENGTH = 'maxlength';
|
||||||
const FORM_ATTRIBUTE_TABINDEX = 'tabindex';
|
const FORM_ATTRIBUTE_TABINDEX = 'tabindex';
|
||||||
const FORM_ATTRIBUTE_DISABLED = 'disabled';
|
const FORM_ATTRIBUTE_DISABLED = 'disabled';
|
||||||
|
const FORM_ATTRIBUTE_PATTERN = 'pattern';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @desc loads the current Form element to the form
|
* @desc loads the current Form element to the form
|
||||||
|
|||||||
@@ -34,5 +34,7 @@ interface IMysql
|
|||||||
const PLACE_WHERE_VALUE = "NO WHERE VALUE";
|
const PLACE_WHERE_VALUE = "NO WHERE VALUE";
|
||||||
const PLACE_DES_ENCRYPT = false;
|
const PLACE_DES_ENCRYPT = false;
|
||||||
const PLACE_ENCODING = "encoding";
|
const PLACE_ENCODING = "encoding";
|
||||||
|
const PLACE_SQL_UPDATE = "UPDATE";
|
||||||
|
const PLACE_SQL_INSERT = "INSERT";
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user