Ejemplo n.º 1
0
 /**
  * Return compound rowid for table row to be posted back as post data by Javascript.
  * 
  * Use a checksum to make it difficult to tamper with the ids.
  * 
  */
 private function getRowId($rowData)
 {
     $primaryKeys = (array) $this->settings['primaryKey'];
     $primaryKeyIds = array();
     foreach ($primaryKeys as $column) {
         if (!array_key_exists($column, $rowData)) {
             DBG::printr($rowData);
             throw new coreException(__METHOD__);
         }
         $primaryKeyIds[] = $rowData[$column];
     }
     $sPrimaryKeys = implode('', $primaryKeyIds);
     $checksum = md5(self::CHECKSUM_MAGICWORD . $sPrimaryKeys);
     array_unshift($primaryKeyIds, $checksum);
     return implode(self::COMPOUNDROWID_SEPARATOR, $primaryKeyIds);
 }
Ejemplo n.º 2
0
?>

<?php 
echo input_tag('variable', '"""', array('class' => 'textfield'));
?>
&nbsp;&nbsp;<?php 
echo submit_tag('Test GET Variable Encoding');
?>

</form>

<p> <?php 
$vars = array('variable' => '&amp;');
echo link_to('test', 'test/urlEncoding', array('query_string' => http_build_query($vars)));
?>

<p> <?php 
echo coreContext::getInstance()->getController()->genUrl(array('module' => 'test', 'action' => 'urlEncoding', 'item' => '"""'));
?>

<h2>$_GET</h2>

<?php 
DBG::printr($_GET);
?>

<h2>$_request</h2>

<?php 
DBG::printr($_request->getParameterHolder()->getAll());