Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Backwards compatibility with 4.2

  • Loading branch information...
commit 95305fd4f0bf06fc9258d7e790c0eda867d51110 1 parent 8aacae6
Romans Malinovskis authored
View
63 docs/simple_views_buttons.md
@@ -27,27 +27,27 @@
<a href="http://jquery-ui.googlecode.com/svn/tags/1.6rc5/tests/static/icons.html" target="_blank">More jQueryUI icons</a>
- $page->add('Button')->set('Icon Button')->setIcon('ui-icon-heart');
+ $page->add('Button')->set(['Icon Button','icon'=>'heart']);
### <a id="sizes"></a>sizes
- $page->add('Button')->set('Small Button')->addClass('small');
+ $page->add('Button')->set('Small Button')->addClass('atk-button-small');
$page->add('Button')->set('Regular Button');
- $page->add('Button')->set('Big Button')->addClass('big');
+ $page->add('Button')->set('Large Button')->addClass('atk-button-large');
### <a id="button-size"></a>button size
- $button = $page->add('View_Button')->set('span2')->addClass('span2');
- $button = $page->add('View_Button')->set('span3')->addClass('span3');
- $button = $page->add('View_Button')->set('span4')->addClass('span4');
- $button = $page->add('View_Button')->set('span5')->addClass('span5');
- $button = $page->add('View_Button')->set('span6')->addClass('span6');
+ $button = $page->add('View_Button')->set('span2')->addClass('atk-col-2');
+ $button = $page->add('View_Button')->set('span3')->addClass('atk-col-3');
+ $button = $page->add('View_Button')->set('span4')->addClass('atk-col-4');
+ $button = $page->add('View_Button')->set('span5')->addClass('atk-col-5');
+ $button = $page->add('View_Button')->set('span6')->addClass('atk-col-6');
### <a id="colors"></a>colors
- $page->add('Button')->set('Red Button')->addClass('red');
- $page->add('Button')->set('Green Button')->addClass('green');
- $page->add('Button')->set('Yellow Button')->addClass('yellow');
+ $page->add('Button')->set('Red Button')->addClass('atk-swatch-red');
+ $page->add('Button')->set('Green Button')->addClass('atk-swatch-green');
+ $page->add('Button')->set('Yellow Button')->addClass('atk-swatch-yellow');
### <a id="button-with-menu"></a>button with menu
@@ -59,56 +59,31 @@
->js('click')
->univ()
->alert('BINGOOO!');
-
+
$buttons->addButton('Close')
->js('click', $popover->js()->dialog('close'));
### splited button with menu
- $button = $page->add('View_Button');
- $form = $button->addSplitButton()->addPopover()->add('Form');
- $form->addClass('stacked');
- $form->addField('Slider','volume');
+$button = $page->add('View_Button');
+$form = $button->addSplitButton()->addPopover()->add('Form');
+$form->addClass('stacked');
+$form->addField('Slider','volume');
### button with dropdown menu
$button = $page->add('Button');
$menu = $button->addMenu();
-
+
$menu->addMenuItem('one');
$menu->addMenuItem('two');
- $sm = $menu->addSubMenu('submenu');
+ $sm = $menu->addSubMenu('test');
$menu->addMenuItem('three');
$menu->addMenuItem('four');
-
+
$sm -> addMenuItem('half');
$sm -> addMenuItem('quarter');
-### splited button with dropdown menu
-
- $tb = $page->add('View_ButtonMenuButton')->set('Test');
- $menu = $tb->addButtonMenu()->setType('vertical');
- $menu->addMenuItem('open','Open...')
- ->addMenuItem('save','Save')
- ->sub()
- ->addMenuItem('saveas','Save as...')
- ->end()
- ->addMenuItem('delete','Delete')
- ;
-
-### <a id="button-with-popover"></a>button with popover
-
- // TODO
-
-### <a id="button-radio"></a>button / radio
-
- // TODO
-
-### <a id="toolbar"></a>Toolbar
-
- // TODO
-
-
View
23 lib/Frontend.php
@@ -59,9 +59,13 @@ function page_back($p){
* we need this just to see old examples
*/
function initLayout(){
- try {
- parent::initLayout();
- }catch(Exception_StopInit $e){}
+
+ if($this->atk_version=="4.3")$f=$this->add('Layout_Fluid');
+
+ parent::initLayout();
+
+ if(isset($f))$f->addMenu()->setModel('Menu');
+
$page=$this->page_object;
if(@$page->descr){
@@ -76,18 +80,19 @@ function initLayout(){
}
- if (!$this->api->code_executed) {
+ //if (!$this->api->code_executed) {
$page->template->eachTag('Code',function($a,$b) use($page){ $page->add('View_Code',null,$b)->set($a); });
- $page->template->eachTag('Example',function($a,$b) use($page){ $page->add('documenting/View_Example',null,$b)->set($a); });
- $page->template->eachTag('Silent',function($a,$b) use($page){ $page->add('documenting/View_Example',null,$b)->set($a,true); });
+ $page->template->eachTag('Example',function($a,$b) use($page){ $page->add('documenting/View_Example',null,$b)->set("\n".htmlspecialchars_decode($a)); });
+ $page->template->eachTag('Silent',function($a,$b) use($page){ $page->add('documenting/View_Example',null,$b)->set("\n".$a,true); });
$page->template->eachTag('ExecuteTrigger',function($a,$b) use($page){ $page->add('documenting/View_ExecuteTrigger',null,$b)->set($a,'trigger'); });
- }
-
+ //}
if(!$this->tree && $this->template->hasTag('SubMenu')){
$tree=$this->add('TreeView',null,'SubMenu',array('submenu'));
$tree->setModel('Menu');
}
+
+
}
public $code_executed = false;
function render(){
@@ -106,7 +111,7 @@ function render(){
}
function defaultTemplate(){
- if($_GET['cut'])return array('empty');else return array('shared');
+ if($_GET['cut'])return array('empty');else return parent::defaultTemplate();
}
}
View
18 page/mdpage.php
@@ -30,8 +30,14 @@ function init() {
- $html=str_replace('<pre><code>','<?Example?>',$html);
- $html=str_replace('</code></pre>','<?/Example?>',$html);
+ if($this->api->atk_version=="4.3") {
+ $html=str_replace('<pre><code>','{Example}',$html);
+ $html=str_replace('</code></pre>','{/Example}',$html);
+ }else{
+ $html=str_replace('<pre><code>','<?Example?>',$html);
+ $html=str_replace('</code></pre>','<?/Example?>',$html);
+
+ }
$html=preg_replace(
'/<p><img src="([^"]*)" alt="([^"]*)" \/><\/p>/',
'<?Image?>\\1 \\2<?/?>',
@@ -43,12 +49,14 @@ function init() {
$page=$this;
+ /*
$page->template->eachTag('Code',function($a,$b) use($page){
- $page->add('documenting/View_Example', null,$b)->set($a,true);
+ $page->add('documenting/View_Example', null,$b)->set("\n".$a,true);
});
$page->template->eachTag('Example',function($a,$b) use($page){
- $page->add('documenting/View_Example', null,$b)->set(htmlspecialchars_decode($a));
+ $page->add('documenting/View_Example', null,$b)->set(htmlspecialchars_decode("\n".$a));
});
+ */
$page->template->eachTag('Image',function($a,$b) use($page){
list($file,$title)=explode(' ',$a,2);
$page->add('View',null,$b)
@@ -68,4 +76,4 @@ function init() {
// );
$this->api->code_executed = true;
}
-}
+}
View
0  templates/default/shared2.html → templates/default/shared.html
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.