PHP Classes

PHP Dialog: Create console based UIs with the dialog program

Recommend this page to a friend!
  Info   View files View files (36)   DownloadInstall with Composer Download .zip   Reputation   Support forum (6)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 53%Total: 750 All time: 4,464 This week: 171Up
Version License PHP version Categories
php-dialog 1.0Artistic License5.3PHP 5, Unix, Console
Description Author

This package can create console based user interfaces with the dialog program.

It takes the definition of dialog based user interfaces and creates them using dialog program to display the user interfaces and wait for the user responses.

It comes with several plug-in classes that can build many types of dialogs like forms, checkbox lists, calendar date picker, file selection, etc..

Innovation Award
PHP Programming Innovation award nominee
April 2012
Number 6


Prize: One downloadable copy of PhpED Professional
Some applications need to run from text based consoles with a command line interface shell.

However, most users are more familiar with GUI based user interfaces controls and metaphors.

This class can be used to implement text based interfaces with some of the common controls found in GUI applications.

It uses the dialog program to implement those controls, so it can pass the necessary parameters to the dialog program and can handle the response values returned by that program.

Manuel Lemos
Picture of Michele Brodoloni
  Performance   Level  
Name: Michele Brodoloni <contact>
Classes: 6 packages by
Country: Ireland Ireland
Age: 37
All time rank: 2491 in Ireland Ireland
Week rank: 287 Down1 in Ireland Ireland Equal
Innovation award
Innovation award
Nominee: 3x

Details
PHP Dialog v1.0 Author: Michele Brodoloni <mik.linux@gmail.com> +--------------+ | DESCRIPTION | +--------------+ This class allows you to create pretty dialog boxes within your php-cli scripts. It relies on Linux "dialog" utility. +--------------+ | REQUIREMENTS | +--------------+ * PHP 5.3 (due to a bug with proc_open() in PHP 5.1) * dialog 1.0 / 1.1 +--------------+ | INSTALLATION | +--------------+ * Install the dialog utility using your favority package manager - apt-get install dialog # (For Debian/Ubuntu) - yum install dialog # (For RHEL/CentOS) * Download and extract this tarball * Place file class.dialog.php and the plugins directory wherever you want but in the same path. +--------------+ | BASIC USAGE | +--------------+ To use this class just include it, and call the static factory() method to fetch the wanted object. Here's an example: ----------[ CODE:START ]-------------- <?php require_once 'path/to/class.dialog.php'; $dialog = Dialog::factory($type, $params); ?> ----------[ CODE:END ]----------------- * $type is the type of dialog requested. Possible choices are: - confirm - msgbox - gauge - inputbox - calendar - timebox - ... And so on. Just list files into 'plugins' directory. * $params is an optional associative array which sets default params during object construction. It could come handy when need to instantiate several dialog objects with the same values (such as title, backtitle, ecc..) ----------[ CODE:START ]-------------- <?php require_once 'path/to/class.dialog.php'; $params = array( 'backtitle' => 'My App', 'title' => 'Box title' ); $d1 = dialog::factory('msgbox', $params); $d1->setCaption('Hello World #1') ->show(); $secs=5; $d2 = dialog::factory('pause', $options); $d2->setCaption("Please wait $secs seconds.") ->setSeconds($secs) ->show(); ?> ----------[ CODE:END ]----------------- +---------------+ | DOCUMENTATION | +---------------+ For further information please download and extract the zip file located into the docs directory and then open the index.html file in the extracted directory.
  Files folder image Files  
File Role Description
Files folder imageexamples (17 files)
Files folder imageinclude (1 file, 1 directory)
Accessible without login Plain text file README.txt Doc. Documentation

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file calendar.php Example Example script
  Accessible without login Plain text file checklist.php Example Example script
  Accessible without login Plain text file confirm.php Example Example script
  Accessible without login Plain text file fileselect.php Example Example script
  Accessible without login Plain text file form.php Example Example script
  Accessible without login Plain text file gauge.php Example Example script
  Accessible without login Plain text file infobox.php Example Example script
  Accessible without login Plain text file inputbox.php Example Example script
  Accessible without login Plain text file inputmenu.php Example Example script
  Accessible without login Plain text file menu.php Example Example script
  Accessible without login Plain text file msgbox.php Example Example script
  Accessible without login Plain text file password.php Example Example script
  Accessible without login Plain text file pause.php Example Example script
  Accessible without login Plain text file radio.php Example Example script
  Accessible without login Plain text file tailbox.php Example Example script
  Accessible without login Plain text file textbox.php Example Example script
  Accessible without login Plain text file time.php Example Example script

  Files folder image Files  /  include  
File Role Description
Files folder imageplugins (17 files)
  Plain text file class.dialog.php Class Class source

  Files folder image Files  /  include  /  plugins  
File Role Description
  Plain text file calendar.php Class Class source
  Plain text file checklist.php Class Class source
  Plain text file confirm.php Class Class source
  Plain text file fileselect.php Class Class source
  Plain text file form.php Class Class source
  Plain text file gauge.php Class Class source
  Plain text file infobox.php Class Class source
  Plain text file inputbox.php Class Class source
  Plain text file inputmenu.php Class Class source
  Plain text file menu.php Class Class source
  Plain text file msgbox.php Class Class source
  Plain text file password.php Class Class source
  Plain text file pause.php Class Class source
  Plain text file radio.php Class Class source
  Plain text file tailbox.php Class Class source
  Plain text file textbox.php Class Class source
  Plain text file time.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:750
This week:0
All time:4,464
This week:171Up
User Ratings User Comments (3)
 All time
Utility:68%StarStarStarStar
Consistency:68%StarStarStarStar
Documentation:50%StarStarStar
Examples:68%StarStarStarStar
Tests:-
Videos:-
Overall:53%StarStarStar
Rank:2104
 
The main dialog class has some OOP problems that could be eas...
7 years ago (Michael Cummings)
40%StarStarStar
examples did not work
10 years ago (geeta)
40%StarStarStar
What's a good package! Buy need more Documentation.
10 years ago (Tufan Baris YILDIRIM)
52%StarStarStar