class GuppyInput_yourplug extends GuppyInput{
function render($guppy){
[style stuff ...]
// OPTIONAL : i sometime check for URL input,
// useful to preselect option
if( $this->value == "" ){
$this->value = pnVarCleanFromInput("some_id");
}
////////////////GET THE PUBS
if( pnModAPILoad("pagesetter", "user") ){
$args["tid"] = 1;
$args["orderByStr"] = "title";
$args["noOfItems"] = 999; //
$catcher = pnModAPIFunc("pagesetter", "user", "getPubList", $args);
}
// GENERATE THE SELECT
$bag = "<SELECT name=\"" . $this->name . "\" id=\"" . $this->ID . "\" class=\"$htmlClass\" $style >\n";
//OPTIONAL: uncomment the following line to allow root node selection,
// useful in when in a tree-like environment
// $bag .= "<OPTION value='-1'> -- root node -- </OPTION>";
foreach($catcher["publications"] as $i){
$bag .= "<OPTION value='$i[pid]'";
if( $i["pid"] == $this->value ){
$bag .= " selected='SELECTED'";
}
$bag .=">$i[title]</OPTION>\n";
}
$bag .= "</SELECT>";
return $bag;
}function render($guppy){
// GET THE VALUES
$values = explode(";", $this->value);
...
//GET PUBS
...
$bag = "<SELECT name=\"" . $this->name . "[]\" id=\"" . $this->ID . "\" class=\"$htmlClass\" $style multiple=\"multiple\">\n";
foreach($catcher["publications"] as $i){
$bag .= "<OPTION value='$i[pid]'";
foreach($values as $v){
if( $v == $i[pid]){
$bag .= " selected='SELECTED'";
break;
}
}
$bag .=">$i[title]</OPTION>\n";
}
$bag .= "</SELECT>";
return $bag;
}function decode()
{
foreach( $_POST[$this->name] as $i){
$bag .= "$i;";
}
$this->value = $bag;
// REST OF FUNCTION
}function smarty_function_pagesetter_getusers ($params, &$smarty)
{
//IN: $uids, our semi-colon separated string
extract($params);
unset($params);
$uids = explode(";", $uids);
foreach($uids as $uid){
$users[] = pnUserGetVars($uid);
}
if (isset($assign)) {
$smarty->assign($assign, $users);
} else {
$smarty->assign("users", $users);
}
}<a href="index.php?module=pagesetter&func=viewpub&tid=4&pid=<!--[$previous_pub]-->">Previous Pub</a>
<a href="index.php?module=pagesetter&func=viewpub&tid=4&pid=<!--[$next_pub]-->">Next Pub</a>Template courtesy of Designs By Darren.