/**
  * Create a new ButtonBar instance.
  *
  * @param boolean $has_AddFiles       Display the Add Files button
  *
  * @return ButtonBar
  */
 public static function create($has_buttons = true, $has_progress = true, $has_progress_extended = true)
 {
     // Fetch current instance
     $instance = new ButtonBar();
     if ($has_buttons === false) {
         $instance->delete_buttons();
     }
     $instance->has_progress = $has_progress;
     $instance->has_progress_extended = $has_progress_extended;
     return $instance;
 }
Beispiel #2
0
 public function setTemplate($template)
 {
     $this->template = $template;
     $buttons = new ButtonBar();
     $buttons->setId("multi-form-buttons");
     $buttons->addButton("Clear");
     $buttons->buttons[0]->addAttribute("onclick", "fapiMultiFormRemove('--index--')");
     $this->template->setName($this->template->getName() . "[]");
     $this->templateName = $template->getName();
     $template->setId("multiform-content---index--");
     return $this;
 }
<?php

// Define Buttonbars
if (!file_exists($c["path"] . "index.php")) {
    die("Path not found.");
}
if (value("changevariation") != "0" && value("changevariation") != "" || value("changetranslation") != "0" && value("changetranslation") != "") {
    $page_state = "";
}
$clusterEditState = $action == $lang->get("edit_all") || ($action == $lang->get("save") || $action == "editsingle" || value("status") == "editsingle") && $action != $lang->get("back") && $action != $lang->get("save_back") || $isArticle;
if ($action == "") {
    $action = value("acstate");
}
$editState = $action == $lang->get("edit_all") || ($action == $lang->get("save") || $action == $lang->get("save_back") || $action == "editsingle" || value("status") == "editsingle") && $action != $lang->get("back") || $isArticle;
$clustereditbar = new ButtonBar("clusteredtbar");
if ($aclf->checkAccessToFunction("EDIT_CONTENT") || $aclf->checkAccessToFunction("EDIT_CL_CONTENT")) {
    if (!$editState) {
        if ($aclf->checkAccessToFunction("B_EDIT_ALL") && !$isArticle) {
            $clustereditbar->add("action", $lang->get("edit_all"), "submit", "document.form1.processing.value='';");
        }
    }
    if ($aclf->checkAccessToFunction("B_USAGE") && !$isArticle) {
        $clustereditbar->addAction($lang->get('usage', 'Usage'), "window.open('" . $c["docroot"] . "modules/common/cluster_usage.php?oid=" . $clnid . "&sid={$sid}', 'usage','Width=300px,Height=500px,help=no,status=yes,scrollbars=yes,resizable=yes');");
    }
    if (!$sitepage) {
        if (!$isArticle) {
            if ($aclf->checkAccessToFunction("DELETE_CL")) {
                $clustereditbar->add("action", $lang->get("CL_DEL"), "submit", getWaitupScreen() . "; document.form1.processing.value='';", "", !getDBCell("channel_articles", "CHID", "ARTICLE_ID = " . $clnid));
            }
            if ($aclf->checkAccessToFunction("LAUNCH_CL")) {
                $clustereditbar->addAction('separator');
<?php

$resetbar = new ButtonBar("resetbar");
$resetbar->add("action", $lang->get('resetcli', 'Change Object'), "submit", "", "", true, $lang->get("tt_rstci", "Each page in N/X has a cluster. By pressing Reset ClusterInstance you can assign a new cluster to the page and remove the old one."));
$spname = getDBCell("sitepage_master", "NAME", "SPM_ID = {$spm}");
$clt = getDBCell("sitepage_master", "CLT_ID", "SPM_ID = {$spm}");
$cltname = getDBCell("cluster_templates", "NAME", "CLT_ID = {$clt}");
if (!$mpProp) {
    $clnname = getDBCell("cluster_node", "NAME", "CLNID = {$clnid}");
}
if ($auth->checkAccessToFunction("B_RESET_CL_INST") && !$mpProp) {
    $propPanel->add($resetbar);
}
if ($type == 2 && !$mpProp) {
    $go = "UPDATE";
    $page_action = "UPDATE";
    $propPanel->add(new Cell("clc", "title1", 3, 600, 2));
    $propPanel->add(new Label("lbl", "<b>" . $lang->get("sp_launchdates") . "</b>", "headbox", 3));
    $propPanel->add(new Cell("clc", "title1", 3, 600, 2));
    if ($auth->checkAccessToFunction("AUTO_EXP_LAUN")) {
        $propPanel->add(new DateTimeInput($lang->get("sp_launchdate"), "sitepage", "LAUNCH_DATE", "SPID = {$spid}"));
    }
    if ($auth->checkAccessToFunction("AUTO_EXP_LAUN")) {
        $propPanel->add(new DateTimeInput($lang->get("sp_expiredate"), "sitepage", "EXPIRE_DATE", "SPID = {$spid}"));
    }
    $propPanel->add(new Subtitle('tit', $lang->get('sp_properties'), 3));
    $propPanel->add(new Spacer(3));
    $propPanel->add(new Label("lbl", $lang->get("spm"), "standard"));
    $propPanel->add(new Label("lbl", $spname, "standard"));
    if ($auth->checkAccessToFunction("POSITION")) {
        $propPanel->add(new MultipagePosition($lang->get("position"), "sitepage", "POSITION", "SPID = {$spid}", $spid, $menuID));
$acg1 = new ActionGroup();
$acg1->setCaption("");
$acg1->setImage("img/ic_share.png");
$btn_facebook = new ButtonBar();
$btn_facebook->setCaption("Facebook");
$btn_facebook->setImage("img/ic_facebook.png");
$btn_facebook->onTap(facebook());
$btn_tw = new ButtonBar();
$btn_tw->setCaption("Twitter");
$btn_tw->setImage("img/ic_tw.png");
$btn_tw->onTap(twitter());
$btn_sms = new ButtonBar();
$btn_sms->setCaption("SMS");
$btn_sms->setImage("img/ic_sms.png");
$btn_sms->onTap(sms());
$btn_email = new ButtonBar();
$btn_email->setCaption("EMail");
$btn_email->setImage("img/ic_email.png");
$btn_email->onTap(email());
$acg1->addControl($btn_facebook);
$acg1->addControl($btn_tw);
$acg1->addControl($btn_sms);
$acg1->addControl($btn_email);
$apb1->addControl($acg1);
//Add action bar to a SDPanel.
$win->addControl($apb1);
$tableItemDetail = new Table();
$tableItemDetail->setClass("table.TableDetailMain");
$title = new InputText(150);
$title->setClass("inputtitleblack");
$title->setAutoGrow(true);
Beispiel #6
0
    }
    /** @var $element FormElementText */
    $element = $form->factory('Text', 'allowIp', 'Source IP')->setDefaultValue($_SERVER['REMOTE_ADDR'])->setValidRegExp('(^(?P<first>[1-9]?\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(?P<second>[1-9]?\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(?P<third>[1-9]?\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(?P<fourth>[1-9]?\\d|1\\d\\d|2[0-4]\\d|25[0-5])$)')->setNotNull();
    /** @var $element FormElementHidden */
    $element = $form->factory('Hidden', 'doKnock')->setDefaultValue(1);
    return $form;
}
#############################################################################
###	INIT
#############################################################################
$error = false;
$html = new Html();
$html->setTitle('Knock PHP');
$html->addStyleSheet('static/default.css');
$message = new Message();
$button = new ButtonBar();
$button->addhtml('knock', 'knock knock', 'start knocking');
$form = form();
$form->fetch();
#############################################################################
###	CHECKS
#############################################################################
if (!is_readable('../local_config.php')) {
    $message->addError('File "local_config.php" does not exists or is not readable. Please copy from "local_config_template.php" and configure it.');
    $error = true;
}
if (!is_writable(PATH_FS_TMP)) {
    $message->addError('Temporary directory "' . PATH_FS_TMP . '" is not writable.');
    $error = true;
}
#############################################################################
<?

	if ((value("changevariation") != "0" && value("changevariation") != "") || (value("changetranslation") != "0" && value("changetranslation") != ""))
		$page_state = "";

	$switchbar = new ButtonBar("swbar");

	if ($mpProp) {
		$allowedVariations = createDBCArray("sitepage_variations", "VARIATION_ID", "SPM_ID = $spm");

		$commatext = implode(", ", $allowedVariations);
		$variations = createNameValueArray("variations", "NAME", "VARIATION_ID", "DELETED=0 AND VARIATION_ID IN ($commatext)");
	}

	$switchbar->setVariationSelector($variations, $variation);

	if ($mpProp) {
		$backup = $spid;

		$spid = $menuID;
	}

	// synchronize.... because new feature
	if (countRows("sitepage_names", "SPID", "SPID = $spid AND VARIATION_ID = $variation") < 1) {
		$sql = "INSERT INTO sitepage_names (SPID, VARIATION_ID) VALUES ($spid, $variation)";

		$query = new query($db, $sql);
		$query->free();
	}

	$menuPanel->add($switchbar);
Beispiel #8
0
<?php

/***
 * Task detail screen
 */
$win = new SDPanel();
$win->setCaption("Task Detail");
//Get var sent from main screen
$id = new InputNumeric();
$id->setClass("input.Common");
Data::getParm($id);
//Define the acrtion bar
$bar = new ActionBar();
$btn_delete = new ButtonBar();
$btn_delete->setCaption("Delete");
$btn_delete->onTap(removeTask());
$btn_delete->setImage("img/deleteBar.png");
$bar->addControl($btn_delete);
$win->addControl($bar);
//Items definition
$name = new InputText();
$name->setClass("input.Common");
$description = new InputText();
$description->setClass("input.Common");
$date = new InputDate();
$date->setLabelCaption("Task date");
$date->setClass("input.Common");
$addToCalendar = new InputBoolean();
$addToCalendar->setLabelCaption("Add to my calendar");
$addToCalendar->setLabelPosition("Right");
//Main table definition
Beispiel #9
0
$barGroup = new ActionGroup();
$barGroup->setCaption("");
$barGroup->setImage("img/filterIcon.png");
$btn_today = new ButtonBar();
$btn_today->setCaption("Today");
$btn_today->setClass("image.actionBarIcon");
$btn_today->onTap(Today());
$btn_seven_days = new ButtonBar();
$btn_seven_days->setCaption("Next seven days");
$btn_seven_days->setClass("image.actionBarIcon");
$btn_seven_days->onTap(nextSevenDays());
$btn_fifteen_days = new ButtonBar();
$btn_fifteen_days->setCaption("Next fifteen days");
$btn_fifteen_days->setClass("image.actionBarIcon");
$btn_fifteen_days->onTap(nextFifteenDays());
$btn_thirty_days = new ButtonBar();
$btn_thirty_days->setCaption("Next thirty days");
$btn_thirty_days->setClass("image.actionBarIcon");
$btn_thirty_days->onTap(nextThirtyDays());
$barGroup->addControl($btn_today);
$barGroup->addControl($btn_seven_days);
$barGroup->addControl($btn_fifteen_days);
$barGroup->addControl($btn_thirty_days);
$bar->addControl($barGroup);
$win->addControl($bar);
//Items List definition
$table = new Table();
$table->setClass("table.Menu");
$list = new Grid();
$list->addData(load_grid());
$list->setEmptyGridText("Your list is empty");
<?php

/**
 * Update company.
 * @author KikApp
 * @version 1.0
 */
$win = new SDPanel();
$id = new InputNumeric();
Data::getParm($id);
//Action bar and buttons bar
$acb = new ActionBar();
$btn_update = new ButtonBar();
$btn_update->setCaption("Save");
$btn_update->onTap(save());
$btn_cancel = new ButtonBar();
$btn_cancel->setCaption("Cancel");
$btn_cancel->onTap(cancel());
$acb->addControl($btn_update);
$acb->addControl($btn_cancel);
$win->addControl($acb);
$mainTable = new Table();
$image = new InputImage();
$name = new InputText();
$address = new InputAddress();
$phone = new InputPhone();
$mainTable->addControl($name, 1, 1);
$mainTable->addControl($address, 2, 1);
$mainTable->addControl($phone, 3, 1);
$mainTable->addControl($image, 4, 1);
$win->addControl($mainTable);
Beispiel #11
0
<?php

/*** 
 * Products list.
 */
$win = new SDPanel();
$win->setCaption("List of products");
$cat = new InputNumeric();
Data::getParm($cat);
//Action Bar and Action Group.
$acb = new ActionBar();
$btn_img = new ButtonBar();
$btn_img->setCaption("");
$btn_img->setImage("img/ic_view_stream_white.png");
$btn_img->onTap(changeView());
$acb->addControl($btn_img);
$win->addControl($acb);
//Add action bar in panel.
$table = new Table();
$table->setClass("tableGray");
$grid = new Grid();
$table_grid = new Table();
$table_grid->setClass("tableGrid");
$table_grid->setRowsStyle("80dip");
$table_grid->setColumnsStyle("35%;65%;15dip");
$table_grid->setHeight("85dip");
$grid->addSearch($title);
$grid->addData(grid_load());
$grid->onTap(action());
$grid->setEmptyGridText("No items available");
//inputs and controls
				exit;
		} else {
			$form = new YesNoForm($lang->get("cr_vr", "Create variation"), $lang->get("crlib_mes", "The content element does not exists in the selected variation. Do you want to create it?"));
			$form->add(new Hidden("action", "cr_content"));
			$form->add(new Hidden("oid", $oid));
			$form->add(new Hidden("crvar", $variation));
			$handled = true;
		}
        }
        
        if (! $handled) {
        	$form = new PanelForm($lang->get("edit_content", "Edit Content"). ": " . $name, '', 'con');
        
        	if ($aclf->checkAccessToFunction("EDIT_OBJECT")) {
        		$editpanel = new Panel($lang->get("edit_content"));
        		$buttonbar = new ButtonBar("variations");
        		$buttonbar->selectBoxDescr = true;
        		$buttonbar->setVariationSelector(createNameValueArrayEx("variations", "NAME", "VARIATION_ID", "1"), $variation);        		
        		$editpanel->add($buttonbar);
        		$editpanel->add(new Subtitle("st", $lang->get("title")));
        		$oname = new TextInput($lang->get("o_name"), "content", "NAME", $cond, "type:text,width:200,size:32", "MANDATORY&UNIQUE");
        		$oname->setFilter("CATEGORY_ID = $category_id");
        		$editpanel->add($oname);
        		$editpanel->add(new TextInput($lang->get('access_key', 'Access Key', 'Key-Value with which you can access this content from the editor by typing [key].'), 'content', 'ACCESSKEY', $cond, "type:text,width:100,size:16",'UNIQUE'));        		
        		$editpanel->backto = $c["docroot"] . "modules/content/objectbrowser.php?sid=$sid&resetfilter=1&pnode=$category_id";
        
        		// Edit
        		$editpanel->add(new Subtitle("st", $lang->get("edit_content")));
        		includePGNSource ($content_MODULE_ID);
        		$ref = createPGNRef($content_MODULE_ID, $fkid);
        
Beispiel #13
0
<?php

/***
 * Home.
 */
$win = new SDPanel();
$win->setCaption("KikApp Store");
$acb = new ActionBar();
$btn_cart = new ButtonBar();
$btn_cart->setCaption("Cart");
$btn_cart->setImage("img/cart.png");
$btn_cart->onTap(goToCart());
$acb->addControl($btn_cart);
$win->addControl($acb);
$table = new Table();
$table->setClass("tableGray");
$grid_home = new HorizontalGrid();
$grid_home->setRowsPerPagePortrait(1);
$grid_home->setShowPageController(false);
$table_grid = new Canvas();
$grid_home->addData(grid_load());
$grid_home->onTap(action());
//inputs and controls
$title = new InputText(150);
$title->setClass("inputtextTitlewhite");
$title->setAutoGrow(true);
$image = new InputImage();
$image->setClass("imageImageList");
$desc = new InputText(300);
$desc->setClass("inputtextwhite");
$price = new InputText(10);
<?php

/***
 * Thumbnails products list.
 */
$win = new SDPanel();
$win->setCaption("List of products");
$cat = new InputNumeric();
Data::getParm($cat);
//Action Bar y Action Group.
$apb1 = new ActionBar();
$btn_img = new ButtonBar();
$btn_img->setCaption("List");
$btn_img->setImage("img/ic_list_white.png");
$btn_img->onTap(lista());
$apb1->addControl($btn_img);
$win->addControl($apb1);
$table = new Table();
$table->setClass("tableGray");
$grid = new Grid();
$table_grid = new Canvas();
$table_grid->setClass("tableTableDetailMain");
$grid->addSearch($title);
$grid->addData(grid_load());
$grid->onTap(action());
$grid->setEmptyGridText("No items available");
//inputs and controls
$title = new InputText(150);
$title->setClass("inputtextTitlewhite");
$title->setAutoGrow(true);
$image = new InputImage();
Beispiel #15
0
 * @author Kikapp
 * @version 1.0
 */
$win = new SDPanel();
$win->setCaption("ActionBar");
$table = new Table();
$actionBar = new ActionBar();
$actionBar->setClass("applicationBars");
$actionGroup = new ActionGroup();
$actionGroup->setCaption("");
$actionGroup->setImage("img/ico_thumb.png");
$buttonBar = new ButtonBar();
$buttonBar->setCaption("Button 1");
$buttonBar->setImage("img/ico_thumb.png");
$buttonBar->onTap(functonClick());
$buttonBar_2 = new ButtonBar();
$buttonBar_2->setCaption("Button 2");
$buttonBar_2->setImage("img/ico_thumb.png");
$buttonBar_2->onTap(functonClick_2());
$actionGroup->addControl($buttonBar);
$actionGroup->addControl($buttonBar_2);
$actionBar->addControl($actionGroup);
$win->addControl($actionBar);
$win->addControl($table);
function functonClick()
{
    echo "On click button 1!";
}
function functonClick_2()
{
    echo "On click button 2!";
Beispiel #16
0
 public function setTemplate($template)
 {
     $this->template = $template;
     $template->addCssClass("fapi-multiform-sub");
     $buttons = new ButtonBar();
     $buttons->setId("multi-form-buttons");
     $buttons->addButton("Clear");
     $buttons->buttons[0]->addAttribute("onclick", "fapiMultiFormRemove('--index--')");
     $elements = $template->getFields();
     foreach ($elements as $element) {
         if ($element->getType() == "Field") {
             $element->setId($element->getId() == "" ? $element->getName() : $element->getId());
             $element->setName($template->getName() . "." . $element->getName() . "[]");
         }
         $element->setId($element->getId() . "_--index--");
     }
     $this->templateName = $template->getName();
     $template->setId("multiform-content---index--");
     $template->add($buttons);
     return $this;
 }
/**
 * Update company.
 * @author KikApp
 * @version 1.0
 */
$win = new SDPanel();
$win->setCaption("Transaction");
$token = new InputText(80);
$idMov_trans = new InputNumeric();
Data::getParm($token, $idMov_trans);
//Action bar and buttons bar
$acb = new ActionBar();
$btn_update = new ButtonBar();
$btn_update->setCaption("Save");
$btn_update->onTap(save());
$btn_cancel = new ButtonBar();
$btn_cancel->setCaption("Delete");
$btn_cancel->onTap(delete());
$acb->addControl($btn_update);
$acb->addControl($btn_cancel);
$win->addControl($acb);
$mainTable = new Table();
$mainTable->setRowsStyle("100%");
$mainTable->setWidth("100%");
$mainTable->setHeight("100%");
$mainTable->setClass("table.white");
$table = new Table();
$table->setRowsStyle("76dip;76dip;76dip;76dip;76dip");
$table->setClass("table.forms");
$move_type = new InputText();
$move_type->setClass("input.form");
<?php

/**
 * Detail company.
 * @author KikApp
 * @version 1.0
 */
$win = new SDPanel();
$id = new InputNumeric();
Data::getParm($id);
//Action bar and buttons bar
$acb = new ActionBar();
$btn_update = new ButtonBar();
$btn_update->setCaption("Update");
$btn_update->onTap(update());
$btn_delete = new ButtonBar();
$btn_delete->setCaption("Delete");
$btn_delete->onTap(delete());
$acb->addControl($btn_update);
$acb->addControl($btn_delete);
$win->addControl($acb);
$mainTable = new Table();
$mainTable->setEnableHeaderRowPattern(true);
$mainTable->setHeaderRowApplicationBarsClass("applicationBars.transparent");
$mainTable->setRowsStyle("150dip;pd");
$tableImg = new Table();
$tableImg->setClass("table.image");
$tableImg->setRowsStyle("pd;150dip;pd");
$image = new InputImage();
$image->setReadOnly(true);
$image->setClass("image.roundBorder");
Beispiel #19
0
$button -> onTap(clickme());

$mainTable -> addControl($button,1,1);
$win -> addControl($mainTable);

function clickme(){
	echo "Hello !";
}*/
/***
 * Listado de categorias.
 */
$win = new SDPanel();
$win->setCaption("Tasks list thumb");
//Add button to action bar
$bar = new ActionBar();
$btn_img = new ButtonBar();
$btn_img->setCaption("");
$btn_img->setImage("img/ico_thumb.png");
$btn_img->onTap(changeViewType());
$bar->addControl($btn_img);
$win->addControl($bar);
$table = new Table();
$table->setClass("tableMenu");
$list = new Grid();
$list->addData(load_grid());
$list->addSearch($name);
$table_grid = new Canvas();
$table_grid->setClass("tableTableDetailMain");
$id = new InputNumeric();
$name = new InputText();
$name->setClass("inputTitle");