CODE STYLE class.propelTable.php

This commit is contained in:
Fernando Ontiveros
2012-10-09 13:09:09 -04:00
parent e064d12888
commit 10bcb8e746

View File

@@ -1,6 +1,7 @@
<?php <?php
/** /**
* class.propelTable.php * class.propelTable.php
*
* @package workflow.gulliver.system * @package workflow.gulliver.system
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
@@ -31,6 +32,7 @@
/** /**
* Class pagedTable * Class pagedTable
*
* @author David S. Callizaya S. <davidsantos@colosa.com> * * @author David S. Callizaya S. <davidsantos@colosa.com> *
* @access public * @access public
* @package workflow.gulliver.system * @package workflow.gulliver.system
@@ -80,6 +82,7 @@ class propelTable
var $editRow = false; var $editRow = false;
var $notFields = ' title button linknew begingrid2 endgrid2 '; // These are not considered to build the sql queries (update,insert,delete) var $notFields = ' title button linknew begingrid2 endgrid2 '; // These are not considered to build the sql queries (update,insert,delete)
//JavaScript Object attributes //JavaScript Object attributes
var $onUpdateField = ""; var $onUpdateField = "";
var $onDeleteField = ""; var $onDeleteField = "";
@@ -100,12 +103,14 @@ class propelTable
//Config Save definition //Config Save definition
var $__Configuration = 'orderBy,filter,fastSearch,style/*/showInTable'; //order,rowsPerPage,disableFooter'; var $__Configuration = 'orderBy,filter,fastSearch,style/*/showInTable'; //order,rowsPerPage,disableFooter';
//Variable for MasterDetail feature //Variable for MasterDetail feature
var $masterdetail = ''; var $masterdetail = '';
var $title; var $title;
/** /**
* Function prepareQuery * Function prepareQuery
*
* @author David S. Callizaya S. <davidsantos@colosa.com> * @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public * @access public
* @param string $limitPage * @param string $limitPage
@@ -121,8 +126,7 @@ class propelTable
foreach ($aSB as $sBy) { foreach ($aSB as $sBy) {
$subFilter .= ($subFilter !== '') ? ' OR ' : ''; $subFilter .= ($subFilter !== '') ? ' OR ' : '';
//TODO: Get DATABASE type from Criteria, I think sql delimeter is needed too //TODO: Get DATABASE type from Criteria, I think sql delimeter is needed too
$subFilter .= $sBy . ' LIKE "%'. $subFilter .= $sBy . ' LIKE "%' . G::sqlEscape( $this->fastSearch ) . '%"';
G::sqlEscape($this->fastSearch ).'%"';
} }
if ($subFilter !== '') { if ($subFilter !== '') {
//Get the first defined table in Criteria. //Get the first defined table in Criteria.
@@ -177,13 +181,14 @@ class propelTable
$this->criteria->addDescendingOrderByColumn( $field ); $this->criteria->addDescendingOrderByColumn( $field );
} }
} }
/** Add limits */ /**
* Add limits
*/
$this->criteria->setLimit( 0 ); $this->criteria->setLimit( 0 );
$this->criteria->setOffset( 0 ); $this->criteria->setOffset( 0 );
if ($this->criteria->getDbName() == 'dbarray') { if ($this->criteria->getDbName() == 'dbarray') {
$this->totRows = ArrayBasePeer::doCount( $this->criteria ); $this->totRows = ArrayBasePeer::doCount( $this->criteria );
} } else {
else {
$this->totRows = GulliverBasePeer::doCount( $this->criteria ); $this->totRows = GulliverBasePeer::doCount( $this->criteria );
} }
$this->totPages = ceil( $this->totRows / $this->rowsPerPage ); $this->totPages = ceil( $this->totRows / $this->rowsPerPage );
@@ -211,15 +216,20 @@ class propelTable
$this->id = $xmlForm->id; $this->id = $xmlForm->id;
//$this->sqlConnection=((isset($this->xmlForm->sqlConnection))?$this->xmlForm->sqlConnection:''); //$this->sqlConnection=((isset($this->xmlForm->sqlConnection))?$this->xmlForm->sqlConnection:'');
if (isset( $_GET['page'] )) if (isset( $_GET['page'] ))
$this->currentPage = $_GET['page']; else $this->currentPage = 1; $this->currentPage = $_GET['page'];
else
$this->currentPage = 1;
if (isset( $_GET['order'] )) if (isset( $_GET['order'] ))
$this->orderBy = urldecode($_GET['order']); else $this->orderBy = ""; $this->orderBy = urldecode( $_GET['order'] );
else
$this->orderBy = "";
if (isset( $_GET['filter'] )) if (isset( $_GET['filter'] ))
$this->filter = urldecode($_GET['filter']); else $this->filter = ""; $this->filter = urldecode( $_GET['filter'] );
else
$this->filter = "";
if ($xmlForm->ajaxServer != '') { if ($xmlForm->ajaxServer != '') {
$this->ajaxServer = G::encryptLink( $xmlForm->ajaxServer ); $this->ajaxServer = G::encryptLink( $xmlForm->ajaxServer );
} } else {
else {
$this->ajaxServer = G::encryptLink( '../gulliver/propelTableAjax' ); $this->ajaxServer = G::encryptLink( '../gulliver/propelTableAjax' );
} }
$this->ownerPage = G::encryptLink( SYS_CURRENT_URI ); $this->ownerPage = G::encryptLink( SYS_CURRENT_URI );
@@ -236,12 +246,13 @@ class propelTable
foreach ($this->masterdetail as $keyMasterDetail => $valueMasterDetail) { foreach ($this->masterdetail as $keyMasterDetail => $valueMasterDetail) {
$this->masterdetail[$keyMasterDetail] = trim( $valueMasterDetail ); $this->masterdetail[$keyMasterDetail] = trim( $valueMasterDetail );
} }
} } else {
else{
$this->masterdetail = array (); $this->masterdetail = array ();
} }
//Prepare the fields //Prepare the fields
$this->style=array();$this->gridWidth="";$this->gridFields=""; $this->style = array ();
$this->gridWidth = "";
$this->gridFields = "";
$this->fieldsType = array (); $this->fieldsType = array ();
foreach ($this->xmlForm->fields as $f => $v) { foreach ($this->xmlForm->fields as $f => $v) {
$r = $f; $r = $f;
@@ -254,7 +265,8 @@ class propelTable
//Set the default settings //Set the default settings
$this->defaultStyle(); $this->defaultStyle();
//continue with the setup //continue with the setup
$this->gridWidth=''; $this->gridFields=''; $this->gridWidth = '';
$this->gridFields = '';
foreach ($this->xmlForm->fields as $f => $v) { foreach ($this->xmlForm->fields as $f => $v) {
$r = $f; $r = $f;
//Parse the column properties //Parse the column properties
@@ -279,6 +291,7 @@ class propelTable
/** /**
* Function count * Function count
*
* @author David S. Callizaya S. <davidsantos@colosa.com> * @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public * @access public
* @return string * @return string
@@ -291,6 +304,7 @@ class propelTable
/** /**
* Function renderTitle * Function renderTitle
*
* @author David S. Callizaya S. <davidsantos@colosa.com> * @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public * @access public
* @return string * @return string
@@ -299,7 +313,8 @@ class propelTable
{ {
//fix the bug about showing hidden fields in propel table. //fix the bug about showing hidden fields in propel table.
foreach ($this->fields as $r => $rval) { foreach ($this->fields as $r => $rval) {
if ( $this->style[$r]['type'] == 'hidden') $this->style[$r]['showInTable'] = '0'; if ($this->style[$r]['type'] == 'hidden')
$this->style[$r]['showInTable'] = '0';
} }
//Render headers //Render headers
$this->colCount = 0; $this->colCount = 0;
@@ -310,9 +325,7 @@ class propelTable
$this->tpl->newBlock( "headers" ); $this->tpl->newBlock( "headers" );
$sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'ASC')) ? 'DESC' : 'ASC'); $sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'ASC')) ? 'DESC' : 'ASC');
$sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'DESC')) ? '' : $sortOrder); $sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'DESC')) ? '' : $sortOrder);
$this->style[$r]['href'] = $this->ownerPage . '?order=' . $this->style[$r]['href'] = $this->ownerPage . '?order=' . ($sortOrder !== '' ? (G::createUID( '', $this->fields[$r]['Name'] ) . '=' . $sortOrder) : '') . '&page=' . $this->currentPage;
( $sortOrder !=='' ? ( G::createUID('',$this->fields[$r]['Name'] ) . '=' . $sortOrder):'')
. '&page=' . $this->currentPage;
$this->style[$r]['onsort'] = $this->id . '.doSort("' . G::createUID( '', $this->fields[$r]['Name'] ) . '" , "' . $sortOrder . '");return false;'; $this->style[$r]['onsort'] = $this->id . '.doSort("' . G::createUID( '', $this->fields[$r]['Name'] ) . '" , "' . $sortOrder . '");return false;';
if (isset( $this->style[$r]['href'] )) if (isset( $this->style[$r]['href'] ))
$this->tpl->assign( "href", $this->style[$r]['href'] ); $this->tpl->assign( "href", $this->style[$r]['href'] );
@@ -338,8 +351,7 @@ class propelTable
$sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'ASC')) ? '<img src="/images/arrow-up.gif">' : ''); $sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'ASC')) ? '<img src="/images/arrow-up.gif">' : '');
$sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'DESC')) ? '<img src="/images/arrow-down.gif">' : $sortOrder); $sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'DESC')) ? '<img src="/images/arrow-down.gif">' : $sortOrder);
$this->tpl->assign( "header", $this->fields[$r]['Label'] . $sortOrder ); $this->tpl->assign( "header", $this->fields[$r]['Label'] . $sortOrder );
$this->tpl->assign('displaySeparator', $this->tpl->assign( 'displaySeparator', (($this->colCount == 0) || (! isset( $this->fields[$r]['Label'] )) || ($this->fields[$r]['Label'] === '')) ? 'display:none;' : '' );
(($this->colCount==0)||(!isset($this->fields[$r]['Label']))||($this->fields[$r]['Label']===''))?'display:none;':'');
} else { } else {
$this->tpl->assign( 'displaySeparator', 'display:none;' ); $this->tpl->assign( 'displaySeparator', 'display:none;' );
} }
@@ -352,6 +364,7 @@ class propelTable
/** /**
* Function renderField * Function renderField
*
* @author David S. Callizaya S. <davidsantos@colosa.com> * @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public * @access public
* @param eter string row * @param eter string row
@@ -381,16 +394,22 @@ class propelTable
$this->tpl->assign( "alignAttr", $alignAttr ); $this->tpl->assign( "alignAttr", $alignAttr );
$fieldName = $this->fields[$r]['Name']; $fieldName = $this->fields[$r]['Name'];
$fieldClass = get_class( $this->xmlForm->fields[$fieldName] ); $fieldClass = get_class( $this->xmlForm->fields[$fieldName] );
/*** BEGIN : Reeplace of @@, @%,... in field's attributes like onclick, link, */ /**
* * BEGIN : Reeplace of @@, @%,...
* in field's attributes like onclick, link,
*/
if (isset( $this->xmlForm->fields[$this->fields[$r]['Name']]->link )) { if (isset( $this->xmlForm->fields[$this->fields[$r]['Name']]->link )) {
$this->xmlForm->fields[ $this->fields[$r]['Name'] ]->link $this->xmlForm->fields[$this->fields[$r]['Name']]->link = G::replaceDataField( $this->style[$r]['link'], $result );
= G::replaceDataField($this->style[$r]['link'],$result);
} }
if (isset( $this->xmlForm->fields[$fieldName]->value )) { if (isset( $this->xmlForm->fields[$fieldName]->value )) {
$this->xmlForm->fields[$fieldName]->value = G::replaceDataField( $styleData['value'], $result ); $this->xmlForm->fields[$fieldName]->value = G::replaceDataField( $styleData['value'], $result );
} }
/*** END : Reeplace of @@, @%,... */ /**
/*** Rendering of the field */ * * END : Reeplace of @@, @%,...
*/
/**
* * Rendering of the field
*/
$this->xmlForm->fields[$fieldName]->mode = 'view'; $this->xmlForm->fields[$fieldName]->mode = 'view';
$this->xmlForm->setDefaultValues(); $this->xmlForm->setDefaultValues();
$this->xmlForm->setValues( $result ); $this->xmlForm->setValues( $result );
@@ -423,6 +442,7 @@ class propelTable
/** /**
* Function defaultStyle * Function defaultStyle
*
* @author David S. Callizaya S. <davidsantos@colosa.com> * @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public * @access public
* @return string * @return string
@@ -430,11 +450,8 @@ class propelTable
function defaultStyle () function defaultStyle ()
{ {
foreach ($this->fields as $r => $rval) { foreach ($this->fields as $r => $rval) {
$this->style[$r]=array( 'showInTable' => '1', $this->style[$r] = array ('showInTable' => '1','titleVisibility' => '1','colWidth' => '150','onclick' => '','event' => ''
'titleVisibility' => '1', );
'colWidth' => '150',
'onclick' => '',
'event' => '' );
//Some widths //Some widths
if (! (strpos( ' date linknew ', ' ' . $this->fields[$r]['Type'] . ' ' ) === FALSE)) if (! (strpos( ' date linknew ', ' ' . $this->fields[$r]['Type'] . ' ' ) === FALSE))
$this->style[$r]['colWidth'] = '70'; $this->style[$r]['colWidth'] = '70';
@@ -447,8 +464,7 @@ class propelTable
if (! isset( $this->style[$r]['showInTable'] )) { if (! isset( $this->style[$r]['showInTable'] )) {
if (! (strpos( ' title button endgrid2 submit password ', ' ' . $this->fields[$r]['Type'] . ' ' ) === FALSE)) { if (! (strpos( ' title button endgrid2 submit password ', ' ' . $this->fields[$r]['Type'] . ' ' ) === FALSE)) {
$this->style[$r]['showInTable'] = '0'; $this->style[$r]['showInTable'] = '0';
} } else {
else{
$this->style[$r]['showInTable'] = '1'; $this->style[$r]['showInTable'] = '1';
} }
} }
@@ -486,6 +502,7 @@ class propelTable
/** /**
* Function renderTable * Function renderTable
*
* @author David S. Callizaya S. <davidsantos@colosa.com> * @author David S. Callizaya S. <davidsantos@colosa.com>
* @param eter $block : = 'content'(Prints contentBlock only) * @param eter $block : = 'content'(Prints contentBlock only)
* @access public * @access public
@@ -508,7 +525,8 @@ class propelTable
$oHeadPublisher->addInstanceModule( 'leimnud', 'panel' ); $oHeadPublisher->addInstanceModule( 'leimnud', 'panel' );
$time_start = microtime( true ); $time_start = microtime( true );
$this->prepareQuery( true ); $this->prepareQuery( true );
$time_end = microtime(true); $time = $time_end - $time_start; $time_end = microtime( true );
$time = $time_end - $time_start;
// verify if there are templates folders registered, template and method folders are the same // verify if there are templates folders registered, template and method folders are the same
$folderTemplate = explode( '/', $this->template ); $folderTemplate = explode( '/', $this->template );
$oPluginRegistry = & PMPluginRegistry::getSingleton(); $oPluginRegistry = & PMPluginRegistry::getSingleton();
@@ -524,7 +542,9 @@ class propelTable
$this->tpl->assignGlobal( $key, $val ); //Changed to Global by JHL on Dec 14,2009.. then thes fields are available for all Blocks $this->tpl->assignGlobal( $key, $val ); //Changed to Global by JHL on Dec 14,2009.. then thes fields are available for all Blocks
} }
} }
/********** HEAD BLOCK ***************/ /**
* ******** HEAD BLOCK **************
*/
if (($block === '') || ($block === 'head')) { if (($block === '') || ($block === 'head')) {
$this->tpl->newBlock( 'headBlock' ); $this->tpl->newBlock( 'headBlock' );
$this->tpl->assign( 'pagedTable_Id', $this->id ); $this->tpl->assign( 'pagedTable_Id', $this->id );
@@ -541,9 +561,11 @@ class propelTable
$this->tpl->newBlock( 'headerBlock' ); $this->tpl->newBlock( 'headerBlock' );
$template = PATH_CORE . 'templates' . PATH_SEP . $menu->type . '.html'; $template = PATH_CORE . 'templates' . PATH_SEP . $menu->type . '.html';
$menu->setValues( $this->xmlForm->values ); $menu->setValues( $this->xmlForm->values );
$menu->setValues(array( 'PAGED_TABLE_ID' => $this->id )); $menu->setValues( array ('PAGED_TABLE_ID' => $this->id
) );
if (isset( $filterForm->name )) { if (isset( $filterForm->name )) {
$menu->setValues(array('SEARCH_FILTER_FORM' => $filterForm->name)); $menu->setValues( array ('SEARCH_FILTER_FORM' => $filterForm->name
) );
} }
$this->tpl->assign( 'content', $menu->render( $template, $scriptCode ) ); $this->tpl->assign( 'content', $menu->render( $template, $scriptCode ) );
$oHeadPublisher->addScriptFile( $menu->scriptURL ); $oHeadPublisher->addScriptFile( $menu->scriptURL );
@@ -556,8 +578,10 @@ class propelTable
$filterForm->ajaxServer = '../gulliver/defaultAjax'; $filterForm->ajaxServer = '../gulliver/defaultAjax';
$template = PATH_CORE . 'templates/' . $filterForm->type . '.html'; $template = PATH_CORE . 'templates/' . $filterForm->type . '.html';
$filterForm->setValues( $this->xmlForm->values ); $filterForm->setValues( $this->xmlForm->values );
$filterForm->setValues(array('PAGED_TABLE_ID' => $this->id )); $filterForm->setValues( array ('PAGED_TABLE_ID' => $this->id
$filterForm->setValues(array( 'PAGED_TABLE_FAST_SEARCH' => $this->fastSearch )); ) );
$filterForm->setValues( array ('PAGED_TABLE_FAST_SEARCH' => $this->fastSearch
) );
$this->tpl->assign( 'content', $filterForm->render( $template, $scriptCode ) ); $this->tpl->assign( 'content', $filterForm->render( $template, $scriptCode ) );
$oHeadPublisher->addScriptFile( $filterForm->scriptURL ); $oHeadPublisher->addScriptFile( $filterForm->scriptURL );
$oHeadPublisher->addScriptCode( $scriptCode ); $oHeadPublisher->addScriptCode( $scriptCode );
@@ -567,7 +591,9 @@ class propelTable
} }
/********** CONTENT BLOCK ***************/ /**
* ******** CONTENT BLOCK **************
*/
if (($block === '') || ($block === 'content')) { if (($block === '') || ($block === 'content')) {
$this->tpl->newBlock( 'contentBlock' ); $this->tpl->newBlock( 'contentBlock' );
$this->tpl->assign( 'gridWidth', '=[' . substr( $this->gridWidth, 1 ) . ']' ); $this->tpl->assign( 'gridWidth', '=[' . substr( $this->gridWidth, 1 ) . ']' );
@@ -589,8 +615,7 @@ class propelTable
//Render rows //Render rows
if ($this->criteria->getDbName() == 'dbarray') { if ($this->criteria->getDbName() == 'dbarray') {
$rs = ArrayBasePeer::doSelectRs( $this->criteria ); $rs = ArrayBasePeer::doSelectRs( $this->criteria );
} } else {
else {
$rs = GulliverBasePeer::doSelectRs( $this->criteria ); $rs = GulliverBasePeer::doSelectRs( $this->criteria );
} }
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
@@ -652,7 +677,8 @@ class propelTable
} }
} }
$this->tpl->gotoblock( "row" ); $this->tpl->gotoblock( "row" );
if ( !isset($rowName) ) $rowName = array(); if (! isset( $rowName ))
$rowName = array ();
$this->tpl->assign( "rowName", implode( ",", $rowName ) ); $this->tpl->assign( "rowName", implode( ",", $rowName ) );
} }
//End Master Detail: This enable the MasterDEtail view //End Master Detail: This enable the MasterDEtail view
@@ -668,8 +694,7 @@ class propelTable
$this->xmlForm->setValues( $result1 ); $this->xmlForm->setValues( $result1 );
$this->tdStyle = $this->xmlForm->fields[$this->fields[$r]['Name']]->tdStyle( $result1, $this->xmlForm ); $this->tdStyle = $this->xmlForm->fields[$this->fields[$r]['Name']]->tdStyle( $result1, $this->xmlForm );
$this->tdClass = $this->xmlForm->fields[$this->fields[$r]['Name']]->tdClass( $result1, $this->xmlForm ); $this->tdClass = $this->xmlForm->fields[$this->fields[$r]['Name']]->tdClass( $result1, $this->xmlForm );
} } elseif ($this->style[$r]['showInTable'] != '0') {
elseif ($this->style[$r]['showInTable'] != '0' ){
if (($this->style[$r]['showInTable'] != '0') && (! (in_array( $this->fields[$r]['Name'], $this->masterdetail )))) if (($this->style[$r]['showInTable'] != '0') && (! (in_array( $this->fields[$r]['Name'], $this->masterdetail ))))
$this->renderField( $j + 1, $r, $result ); $this->renderField( $j + 1, $r, $result );
} }
@@ -686,8 +711,7 @@ class propelTable
$prevAjax = $this->id . ".doGoToPage(" . $prevpage . ");return false;"; $prevAjax = $this->id . ".doGoToPage(" . $prevpage . ");return false;";
$first = "<a href=\"" . htmlentities( $firstUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $firstAjax . "\" class='firstPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>"; $first = "<a href=\"" . htmlentities( $firstUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $firstAjax . "\" class='firstPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>";
$prev = "<a href=\"" . htmlentities( $prevUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $prevAjax . "\" class='previousPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>"; $prev = "<a href=\"" . htmlentities( $prevUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $prevAjax . "\" class='previousPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>";
} } else {
else{
$first = "<a class='noFirstPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>"; $first = "<a class='noFirstPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>";
$prev = "<a class='noPreviousPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>"; $prev = "<a class='noPreviousPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>";
} }
@@ -699,8 +723,7 @@ class propelTable
$nextAjax = $this->id . ".doGoToPage(" . $nextpage . ");return false;"; $nextAjax = $this->id . ".doGoToPage(" . $nextpage . ");return false;";
$next = "<a href=\"" . htmlentities( $nextUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $nextAjax . "\" class='nextPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>"; $next = "<a href=\"" . htmlentities( $nextUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $nextAjax . "\" class='nextPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>";
$last = "<a href=\"" . htmlentities( $lastUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $lastAjax . "\" class='lastPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>"; $last = "<a href=\"" . htmlentities( $lastUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $lastAjax . "\" class='lastPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>";
} } else {
else{
$next = "<a class='noNextPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>"; $next = "<a class='noNextPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>";
$last = "<a class='noLastPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>"; $last = "<a class='noLastPage'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>";
} }
@@ -717,7 +740,8 @@ class propelTable
$this->tpl->newBlock( 'norecords' ); $this->tpl->newBlock( 'norecords' );
$this->tpl->assign( "columnCount", $this->colCount ); $this->tpl->assign( "columnCount", $this->colCount );
$noRecordsFound = 'ID_NO_RECORDS_FOUND'; $noRecordsFound = 'ID_NO_RECORDS_FOUND';
if (G::LoadTranslation($noRecordsFound)) $noRecordsFound = G::LoadTranslation($noRecordsFound); if (G::LoadTranslation( $noRecordsFound ))
$noRecordsFound = G::LoadTranslation( $noRecordsFound );
$this->tpl->assign( "noRecordsFound", $noRecordsFound ); $this->tpl->assign( "noRecordsFound", $noRecordsFound );
} }
if (! $this->disableFooter) { if (! $this->disableFooter) {
@@ -773,7 +797,9 @@ var popupHeight<?php echo '='.$this->popupHeight?>;
</script> </script>
<?php <?php
} }
/********** CLOSE BLOCK ***************/ /**
* ******** CLOSE BLOCK **************
*/
if (($block === '') || ($block === 'close')) { if (($block === '') || ($block === 'close')) {
$this->tpl->newBlock( "closeBlock" ); $this->tpl->newBlock( "closeBlock" );
} }
@@ -790,14 +816,17 @@ var popupHeight<?php echo '='.$this->popupHeight?>;
$this->fastSearch = ''; $this->fastSearch = '';
return; return;
} }
/** /**
* Function printForm * Function printForm
*
* @param string $filename * @param string $filename
* @param array $data * @param array $data
* @return void * @return void
*/ */
function printForm ($filename, $data = array()) function printForm ($filename, $data = array())
{ global $G_PUBLISH; {
global $G_PUBLISH;
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $filename, '', $data, $this->popupSubmit ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', $filename, '', $data, $this->popupSubmit );
G::RenderPage( "publish", "blank" ); G::RenderPage( "publish", "blank" );