Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
  • 4 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
View
3  includes/qcodo/_core/codegen/templates/db_orm/drafts/_qform_edit.tpl
@@ -1,7 +1,8 @@
<template OverwriteFlag="true" DocrootFlag="true" DirectorySuffix="" TargetDirectory="<%= __FORM_DRAFTS__ %>" TargetFileName="<%= QConvertNotation::UnderscoreFromCamelCase($objTable->ClassName) %>_edit.php"/>
<?php
// Load the Qcodo Development Framework
- require(dirname(__FILE__) . '/../../includes/prepend.inc.php');
+ require(__DOCROOT__ . __PHP_ASSETS__ . '/_require_prepend.inc.php');
+
/**
* This is a quick-and-dirty draft QForm object to do Create, Edit, and Delete functionality
View
3  includes/qcodo/_core/codegen/templates/db_orm/drafts/_qform_list.tpl
@@ -1,7 +1,8 @@
<template OverwriteFlag="true" DocrootFlag="true" DirectorySuffix="" TargetDirectory="<%= __FORM_DRAFTS__ %>" TargetFileName="<%= QConvertNotation::UnderscoreFromCamelCase($objTable->ClassName) %>_list.php"/>
<?php
// Load the Qcodo Development Framework
- require(dirname(__FILE__) . '/../../includes/prepend.inc.php');
+ require(__DOCROOT__ . __PHP_ASSETS__ . '/_require_prepend.inc.php');
+
/**
* This is a quick-and-dirty draft QForm object to do the List All functionality
View
9 includes/qcodo/_core/qform/QDataGridBase.class.php
@@ -571,12 +571,21 @@ protected function GetDataGridRowHtml($objObject) {
(!is_null($this->objOverrideRowStyleArray[$this->intCurrentRowIndex])))
$objStyle = $objStyle->ApplyOverride($this->objOverrideRowStyleArray[$this->intCurrentRowIndex]);
+ if ($override = $this->GetRowOverride ($this->intCurrentRowIndex, $objObject)) {
+ $objStyle = $objStyle->ApplyOverride($override);
+ }
+
// Finish up
$strToReturn = sprintf(" <tr id=\"%s_row%s\" %s>\r\n%s </tr>\r\n", $this->strControlId, $this->intCurrentRowIndex, $objStyle->GetAttributes(), $strColumnsHtml);
$this->intCurrentRowIndex++;
return $strToReturn;
}
+ // Override this function and return an override to a particular row based on its content
+ protected function GetRowOverride ($rowIndex, $obj) {
+ return null;
+ }
+
protected function GetFooterRowHtml() {}
protected function GetControlHtml() {
View
25 includes/qcodo/_core/qform/QListControl.class.php
@@ -94,6 +94,31 @@ public function AddItemAt($intIndex, QListItem $objListItem) {
$this->objItemsArray[$intIndex] = $objListItem;
}
+ // Use this to add an array of items, or an array of key=>value pairs. Convenient for adding a list from a type table.
+ // When passing key=>val pairs, mixSelectedValues can be an array, or just a single value to compare against to indicate what is selected
+ public function AddItems (array $mixItemArray, $mixSelectedValues = null, $strItemGroup = null, $strOverrideParameters = null) {
+ $this->blnModified = true;
+ try {
+ $mixItemArray = QType::Cast($mixItemArray, QType::ArrayType);
+ } catch (QInvalidCastException $objExc) {
+ $objExc->IncrementOffset();
+ throw $objExc;
+ }
+
+ foreach ($mixItemArray as $val=>$item) {
+ $blnSelected = false;
+ if ($mixSelectedValues) {
+ if (gettype($mixSelectedValues) == QType::ArrayType) {
+ $blnSelected = in_array ($val, $mixSelectedValues);
+ }
+ else {
+ $blnSelected = ($val == $mixSelectedValues);
+ }
+ }
+ $this->AddItem ($item, $val, $blnSelected, $strItemGroup, $strOverrideParameters);
+ };
+ }
+
// Gets the ListItem at a specific location in objItemsArray
public function GetItem($intIndex) {
try {
View
7 includes/qcodo/_core/qform/_events.inc.php
@@ -152,4 +152,11 @@ class QDownArrowKeyEvent extends QKeyDownEvent {
protected $strCondition = 'event.keyCode == 40';
}
}
+
+ // the one key supported by all browsers
+ // Note that on the Mac, if in a text field, making this a QKeyPressEvent will not work.
+ class QBackspaceKeyEvent extends QKeyDownEvent {
+ protected $strCondition = 'event.keyCode == 8';
+ }
+
?>
View
2  www/drafts/index.php
@@ -1,6 +1,6 @@
<?php
// Include prepend.inc to load Qcodo
- require(dirname(__FILE__) . '/../../includes/prepend.inc.php');
+ require(__DOCROOT__ . __PHP_ASSETS__ . '/_require_prepend.inc.php');
// Security check for ALLOW_REMOTE_ADMIN
// To allow access REGARDLESS of ALLOW_REMOTE_ADMIN, simply remove the line below

No commit comments for this range

Something went wrong with that request. Please try again.