{"action":"created","comment":{"url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/comments/22440265","id":22440265,"diff_hunk":"@@ -0,0 +1,188 @@\n+<?php\n+/**\n+ * Page callback function\n+ * Rendering page for form example\n+ * @param $arg\n+ * @return array|mixed\n+ */\n+function training_example_form_callback($arg){\n+  return drupal_get_form($arg);\n+}\n+\n+/**\n+ * Page callback function\n+ * Rendering Item List that items are links on other theme pages\n+ * @return string\n+ * @throws \\Exception\n+ */\n+function training_theme_html(){\n+  $array = array(\n+    '<a href=\"theme/list\">List</a>',\n+    '<a href=\"theme/table\">Table</a>',\n+    '<a href=\"theme/image\">Image</a>',\n+    '<a href=\"theme/access\">Access</a>',\n+  );\n+\n+return theme('item_list', array(\n+  'items' => $array,\n+  'type' => 'ol',\n+  'title' => 'Links to themes',\n+));\n+}\n+\n+/**\n+ * Page callback function\n+ * Rendering Table Table theme page\n+ * @return string\n+ * @throws \\Exception\n+ */\n+\n+function training_theme_table(){\n+  $my_header = array(\n+    'header 1',\n+    'header 2',\n+    'header 3',\n+  );\n+  $rows = array(\n+    array(\n+      'data' => array('1',array('data' => 'Oleg', 'colspan' => 2), ),\n+      'class' => array('rowClass'),\n+      ),\n+      array(\n+        'data' => array('2',array('data' => 'Oleg', 'colspan' => 2), ),\n+        'class' => array('rowClass'),\n+      ),\n+  );\n+  $caption = 'Theme table sample';\n+  $attributes = array(\n+    'id' => 'table-test',\n+  );\n+\n+  return theme('table', array(\n+    'header' => $my_header,\n+    'rows' => $rows,\n+    'attributes' => $attributes,\n+    'caption' => $caption,\n+  ));\n+}\n+\n+/**\n+ * Page callback function\n+ * Rendering list of images with default styles\n+ * @return string\n+ * @throws \\Exception\n+ */\n+function training_image_callback(){\n+  $file_path = drupal_realpath('modules/image/sample.png');\n+  $source = (object)array(\n+    'uid' => 1,\n+    'uri' => $file_path,\n+    'filename' => basename($file_path),\n+    'filemime' => file_get_mimetype($file_path),\n+  );\n+  $directory = 'public://';\n+  file_copy($source, $directory, $replace = FILE_EXISTS_REPLACE);\n+  $output = '';\n+  $array_style=image_styles();\n+  foreach ($array_style as $val){\n+    $style_name = $val['name'];\n+    $path = 'public://sample.png';\n+    $attributes = array(\n+    'class' => 'simple-image',\n+    );\n+    $output .= '<li>' . theme('image_style', array(\n+   'style_name' => $style_name,\n+   'path' => $path,\n+   'attributes' => $attributes,\n+    )) . '</li>';\n+  }\n+  return '<ul>' . $output . '</ul>';\n+}\n+\n+/**\n+ * Page callback function\n+ * Rendering different content for users with Access protected content permission\n+ * @return string\n+ * @throws \\Exception\n+ */\n+function training_access_callback(){\n+  if (user_access('train_theme')){\n+    return 'Custom access for rendered content';\n+  }\n+  else {\n+   return  'Custom access inversed for rendered content';","path":"training/training.pages.inc","position":113,"original_position":113,"commit_id":"97317a61be2befb797571ca8491780953fcadf1a","original_commit_id":"97317a61be2befb797571ca8491780953fcadf1a","user":{"login":"rostislav-sergeenkov","id":4550317,"avatar_url":"https://avatars.githubusercontent.com/u/4550317?v=3","gravatar_id":"","url":"https://api.github.com/users/rostislav-sergeenkov","html_url":"https://github.com/rostislav-sergeenkov","followers_url":"https://api.github.com/users/rostislav-sergeenkov/followers","following_url":"https://api.github.com/users/rostislav-sergeenkov/following{/other_user}","gists_url":"https://api.github.com/users/rostislav-sergeenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/rostislav-sergeenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rostislav-sergeenkov/subscriptions","organizations_url":"https://api.github.com/users/rostislav-sergeenkov/orgs","repos_url":"https://api.github.com/users/rostislav-sergeenkov/repos","events_url":"https://api.github.com/users/rostislav-sergeenkov/events{/privacy}","received_events_url":"https://api.github.com/users/rostislav-sergeenkov/received_events","type":"User","site_admin":false},"body":"t()","created_at":"2015-01-04T16:06:07Z","updated_at":"2015-01-04T16:06:07Z","html_url":"https://github.com/rostislav-sergeenkov/drupal_training/pull/3#discussion_r22440265","pull_request_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/comments/22440265"},"html":{"href":"https://github.com/rostislav-sergeenkov/drupal_training/pull/3#discussion_r22440265"},"pull_request":{"href":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/3","id":26549153,"html_url":"https://github.com/rostislav-sergeenkov/drupal_training/pull/3","diff_url":"https://github.com/rostislav-sergeenkov/drupal_training/pull/3.diff","patch_url":"https://github.com/rostislav-sergeenkov/drupal_training/pull/3.patch","issue_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/issues/3","number":3,"state":"open","locked":false,"title":"webinar 1. part1: menu","user":{"login":"TatsianaShukevich","id":10208027,"avatar_url":"https://avatars.githubusercontent.com/u/10208027?v=3","gravatar_id":"","url":"https://api.github.com/users/TatsianaShukevich","html_url":"https://github.com/TatsianaShukevich","followers_url":"https://api.github.com/users/TatsianaShukevich/followers","following_url":"https://api.github.com/users/TatsianaShukevich/following{/other_user}","gists_url":"https://api.github.com/users/TatsianaShukevich/gists{/gist_id}","starred_url":"https://api.github.com/users/TatsianaShukevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TatsianaShukevich/subscriptions","organizations_url":"https://api.github.com/users/TatsianaShukevich/orgs","repos_url":"https://api.github.com/users/TatsianaShukevich/repos","events_url":"https://api.github.com/users/TatsianaShukevich/events{/privacy}","received_events_url":"https://api.github.com/users/TatsianaShukevich/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-12-24T08:05:24Z","updated_at":"2015-01-04T16:06:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2875b429037da70b6c73346b7d6fedf60b929808","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/3/commits","review_comments_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/3/comments","review_comment_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/issues/3/comments","statuses_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/statuses/97317a61be2befb797571ca8491780953fcadf1a","head":{"label":"TatsianaShukevich:master","ref":"master","sha":"97317a61be2befb797571ca8491780953fcadf1a","user":{"login":"TatsianaShukevich","id":10208027,"avatar_url":"https://avatars.githubusercontent.com/u/10208027?v=3","gravatar_id":"","url":"https://api.github.com/users/TatsianaShukevich","html_url":"https://github.com/TatsianaShukevich","followers_url":"https://api.github.com/users/TatsianaShukevich/followers","following_url":"https://api.github.com/users/TatsianaShukevich/following{/other_user}","gists_url":"https://api.github.com/users/TatsianaShukevich/gists{/gist_id}","starred_url":"https://api.github.com/users/TatsianaShukevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TatsianaShukevich/subscriptions","organizations_url":"https://api.github.com/users/TatsianaShukevich/orgs","repos_url":"https://api.github.com/users/TatsianaShukevich/repos","events_url":"https://api.github.com/users/TatsianaShukevich/events{/privacy}","received_events_url":"https://api.github.com/users/TatsianaShukevich/received_events","type":"User","site_admin":false},"repo":{"id":28263098,"name":"drupal_training","full_name":"TatsianaShukevich/drupal_training","owner":{"login":"TatsianaShukevich","id":10208027,"avatar_url":"https://avatars.githubusercontent.com/u/10208027?v=3","gravatar_id":"","url":"https://api.github.com/users/TatsianaShukevich","html_url":"https://github.com/TatsianaShukevich","followers_url":"https://api.github.com/users/TatsianaShukevich/followers","following_url":"https://api.github.com/users/TatsianaShukevich/following{/other_user}","gists_url":"https://api.github.com/users/TatsianaShukevich/gists{/gist_id}","starred_url":"https://api.github.com/users/TatsianaShukevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TatsianaShukevich/subscriptions","organizations_url":"https://api.github.com/users/TatsianaShukevich/orgs","repos_url":"https://api.github.com/users/TatsianaShukevich/repos","events_url":"https://api.github.com/users/TatsianaShukevich/events{/privacy}","received_events_url":"https://api.github.com/users/TatsianaShukevich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TatsianaShukevich/drupal_training","description":"Drupal Training","fork":true,"url":"https://api.github.com/repos/TatsianaShukevich/drupal_training","forks_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/forks","keys_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/teams","hooks_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/hooks","issue_events_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/issues/events{/number}","events_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/events","assignees_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/assignees{/user}","branches_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/branches{/branch}","tags_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/tags","blobs_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/git/refs{/sha}","trees_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/statuses/{sha}","languages_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/languages","stargazers_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/stargazers","contributors_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/contributors","subscribers_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/subscribers","subscription_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/subscription","commits_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/commits{/sha}","git_commits_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/git/commits{/sha}","comments_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/comments{/number}","issue_comment_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/issues/comments/{number}","contents_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/contents/{+path}","compare_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/merges","archive_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/downloads","issues_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/issues{/number}","pulls_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/pulls{/number}","milestones_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/milestones{/number}","notifications_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/labels{/name}","releases_url":"https://api.github.com/repos/TatsianaShukevich/drupal_training/releases{/id}","created_at":"2014-12-20T09:45:03Z","updated_at":"2014-12-30T13:51:27Z","pushed_at":"2014-12-30T13:51:27Z","git_url":"git://github.com/TatsianaShukevich/drupal_training.git","ssh_url":"git@github.com:TatsianaShukevich/drupal_training.git","clone_url":"https://github.com/TatsianaShukevich/drupal_training.git","svn_url":"https://github.com/TatsianaShukevich/drupal_training","homepage":null,"size":145,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rostislav-sergeenkov:master","ref":"master","sha":"8b69e5b26f1a97bfa67e7fd7d2ff7fd156dbfdff","user":{"login":"rostislav-sergeenkov","id":4550317,"avatar_url":"https://avatars.githubusercontent.com/u/4550317?v=3","gravatar_id":"","url":"https://api.github.com/users/rostislav-sergeenkov","html_url":"https://github.com/rostislav-sergeenkov","followers_url":"https://api.github.com/users/rostislav-sergeenkov/followers","following_url":"https://api.github.com/users/rostislav-sergeenkov/following{/other_user}","gists_url":"https://api.github.com/users/rostislav-sergeenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/rostislav-sergeenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rostislav-sergeenkov/subscriptions","organizations_url":"https://api.github.com/users/rostislav-sergeenkov/orgs","repos_url":"https://api.github.com/users/rostislav-sergeenkov/repos","events_url":"https://api.github.com/users/rostislav-sergeenkov/events{/privacy}","received_events_url":"https://api.github.com/users/rostislav-sergeenkov/received_events","type":"User","site_admin":false},"repo":{"id":28262549,"name":"drupal_training","full_name":"rostislav-sergeenkov/drupal_training","owner":{"login":"rostislav-sergeenkov","id":4550317,"avatar_url":"https://avatars.githubusercontent.com/u/4550317?v=3","gravatar_id":"","url":"https://api.github.com/users/rostislav-sergeenkov","html_url":"https://github.com/rostislav-sergeenkov","followers_url":"https://api.github.com/users/rostislav-sergeenkov/followers","following_url":"https://api.github.com/users/rostislav-sergeenkov/following{/other_user}","gists_url":"https://api.github.com/users/rostislav-sergeenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/rostislav-sergeenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rostislav-sergeenkov/subscriptions","organizations_url":"https://api.github.com/users/rostislav-sergeenkov/orgs","repos_url":"https://api.github.com/users/rostislav-sergeenkov/repos","events_url":"https://api.github.com/users/rostislav-sergeenkov/events{/privacy}","received_events_url":"https://api.github.com/users/rostislav-sergeenkov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rostislav-sergeenkov/drupal_training","description":"Drupal Training","fork":false,"url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training","forks_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/forks","keys_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/teams","hooks_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/hooks","issue_events_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/issues/events{/number}","events_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/events","assignees_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/assignees{/user}","branches_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/branches{/branch}","tags_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/tags","blobs_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/git/refs{/sha}","trees_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/statuses/{sha}","languages_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/languages","stargazers_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/stargazers","contributors_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/contributors","subscribers_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/subscribers","subscription_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/subscription","commits_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/commits{/sha}","git_commits_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/git/commits{/sha}","comments_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/comments{/number}","issue_comment_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/issues/comments/{number}","contents_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/contents/{+path}","compare_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/merges","archive_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/downloads","issues_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/issues{/number}","pulls_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls{/number}","milestones_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/milestones{/number}","notifications_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/labels{/name}","releases_url":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/releases{/id}","created_at":"2014-12-20T09:18:47Z","updated_at":"2014-12-20T09:18:47Z","pushed_at":"2014-12-20T10:01:03Z","git_url":"git://github.com/rostislav-sergeenkov/drupal_training.git","ssh_url":"git@github.com:rostislav-sergeenkov/drupal_training.git","clone_url":"https://github.com/rostislav-sergeenkov/drupal_training.git","svn_url":"https://github.com/rostislav-sergeenkov/drupal_training","homepage":null,"size":137,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/3"},"html":{"href":"https://github.com/rostislav-sergeenkov/drupal_training/pull/3"},"issue":{"href":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/issues/3"},"comments":{"href":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/rostislav-sergeenkov/drupal_training/statuses/97317a61be2befb797571ca8491780953fcadf1a"}}}}