This repository has been archived by the owner on Sep 4, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
more examples
- Loading branch information
Romans Malinovskis
committed
May 22, 2012
1 parent
fa2beff
commit 94344d8
Showing
16 changed files
with
212 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
class View_Example extends View { | ||
function set($code){ | ||
$this->template->set('Code',$code); | ||
// TODO: make a dynamic paths here | ||
if(!@$this->api->syntaxhighligter_hack) | ||
$this->js(true,'$.SyntaxHighlighter.init({prettifyBaseUrl:"templates/js/jquery-syntaxhighlighter/prettify",baseUrl:"templates/js/jquery-syntaxhighlighter"})')->_load('jquery-syntaxhighlighter/scripts/jquery.syntaxhighlighter'); | ||
$this->api->syntaxhighligter_hack=true; | ||
|
||
$res=$this->add('View',null,'Demo'); | ||
$this->executeDemo($res,$code); | ||
} | ||
function executeDemo($page,$code){ | ||
eval($code); | ||
} | ||
|
||
function defaultTemplate(){ | ||
return array('view/example'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<h1>Basic Form Example</h1> | ||
|
||
<p>Form is a fundamental component of any web application. Agile Toolkit greatly simplifies form creation.</p> | ||
|
||
<?Example?> | ||
$form=$page->add('Form'); | ||
$form->addField('line','name'); | ||
$form->addField('line','surname'); | ||
$form->addSubmit(); | ||
|
||
if($form->isSubmitted()){ | ||
$form->js()->univ()->alert('Thank you, '. | ||
$form->get('name').' '.$form->get('surname'))->execute(); | ||
} | ||
<?/?> | ||
|
||
<h3>Form Elements</h3> | ||
|
||
<p>There are many field types you can use with form. In addition you can add your own field types or use add-on which may provide additional types.</p> | ||
|
||
|
||
<?Example?> | ||
$form=$page->add('Form'); | ||
$form->addComment('This form shows all sorts of fields you can use by default'); | ||
$form->addField('line','line'); | ||
$form->addField('password','password'); | ||
$form->addField('checkbox','checkbox'); | ||
$form->addField('dropdown','dropdown'); | ||
$form->addField('checkboxlist','checkboxlist'); | ||
$form->addField('radio','radio'); | ||
$form->addField('DatePicker','date'); | ||
$form->addField('text','text'); | ||
|
||
$form->addSeparator(); | ||
$form->addField('Slider','Slider'); | ||
$form->addField('upload','upload'); | ||
|
||
$form->addSeparator('Here are some variations in how you can use fields'); | ||
$form->addField('Search','Search'); | ||
$form->addSubmit(); | ||
<?/?> | ||
|
||
<h3>Use with Model</h3> | ||
|
||
<p>The most convenient way to use form is to have it's fields populated from a Model.</p> | ||
|
||
|
||
<?Example?> | ||
$form=$page->add('Form'); | ||
$form->setModel('Employee'); | ||
<?/?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<h1>Basic Grid Example</h1> | ||
|
||
<p>Grid presents data in a tabular way. Grid always has a defined set of columns. When used with model, columns will be automatically populated. Without Models you need to use addColumn() and populate data</p> | ||
|
||
<?Example?> | ||
$grid=$page->add('Grid'); | ||
$grid->addColumn('name'); | ||
$grid->addColumn('surname'); | ||
|
||
$grid->setSource(array( | ||
array('name'=>'John','surname'=>'Smith'.rand(1,20)), | ||
array('name'=>'Peter','surname'=>'Tester'.rand(20,40)) | ||
)); | ||
<?/?> | ||
|
||
<h3>Grid Buttons</h3> | ||
|
||
<p>Grid has support for buttons. addButton() is merely a wrapper out of convenience. You can add button into any view.</p> | ||
|
||
<?Example?> | ||
$grid=$page->add('Grid'); | ||
|
||
$grid->addColumn('name'); | ||
$grid->addColumn('surname'); | ||
|
||
$grid->setSource(array( | ||
array('name'=>'John','surname'=>'Smith'.rand(1,20)), | ||
array('name'=>'Peter','surname'=>'Tester'.rand(20,40)) | ||
)); | ||
|
||
$grid->addButton('One'); | ||
$grid->addButton('Two')->js('click')->univ()->alert('clicked button two'); | ||
$grid->addButton('Reload Grid')->js('click',$grid->js()->reload()); | ||
$grid->addButton('With Icon')->setIcon('heart'); | ||
<?/?> | ||
|
||
<h3>Grid from Model</h3> | ||
|
||
<p>The most typical use is when grid is being populated through a Model.</p> | ||
|
||
<?Example?> | ||
$grid=$page->add('Grid'); | ||
|
||
$grid->setModel('Employee'); | ||
<?/?> | ||
|
||
<h3>Paginator and Quicksearch</h3> | ||
|
||
<p>The most typical use is when grid is being populated through a Model.</p> | ||
|
||
<?Example?> | ||
$grid=$page->add('Grid'); | ||
|
||
$grid->setModel('Employee'); | ||
$grid->addPaginator(3); | ||
$grid->addQuickSearch(array('name')); | ||
<?/?> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<h1>Binding JavaScript Events</h1> | ||
|
||
<p>Binding allows you to modify behaviour through JavaScript / jQuery events</p> | ||
|
||
<?Example?> | ||
$page->add('Button')->set('click me')->js('click') | ||
->univ()->alert('Thank you'); | ||
|
||
$bs=$page->add('ButtonSet'); | ||
|
||
$b1=$bs->addButton('Hide Myself'); | ||
$b1->js('click')->hide(); | ||
|
||
$b2=$bs->addButton('Hide next button'); | ||
$b3=$bs->addButton('Hide prev button'); | ||
$b2->js('click',$b3->js()->fadeOut('slow')); | ||
$b3->js('click',$b2->js()->fadeOut('slow')); | ||
|
||
$bs->addButton('Show all buttons') | ||
->js('click',array( | ||
$b1->js()->show(), | ||
$b2->js()->show(), | ||
$b3->js()->show() | ||
)); | ||
<?/?> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
<div style="width: 200px; float: left; border: 1px solid black; padding: 1em; margin: 0.5em "> | ||
<h4><a href="/<?$name?>"><?$name?></a></h4> | ||
<p><?$descr?></p> | ||
<div id="<?$_name?>_ex" class="example"> | ||
<div class="label">Source</div> | ||
<div class="actions"><a href="#"><i class="ui-icon ui-icon-comment"></i>Comment</a><a href="#"><i class="ui-icon ui-icon-link"></i>Link</a><a href="#"><i class="ui-icon ui-icon-document"></i>Copy</a></div> | ||
<pre class="highlight language-php"> | ||
<?$Code?> | ||
</pre> | ||
</div> | ||
|
||
<div id="<?$_name?>_de" class="demo"> | ||
<div class="label">Demo</div> | ||
<?$Demo?> | ||
</div> |
Submodule jquery-syntaxhighlighter
added at
638919
23 changes: 23 additions & 0 deletions
23
templates/js/jquery.syntaxhighlighter/jquery.syntaxhighlighter.min.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.