Skip to content

Commit

Permalink
capitalize classes
Browse files Browse the repository at this point in the history
  • Loading branch information
vzuburlis committed May 7, 2020
1 parent 7056a5e commit ec915e7
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 87 deletions.
2 changes: 1 addition & 1 deletion source/api-db.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Runs a query and returns the result.
Examples:
```
$result1 = $db->query("SELECT title,author FROM post;");
$result2 = $db->query("SELECT title,author FROM post WHERE user_id=?;",[session::user_id()]);
$result2 = $db->query("SELECT title,author FROM post WHERE user_id=?;",[Session::user_id()]);
```


Expand Down
32 changes: 16 additions & 16 deletions source/api-gila.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Class gila

.. code-block:: php
gila::controller('my-ctrl', 'my_package/controllers/ctrl','myctrl');
Gila::controller('my-ctrl', 'my_package/controllers/ctrl','myctrl');
.. method:: route($r, $fn)

Expand All @@ -29,7 +29,7 @@ Class gila

.. code-block:: php
gila::route('some.txt', function(){ echo 'Some text.'; });
Gila::route('some.txt', function(){ echo 'Some text.'; });
.. method:: onController($c, $fn)

Expand All @@ -42,7 +42,7 @@ Class gila

.. code-block:: php
gila::route('blog', function(){ blog::ppp = 24; });
Gila::route('blog', function(){ blog::ppp = 24; });
.. method:: action($c, $action, $fn)

Expand All @@ -56,7 +56,7 @@ Class gila

.. code-block:: php
gila::action('blog', 'topics', function(){ blog::tagsAction(); });
Gila::action('blog', 'topics', function(){ blog::tagsAction(); });
.. method:: onAction($c, $action, $fn)

Expand All @@ -70,7 +70,7 @@ Class gila

.. code-block:: php
gila::onAction('blog', 'topics', function(){ view::set('new_variable', 'value'); });
Gila::onAction('blog', 'topics', function(){ View::set('new_variable', 'value'); });
.. method:: before($c, $action, $fn)

Expand All @@ -84,7 +84,7 @@ Class gila

.. code-block:: php
gila::action('blog', 'topics', function(){ blog::tagsAction(); });
Gila::action('blog', 'topics', function(){ blog::tagsAction(); });
.. method:: addLang($path)

Expand All @@ -96,7 +96,7 @@ Class gila

.. code-block:: php
gila::addLang('mypackages/lang/');
Gila::addLang('mypackages/lang/');
.. method:: addList($list, $el)

Expand All @@ -121,7 +121,7 @@ Class gila

.. code-block:: php
gila::widgets( [‘wdg’=>’my_package/widgets/wdg’] );
Gila::widgets( [‘wdg’=>’my_package/widgets/wdg’] );
.. method:: content($key, $path)

Expand All @@ -134,7 +134,7 @@ Class gila

.. code-block:: php
gila::content( 'mytable', 'package_name/content/mytable.php' );
Gila::content( 'mytable', 'package_name/content/mytable.php' );
.. method:: contentInit($key, $init)

Expand All @@ -147,7 +147,7 @@ Class gila

.. code-block:: php
gila::contentInit( 'mytable', function(&$table){
Gila::contentInit( 'mytable', function(&$table){
// unlist a column from content administration
&$table['fields']['column1']['list] = false;
} );
Expand All @@ -167,7 +167,7 @@ Class gila

.. code-block:: php
gila::amenu([
Gila::amenu([
'item'=>['Item','controller/action','icon'=>'item-icon']
]);
Expand All @@ -183,7 +183,7 @@ Class gila

.. code-block:: php
gila::amenu_child('item', ['Child Item','controller/action','icon'=>'item-icon']);
Gila::amenu_child('item', ['Child Item','controller/action','icon'=>'item-icon']);
.. method:: config($key, $value = null)
Expand Down Expand Up @@ -271,8 +271,8 @@ Class gila

.. code-block:: php
$url1 = gila::make_url('blog','post',[1]);`` returns mysite.com/blog/post/1
$url1 = gila::make_url('blog','',['page1']);`` returns mysite.com/blog/page1
$url1 = Gila::make_url('blog','post',[1]);`` returns mysite.com/blog/post/1
$url1 = Gila::make_url('blog','',['page1']);`` returns mysite.com/blog/page1
.. method:: mt ($arg)
Expand All @@ -286,7 +286,7 @@ Class gila

.. code-block:: php
gila::mt('my-table')
Gila::mt('my-table')
.. method:: updateMt ($arg)
Expand All @@ -300,5 +300,5 @@ Class gila

.. code-block:: php
gila::updateMt('my-table')
Gila::updateMt('my-table')
2 changes: 1 addition & 1 deletion source/api-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Returns true if an action is permited based on permissions. When a field name is

The permissions that will be send will override this array:
```
$permissions = user::permissions(session::user_id());
$permissions = user::permissions(Session::user_id());
$userTable = new gTable('user', $permissions);
$userTable->can('read', 'password');
$userTable->can('delete'); // create & delete are not specified for fields
Expand Down
40 changes: 20 additions & 20 deletions source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Class gila

.. code-block:: php
gila::controller('my-ctrl', 'my_package/controllers/ctrl','myctrl');
Gila::controller('my-ctrl', 'my_package/controllers/ctrl','myctrl');
.. method:: route($r, $fn)

Expand All @@ -32,7 +32,7 @@ Class gila

.. code-block:: php
gila::route('some.txt', function(){ echo 'Some text.'; });
Gila::route('some.txt', function(){ echo 'Some text.'; });
.. method:: onController($c, $fn)

Expand All @@ -45,7 +45,7 @@ Class gila

.. code-block:: php
gila::route('blog', function(){ blog::ppp = 24; });
Gila::route('blog', function(){ blog::ppp = 24; });
.. method:: action($c, $action, $fn)

Expand All @@ -59,7 +59,7 @@ Class gila

.. code-block:: php
gila::action('blog', 'topics', function(){ blog::tagsAction(); });
Gila::action('blog', 'topics', function(){ blog::tagsAction(); });
.. method:: before($c, $action, $fn)

Expand All @@ -73,7 +73,7 @@ Class gila

.. code-block:: php
gila::action('blog', 'topics', function(){ blog::tagsAction(); });
Gila::action('blog', 'topics', function(){ blog::tagsAction(); });
.. method:: addLang($path)

Expand All @@ -85,7 +85,7 @@ Class gila

.. code-block:: php
gila::addLang('mypackages/lang/');
Gila::addLang('mypackages/lang/');
.. method:: widgets($list)
Expand All @@ -98,7 +98,7 @@ Class gila

.. code-block:: php
gila::widgets( [‘wdg’=>’my_package/widgets/wdg’] );
Gila::widgets( [‘wdg’=>’my_package/widgets/wdg’] );
.. method:: content($key, $path)

Expand All @@ -111,7 +111,7 @@ Class gila

.. code-block:: php
gila::content( 'mytable', 'package_name/content/mytable.php' );
Gila::content( 'mytable', 'package_name/content/mytable.php' );
.. method:: contentInit($key, $init)

Expand All @@ -124,7 +124,7 @@ Class gila

.. code-block:: php
gila::contentInit( 'mytable', function(&$table){
Gila::contentInit( 'mytable', function(&$table){
// unlist a column from content administration
&$table['fields']['column1']['list] = false;
} );
Expand All @@ -145,7 +145,7 @@ Class gila

.. code-block:: php
gila::amenu('item', ['Item','controller/action','icon'=>'item-icon']);
Gila::amenu('item', ['Item','controller/action','icon'=>'item-icon']);
.. method:: amenu_child($key,$item)
Expand All @@ -159,7 +159,7 @@ Class gila

.. code-block:: php
gila::amenu_child('item', ['Child Item','controller/action','icon'=>'item-icon']);
Gila::amenu_child('item', ['Child Item','controller/action','icon'=>'item-icon']);
.. method:: config($key, $value = null)
Expand Down Expand Up @@ -247,8 +247,8 @@ Class gila

.. code-block:: php
$url1 = gila::make_url('blog','post',[1]);`` returns mysite.com/blog/post/1
$url1 = gila::make_url('blog','',['page1']);`` returns mysite.com/blog/page1
$url1 = Gila::make_url('blog','post',[1]);`` returns mysite.com/blog/post/1
$url1 = Gila::make_url('blog','',['page1']);`` returns mysite.com/blog/page1
.. method:: mt ($arg)
Expand All @@ -262,7 +262,7 @@ Class gila

.. code-block:: php
gila::mt('my-table')
Gila::mt('my-table')
.. method:: updateMt ($arg)
Expand All @@ -276,7 +276,7 @@ Class gila

.. code-block:: php
gila::updateMt('my-table')
Gila::updateMt('my-table')
Expand Down Expand Up @@ -320,15 +320,15 @@ Class view

.. method:: meta($meta,$value)

(static) Sets a meta value that is printed later from view::head().
(static) Sets a meta value that is printed later from View::head().

:param string $meta: The meta name.
:param string $value: The value.


.. method:: stylesheet($href)

(static) Adds a new stylesheet link that is printed later from view::head().
(static) Adds a new stylesheet link that is printed later from View::head().

:param string $href: The href attribute from the link.

Expand Down Expand Up @@ -373,7 +373,7 @@ Class view

.. code-block:: php
view::setViewFile('admin/settings.php','new-package');
View::setViewFile('admin/settings.php','new-package');
/*
src/new-package/views/admin/settings.php
overrides
Expand Down Expand Up @@ -452,7 +452,7 @@ Class view
.. code-block:: php
$img = ["image1.png","image2.png"];
list($file,$stacked) = view::thumb_stack($img, "tmp/stacked_file.png",80);
list($file,$stacked) = View::thumb_stack($img, "tmp/stacked_file.png",80);
/* Returned values
Expand Down Expand Up @@ -483,7 +483,7 @@ Class db
.. code-block:: php
$result1 = $db->query("SELECT title,author FROM post;");
$result2 = $db->query("SELECT title,author FROM post WHERE user_id=?;",[session::user_id()]);
$result2 = $db->query("SELECT title,author FROM post WHERE user_id=?;",[Session::user_id()]);
.. method:: get($q, $args)
Expand Down
6 changes: 3 additions & 3 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@

# General information about the project.
project = u'Gila CMS'
copyright = u'2017-2019, Vasileios Zoumpourlis'
copyright = u'2017-2020, Vasileios Zoumpourlis'
author = u'Vasileios Zoumpourlis'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'1.12'
version = u'1.13'
# The full version, including alpha/beta/rc tags.
release = u'1.12.5'
release = u'1.13.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
12 changes: 6 additions & 6 deletions source/package_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ logo.png
```
<?php
event::listen('post.after', function(){
Event::listen('post.after', function(){
global $g; // $g will give us the post id
$tags = core\models\post::meta($g->id,'tag'); // get the tag list of post
echo "<strong>TAGS:</strong> ";
foreach ($tags as $tag) echo " <a href='tag/$tag'>#$tag</a>";
});
```
This function will run when the *post.after* event is dispatched. That happens with *event::fire('post.after');* or *event::widget_area('post.after');* from *single-post.php* view file.
This function will run when the *post.after* event is dispatched. That happens with *Event::fire('post.after');* or *Event::widget_area('post.after');* from *single-post.php* view file.

**logo.png** is the package's logo and is displayed in the package list.

Expand Down Expand Up @@ -61,7 +61,7 @@ widgets/twitter-timeline/twitter-timeline.php
<?php
// registers the widget name and its path
gila::widgets([
Gila::widgets([
'twitter-timeline'=>'twitter-timelines/widgets/twitter-timeline'
]);
```
Expand All @@ -78,12 +78,12 @@ $options=[
**widgets/twitter-timeline/twitter-timeline.php** is the view file of the widget, it will generate the html code. We use the embedding Twitter content from [here](https://publish.twitter.com)
```
<?php
$account = gila::option('twitter-timelines.accountID','gilacms');
$account = Gila::option('twitter-timelines.accountID','gilacms');
?>
<a class="twitter-timeline" data-height="400" href="https://twitter.com/<?=$account?>">Tweets by <?=$account?></a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
```
**gila::option()** gets the option of the package that we set up in the package settings. A default value can be used if the option is null.
**Gila::option()** gets the option of the package that we set up in the package settings. A default value can be used if the option is null.

Activate the package. Now in */admin/widgets* you can create a new widget with type *twitter-timeline* and set the widget area *sidebar* or *dashboard* to see it.

Expand Down Expand Up @@ -111,7 +111,7 @@ load.php
// make changes to the user content type
gila::contentInit('user', function(&$table){
Gila::contentInit('user', function(&$table){
$table['fields']['useraddress'] = [
'title'=>"Address", //the label
'type'=>'meta', //the values of the field will be stored in a meta table
Expand Down

0 comments on commit ec915e7

Please sign in to comment.