function SearchForm()
 {
     $query = isset($_GET['CommentSearch']) ? $_GET['CommentSearch'] : null;
     $searchFields = new FieldGroup(new TextField('CommentSearch', _t('CommentTableField.SEARCH', 'Search'), $query), new HiddenField("ctf[ID]", '', $this->mode), new HiddenField('CommentFieldName', '', $this->name));
     $actionFields = new LiteralField('CommentFilterButton', '<input type="submit" name="CommentFilterButton" value="' . _t('CommentTableField.FILTER', 'Filter') . '" id="CommentFilterButton"/>');
     $fieldContainer = new FieldGroup($searchFields, $actionFields);
     return $fieldContainer->FieldHolder();
 }
 public function FieldHolder()
 {
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-metadata/jquery.metadata.js');
     Requirements::javascript('dataobject_manager/code/dropdown_fields/javascript/filtered_dropdown_set.js');
     foreach ($this->children as $child) {
         $meta = "'updateLink': '" . $this->Link('update') . "'";
         if ($str = $child->getEmptyString()) {
             $meta .= ",'emptyString': '" . $child->getEmptyString() . "'";
         }
         $child->addExtraClass("{" . $meta . "}");
     }
     return parent::FieldHolder();
 }
    public function FieldHolder($properties = array())
    {
        Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
        Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
        Requirements::javascript(THIRDPARTY_DIR . '/jquery-metadata/jquery.metadata.js');
        //Requirements::javascript(MAPPABLE_MODULE_PATH.'/javascript/mapField.js');
        $js = '
		<script type="text/javascript">
var latFieldName = "' . $this->latField . '";
var lonFieldName = "' . $this->longField . '";
var zoomFieldName = "' . $this->zoomField . '";
		</script>
	';
        Requirements::javascript(MAPPABLE_MODULE_PATH . '/javascript/mapField.js');
        $attributes = array('class' => 'editableMap', 'id' => 'GoogleMap', 'data-LatFieldName' => $this->latField, 'data-LonFieldName' => $this->longField, 'data-ZoomFieldName' => $this->zoomField, 'data-UseMapBounds' => false);
        Requirements::css('mappable/css/mapField.css');
        $guidePointsJSON = '';
        if (isset($this->guidePoints)) {
            $latlongps = array();
            foreach ($this->guidePoints as $guidepoint) {
                array_push($latlongps, array('latitude' => $guidepoint->Lat, 'longitude' => $guidepoint->Lon));
            }
            $guidePointsJSON = json_encode($latlongps);
            // convert the mappable guidepoints to lat lon
            $attributes['data-GuidePoints'] = $guidePointsJSON;
            // we only wish to change the bounds to those of all the points iff
            // the item currently has no location
            $attributes['data-useMapBounds'] = true;
        }
        $content = '<div class="editableMapWrapper">' . $this->createTag("div", $attributes) . '</div>';
        $this->FieldList()->push(new LiteralField('locationEditor', $content));
        $content2 = '<div id="mapSearch">
		 <input name="location_search" id="location_search" size=80/>
    	<button class="action" id="searchLocationButton">Search Location Name</button>
      		<div id="mapSearchResults">
      	</div>
	    </div>
	    ';
        $this->FieldList()->push(new LiteralField('mapSearch', $content2));
        return parent::FieldHolder();
    }
	/**
	 * Provide some HTML for a search form, to be 
	 * added above the AssetTable field, allowing
	 * a user to filter the current table's files
	 * by their filename.
	 *
	 * @return string HTML for search form
	 */
	function SearchForm() {
		$searchFields = new FieldGroup(
			new TextField('FileSearch', _t('MemberTableField.SEARCH', 'Search'), $this->searchingFor),
			new HiddenField("ctf[ID]", '', $this->ID),
			new HiddenField('FileFieldName', '', $this->name)
		);

		$actionFields = new LiteralField(
			'FileFilterButton',
			'<input type="submit" class="action" name="FileFilterButton" value="' . _t('MemberTableField.FILTER', 'Filter') . '" id="FileFilterButton"/>'
		);
		
		$fieldContainer = new FieldGroup(
			$searchFields,
			$actionFields
		);

		return $fieldContainer->FieldHolder();
	}
 public function FieldHolder()
 {
     $addForm = new FieldGroup(array($textField = new TextField($this->Name() . '_quickAdd', $this->addTitle), new LiteralField('', '<a class="quickadd" href="#">Add &#43;</a>')));
     $textField->addExtraClass('quickadd');
     return '<div class="quickAddHolder">' . parent::FieldHolder() . $addForm->FieldHolder() . '</div>';
 }
Ejemplo n.º 6
0
 function SearchForm()
 {
     $groupID = isset($this->group) ? $this->group->ID : 0;
     $query = isset($_GET['MemberSearch']) ? $_GET['MemberSearch'] : null;
     $searchFields = new FieldGroup(new TextField('MemberSearch', _t('MemberTableField.SEARCH', 'Search'), $query), new HiddenField("ctf[ID]", '', $groupID), new HiddenField('MemberFieldName', '', $this->name), new HiddenField('MemberDontShowPassword', '', $this->hidePassword));
     $actionFields = new LiteralField('MemberFilterButton', '<input type="submit" class="action" name="MemberFilterButton" value="' . _t('MemberTableField.FILTER', 'Filter') . '" id="MemberFilterButton"/>');
     $fieldContainer = new FieldGroup($searchFields, $actionFields);
     return $fieldContainer->FieldHolder();
 }
Ejemplo n.º 7
0
 /**
  * Provide some HTML for a search form, to be 
  * added above the AssetTable field, allowing
  * a user to filter the current table's files
  * by their filename.
  *
  * @return string HTML for search form
  */
 function SearchForm()
 {
     $fieldContainer = new FieldGroup(new FieldGroup(new TextField('FileSearch', _t('MemberTableField.SEARCH', 'Search'), $this->searchingFor)), new FieldGroup($btnFilter = new InlineFormAction('FileFilterButton', _t('MemberTableField.FILTER', 'Filter')), $btnClear = new InlineFormAction('FileFilterClearButton', _t('AssetTableField.CLEAR', 'Clear'))));
     $btnFilter->includeDefaultJS(false);
     $btnClear->includeDefaultJS(false);
     return $fieldContainer->FieldHolder();
 }
Ejemplo n.º 8
0
 function SearchForm()
 {
     $searchFields = new FieldGroup(new TextField('MemberSearch', _t('MemberTableField.SEARCH', 'Search')), new HiddenField("ctf[ID]", '', $this->group->ID), new HiddenField('MemberFieldName', '', $this->name), new HiddenField('MemberDontShowPassword', '', $this->hidePassword));
     $orderByFields = new FieldGroup(new LabelField(_t('MemberTableField.ORDERBY', 'Order by')), new FieldSet(new DropdownField('MemberOrderByField', '', array('FirstName' => _t('MemberTableField.FIRSTNAME', 'FirstName'), 'Surname' => _t('MemberTableField.SURNAME', 'Surname'), 'Email' => _t('MemberTableField.EMAIL', 'Email'))), new DropdownField('MemberOrderByOrder', '', array('ASC' => _t('MemberTableField.ASC', 'Ascending'), 'DESC' => _t('MemberTableField.DESC', 'Descending')))));
     $groups = DataObject::get('Group');
     $groupArray = array('' => _t('MemberTableField.ANYGROUP', 'Any group'));
     foreach ($groups as $group) {
         $groupArray[$group->ID] = $group->Title;
     }
     $groupFields = new DropdownField('MemberGroup', _t('MemberTableField.FILTERBYGROUP', 'Filter by group'), $groupArray);
     $actionFields = new LiteralField('MemberFilterButton', '<input type="submit" class="action" name="MemberFilterButton" value="' . _t('MemberTableField.FILTER', 'Filter') . '" id="MemberFilterButton"/>');
     $fieldContainer = new FieldGroup($searchFields, $actionFields);
     return $fieldContainer->FieldHolder();
 }
Ejemplo n.º 9
0
 function OrderByField()
 {
     $fields = new FieldGroup(new DropdownField('MemberListOrderByField', '', array('FirstName' => _t('MemberList.FN', 'FirstName'), 'Surname' => _t('MemberList.SN', 'Surname'), 'Email' => _t('MemberList.EMAIL', 'Email'))), new DropdownField('MemberListOrderByOrder', '', array('ASC' => _t('MemberList.ASC', 'Ascending'), 'DESC' => _t('MemberList.DESC', 'Descending'))));
     $field = new FieldGroup(new LabelField(_t('MemberList.ORDERBY', 'Order by')), $fields);
     return $field->FieldHolder();
 }
 /**
  * Just includes the CSS used for layout
  */
 function FieldHolder($properties = array())
 {
     Requirements::css(basename(dirname(__DIR__)) . '/css/TextFieldGroup.css');
     return parent::FieldHolder($properties);
 }