Overview

Packages

  • Auth
    • Ads
    • Ldap
    • Xoops
  • Autotasks
  • Config
    • Category
    • Item
    • Option
  • Core
    • Filesystem
    • Filters
    • Logger
    • Mail
    • Message
    • Password
    • Security
    • StopSpammer
    • Template
    • Textsanitizer
    • VersionChecker
  • Data
    • Avatar
    • Comment
  • Database
    • Connection
    • Criteria
    • Legacy
    • MySQL
    • PDO
    • Updater
  • Feeds
    • RSS
  • File
  • Form
    • Base
    • Elements
  • ICMS
    • IPF
      • View
  • Image
    • Category
  • Ipf
    • Category
    • Controller
    • Export
    • form
    • Keyhighlighter
    • Member
    • Object
    • Permission
    • richfile
    • Tree
    • urllink
    • View
  • kernel
    • Set
  • Member
    • Group
    • GroupMembership
    • GroupPermission
    • User
  • Messaging
  • Module
  • None
  • Notification
  • Page
  • Plugins
    • Editor
  • Preload
    • Libraries
  • Privmessage
  • Session
  • SmartObject
  • View
    • Block
    • Breadcrumb
    • PageNav
    • PrinterFriendly
    • Template
    • Templates
    • Theme
    • Tree

Classes

  • icms_ipf_form_elements_Autocomplete
  • icms_ipf_form_elements_Richfile
  • Overview
  • Package
  • Class

Class icms_ipf_form_elements_Autocomplete

To make the Autocomplete field work, the include file needs to look like the following (in this example the Autocomplete field would use the conf_name field of the config table as a lookup):

include "mainfile.php"; icms::$logger->disableLogger(); $sql = "SELECT * FROM " . icms::$xoopsDB->prefix("config") . " WHERE conf_name LIKE '%" . $_GET['term'] . "%'"; $result = icms::$xoopsDB->query($sql); while ($myrow = icms::$xoopsDB->fetchArray($result)) $ret[] = array("item" => $myrow["conf_name"]); echo $_GET["callback"] . "(" . json_encode($ret) . ")";

Important: - use control parameter "file" to specify the include file for the autocomplete - the include file must be specified without ICMS_URL or ICMS_ROOT_PATH - if the include file does not exist, the form field is displayed as a text field - use control parameter "minlength" to specify the minimum amount of characters before the autocomplete function starts to work (default: 3) - use control parameter "delay" to specify the delay before the autocomplete function starts to work. Use with caution since it can result in high server load! (default: 500)

icms_form_Element
Extended by icms_form_elements_Text
Extended by icms_ipf_form_elements_Autocomplete
Package: ipf\form
Copyright: The ImpressCMS Project http://www.impresscms.org/
License: GNU General Public License (GPL)
Author: marcan marcan@impresscms.org
Located at ipf/form/elements/Autocomplete.php
Methods summary
public
# __construct( icms_ipf_Object $object, string $key )

Constructor

Constructor

Parameters

$object
reference to targetobject (@link icms_ipf_Object)
$key
the form name

Overrides

icms_form_elements_Text::__construct()
public string
# render( )

Prepare HTML for output

Prepare HTML for output

Returns

string
$ret the constructed HTML

Overrides

icms_form_elements_Text::render()
Methods inherited from icms_form_elements_Text
getMaxlength(), getSize(), getValue(), setValue()
Methods inherited from icms_form_Element
getAccessKey(), getAccessString(), getCaption(), getClass(), getDescription(), getExtra(), getName(), isContainer(), isHidden(), isRequired(), renderValidationJS(), setAccessKey(), setCaption(), setClass(), setDescription(), setExtra(), setHidden(), setName(), setRequired()
Properties inherited from icms_form_elements_Text
$autocomplete
Properties inherited from icms_form_Element
$_caption, $_name, $customValidationCode
API documentation generated by ApiGen