Source for file designide.inc.php
Documentation is available at designide.inc.php
* This file is part of the VCL for PHP project
* Copyright (c) 2004-2007 qadram software <support@qadram.com>
* Checkout AUTHORS file for more information on the developers
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* Specifies to the IDE the title of this package
* @param string $packageTitle
echo "packageTitle=$packageTitle\n";
* Specifies to the IDE the path to the icons for the components contained in this package (relative to the VCL path)
* @param string $iconPath
echo "iconPath=$iconPath\n";
* Registers components inside the IDE and places into the right palette page, it also allows the IDE to add the right unit to the source
* @param array $components
while (list ($k,$v)= each($components))
* Registers an asset for the Deployment wizard
* @param array $components Array of components you want to register the asset
* @param array $assets Array of folders you want to get copied when this component is used
while (list ($k,$v)= each($components))
while (list ($c,$asset)= each($assets))
echo "value=". $asset. "\n";
* Registers a component editor to be used by a component when right clicking on it
* @param string $classname
* @param string $componenteditorclassname
* @param string $unitname
echo "componentclassname=$classname\n";
echo "componenteditorname=$componenteditorclassname\n";
echo "componenteditorunitname=$unitname\n";
* Registers a property editor to edit an specific property
* @param string $classname It can be an ancestor, property editors are also inherited
* @param string $property Property Name
* @param string $propertyclassname Property Editor class name
* @param string $unitname Unit that holds the property editor class
echo "classname=$classname\n";
echo "property=$property\n";
echo "propertyeditor=$propertyclassname\n";
echo "propertyeditorunitname=$unitname\n";
* Register values to be shown for a dropdown property
* @param string $classname
* @param string $property
echo "classname=$classname\n";
echo "property=$property\n";
while (list ($k,$v)= each($values))
* Registers a boolean property, so the Object Inspector offers a true/false dropdown
* @param string $classname
* @param string $property
$values= array('false','true');
echo "classname=$classname\n";
echo "property=$property\n";
while (list ($k,$v)= each($values))
* Registers a password property, so the Object Inspector doesn't show the value
* @param string $classname
* @param string $property
echo "classname=$classname\n";
echo "property=$property\n";
echo "value=password_protected\n";
* Register a component to be available but not visible
* @param array $components
while (list ($k,$v)= each($components))
* Base class for property editors
* Return specific attributes for the OI
* If required, returns a path to become the document root for the webserver to call the property editor
* Executes the property editor
* @param string $current_value Current property value
* Base class for component editors
* Return here an array of items to show when right clicking a component
* Depending on the verb, perform any action you want
* @param integer $verb Index of the verb the IDE wants to execute
class ColorPropertyEditor extends PropertyEditor
$result.="caption=Color Property editor - Copyright (c) 2000-02 Michael Bystrom\n";
return(dirname(__FILE__).'/resources/colorpropertyeditor/');
function Execute($current_value)
$this->value=$current_value;
if (isset($_POST['selcolor']))
echo urldecode($_POST['selcolor']);
if ($this->value=="") $this->value="#FFFFFF";
use_unit("resources/colorpropertyeditor/colorpicker.php");
* Editor for Color properties
$result.= "caption=Color Property editor\n";
return(dirname(__FILE__ ). '/resources/coloreditor/');
$this->value= $current_value;
if (isset ($_POST['selcolor']))
use_unit("resources/coloreditor/coloreditor.php");
* Property Editor for StringLists
$result.= "caption=StringList Editor\n";
return(dirname(__FILE__ ). '/resources/stringlisteditor/');
$this->value= $current_value;
if (isset ($_POST['listeditor']))
if (trim($_POST['action'])== 'OK')
$value= $_POST['listeditor'];
//Carriage returns must be converted properly
use_unit("resources/stringlisteditor/stringlisteditor.php");
* Array editor - not finished
$result.= "caption=Array Editor\n";
return(dirname(__FILE__ ). '/resources/arrayeditor/');
$this->value= $current_value;
if (isset ($_POST['btnOk']))
use_unit("resources/arrayeditor/arrayeditor.php");
$items= $ArrayEditor->tvItems->Items;
elseif (isset ($_POST['btnCancel']))
use_unit("resources/arrayeditor/arrayeditor.php");
* Items property editor, for menus and treeviews
$result.= "caption=Items Editor\n";
return(dirname(__FILE__ ). '/resources/menuitemeditor/');
* Converts a JS array to a PHP array
list ($k,$props)= each($input);
while (list ($k,$child)= each($input))
if (isset ($props[1])) $tag= $props[1];
$output[]= array('Caption'=> $caption,'Tag'=> $tag, 'Items'=> $children);
$output[]= array('Caption'=> $caption, 'Tag'=> $tag);
$this->value= $current_value;
if (isset ($_POST['items']))
$json_string= $_POST['items'];
$json = new Services_JSON();
$array= $json->decode($json_string);
$finalarray= $phparray[0]['Items'];
echo "newvalue:\n". serialize($finalarray). "\n";
use_unit("resources/menuitemeditor/menuitemeditor.php");
* HTML property editor, for captions and so on
$result.= "caption=HTML Property editor (Xinha based)\n";
return(dirname(__FILE__ ). '/resources/xinha/');
$this->value= $current_value;
if (isset ($_POST['myTextArea']))
use_unit("resources/xinha/htmlpropertyeditor.php");
* Image property editor - not finished
// $result="sizeable=1\n";
// $result.="width=740\n";
// $result.="height=540\n";
$result.= "caption=Image Property editor (Xinha based)\n";
return(dirname(__FILE__ ). '/resources/xinha/plugins/ImageManager/');
$this->value= $current_value;
if (isset ($_POST['f_url']))
use_unit("resources/xinha/plugins/ImageManager/imagepropertyeditor.php");
echo "Create Dictionary\n";
if ($this->component->createDictionaryTable())
echo "Dictionary created";
echo "Error creating Dictionary. Please check the connection settings and the Dictionary property.";
|