{"action":"created","comment":{"url":"https://api.github.com/repos/ding2/ding2/pulls/comments/80699063","pull_request_review_id":1737608,"id":80699063,"diff_hunk":"@@ -0,0 +1,146 @@\n+<?php\n+/**\n+ * @file\n+ * Provide IPE Filter menu functionality.\n+ */\n+\n+include_once 'ding_ipe_filter.features.inc';\n+\n+\n+/**\n+ * Implements hook_menu().\n+ */\n+function ding_ipe_filter_menu() {\n+  $items['admin/config/user-interface/ipe-filter'] = array(\n+    'title' => 'IPE pane filter settings',\n+    'description' => 'Configure IPE filter default options.',\n+    'weight' => 1,\n+    'page callback' => 'drupal_get_form',\n+    'page arguments' => array('ding_ipe_filter_default_settings_form'),\n+    'access arguments' => array('access administration pages'),\n+    'file' => 'ding_ipe_filter.admin.inc',\n+  );\n+  $items['admin/config/user-interface/ipe-filter/default'] = array(\n+    'title' => 'Settings',\n+    'description' => 'Default settings for IPE filter',\n+    'type' => MENU_DEFAULT_LOCAL_TASK,\n+    'weight' => 1,\n+  );\n+  $items['admin/config/user-interface/ipe-filter/panes'] = array(\n+    'title' => 'IPE pane filter',\n+    'description' => 'Choose what content should be displayed on the add content modal page.',\n+    'page callback' => 'drupal_get_form',\n+    'page arguments' => array('ding_ipe_filter_admin_panes_form'),\n+    'access arguments' => array('access administration pages'),\n+    'file' => 'ding_ipe_filter.admin.inc',\n+    'type' => MENU_LOCAL_TASK,\n+    'weight' => 2,\n+  );\n+\n+  return $items;\n+}\n+\n+/**\n+ * Implements hook_theme().\n+ */\n+function ding_ipe_filter_theme() {\n+  return array(\n+    'ding_ipe_filter_table' => array(\n+      'render element' => 'form',\n+    ),\n+  );\n+}\n+\n+/**\n+ * Implements theme_hook().\n+ */\n+function theme_ding_ipe_filter_table($variables) {\n+  $form = $variables['form'];\n+  $header = $form['#header'];\n+\n+  $content = array(\n+    'header' => $header,\n+    'rows' => array(),\n+  );\n+  foreach (element_children($form) as $row_index) {\n+    if (isset($form[$row_index]['title'])) {\n+      $content['rows'][] = array(\n+        drupal_render($form[$row_index]['title']),\n+        drupal_render($form[$row_index]['value']),\n+      );\n+    }\n+    else {\n+      $content['rows'][] = array(array(\n+        'data' => drupal_render($form[$row_index]),\n+          'colspan' => 2,\n+          'header' => TRUE,\n+        ),\n+      );\n+    }\n+  }\n+  $output = theme('table', $content);\n+  $output .= drupal_render_children($form);\n+  return $output;\n+}\n+\n+/**\n+ * Implements hook_theme_registry_alter().\n+ */\n+function ding_ipe_filter_theme_registry_alter(&$registry) {\n+  global $user;\n+  $ipe_roles = variable_get('ding_ipe_filter_roles', array());\n+\n+  if (!empty($user->roles)) {\n+    $role_names = array_values($user->roles);\n+    $user_roles = array_combine($role_names, $role_names);\n+    $roles = array_intersect(array_keys($user_roles), $ipe_roles);\n+  }\n+  if (!empty($roles)) {\n+    $registry['panels_ipe_add_pane_button']['function'] = '_ding_ipe_filter_add_pane_buttons';\n+  }\n+}\n+\n+/**\n+ * Add pane buttons on IPE filter menu based on settings and enabled modules.\n+ *\n+ * @param array $variables\n+ *   Theme registry variables.\n+ *\n+ * @return string\n+ *   Rendered IPE filter menu.\n+ */\n+function _ding_ipe_filter_add_pane_buttons($variables = array()) {\n+  ctools_include('content');\n+  $content_types = ctools_content_get_available_types();\n+  $panel_editor = new panels_renderer_editor();\n+  $categories = $panel_editor->get_categories($content_types);\n+\n+  $assets_loaded = &drupal_static('ipe_assets_loaded', FALSE);\n+  $settings = variable_get('ding_ipe_filter_table', array());\n+  $region_id  = $variables['region_id'];\n+  $renderer = $variables['renderer'];\n+\n+  $buttons = array();\n+  $menu_width = 'calc(100% - 18px)';\n+  $attributes = array(\n+    'class' => 'ctools-use-modal ding-ipe-menu-item',\n+    'style' => 'width: ' . $menu_width . '; height: auto;',","path":"modules/ding_ipe_filter/ding_ipe_filter.module","position":139,"original_position":127,"commit_id":"c9984f5be25d7b085d6ca02ba8dd05863b287590","original_commit_id":"fb9733363d4024a5b7110fd67a943ea75cd39197","user":{"login":"NicolaeGrigoriu","id":3027336,"avatar_url":"https://avatars.githubusercontent.com/u/3027336?v=3","gravatar_id":"","url":"https://api.github.com/users/NicolaeGrigoriu","html_url":"https://github.com/NicolaeGrigoriu","followers_url":"https://api.github.com/users/NicolaeGrigoriu/followers","following_url":"https://api.github.com/users/NicolaeGrigoriu/following{/other_user}","gists_url":"https://api.github.com/users/NicolaeGrigoriu/gists{/gist_id}","starred_url":"https://api.github.com/users/NicolaeGrigoriu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicolaeGrigoriu/subscriptions","organizations_url":"https://api.github.com/users/NicolaeGrigoriu/orgs","repos_url":"https://api.github.com/users/NicolaeGrigoriu/repos","events_url":"https://api.github.com/users/NicolaeGrigoriu/events{/privacy}","received_events_url":"https://api.github.com/users/NicolaeGrigoriu/received_events","type":"User","site_admin":false},"body":"Menu width is calculated based on the width of the links.","created_at":"2016-09-27T14:01:36Z","updated_at":"2016-09-27T14:01:57Z","html_url":"https://github.com/ding2/ding2/pull/282#discussion_r80699063","pull_request_url":"https://api.github.com/repos/ding2/ding2/pulls/282","_links":{"self":{"href":"https://api.github.com/repos/ding2/ding2/pulls/comments/80699063"},"html":{"href":"https://github.com/ding2/ding2/pull/282#discussion_r80699063"},"pull_request":{"href":"https://api.github.com/repos/ding2/ding2/pulls/282"}}},"pull_request":{"url":"https://api.github.com/repos/ding2/ding2/pulls/282","id":77296678,"html_url":"https://github.com/ding2/ding2/pull/282","diff_url":"https://github.com/ding2/ding2/pull/282.diff","patch_url":"https://github.com/ding2/ding2/pull/282.patch","issue_url":"https://api.github.com/repos/ding2/ding2/issues/282","number":282,"state":"open","locked":false,"title":"Issue #1599 by Inlead: Add IPE Filter module.","user":{"login":"inlead","id":570630,"avatar_url":"https://avatars.githubusercontent.com/u/570630?v=3","gravatar_id":"","url":"https://api.github.com/users/inlead","html_url":"https://github.com/inlead","followers_url":"https://api.github.com/users/inlead/followers","following_url":"https://api.github.com/users/inlead/following{/other_user}","gists_url":"https://api.github.com/users/inlead/gists{/gist_id}","starred_url":"https://api.github.com/users/inlead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inlead/subscriptions","organizations_url":"https://api.github.com/users/inlead/orgs","repos_url":"https://api.github.com/users/inlead/repos","events_url":"https://api.github.com/users/inlead/events{/privacy}","received_events_url":"https://api.github.com/users/inlead/received_events","type":"User","site_admin":false},"body":"http://platform.dandigbib.org/issues/1599","created_at":"2016-07-13T14:17:03Z","updated_at":"2016-09-27T14:01:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"187c59919bfde4ada61adaecb1f040368a032903","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ding2/ding2/pulls/282/commits","review_comments_url":"https://api.github.com/repos/ding2/ding2/pulls/282/comments","review_comment_url":"https://api.github.com/repos/ding2/ding2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ding2/ding2/issues/282/comments","statuses_url":"https://api.github.com/repos/ding2/ding2/statuses/c9984f5be25d7b085d6ca02ba8dd05863b287590","head":{"label":"easySuite:feature/issue-1599","ref":"feature/issue-1599","sha":"c9984f5be25d7b085d6ca02ba8dd05863b287590","user":{"login":"easySuite","id":15833286,"avatar_url":"https://avatars.githubusercontent.com/u/15833286?v=3","gravatar_id":"","url":"https://api.github.com/users/easySuite","html_url":"https://github.com/easySuite","followers_url":"https://api.github.com/users/easySuite/followers","following_url":"https://api.github.com/users/easySuite/following{/other_user}","gists_url":"https://api.github.com/users/easySuite/gists{/gist_id}","starred_url":"https://api.github.com/users/easySuite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/easySuite/subscriptions","organizations_url":"https://api.github.com/users/easySuite/orgs","repos_url":"https://api.github.com/users/easySuite/repos","events_url":"https://api.github.com/users/easySuite/events{/privacy}","received_events_url":"https://api.github.com/users/easySuite/received_events","type":"Organization","site_admin":false},"repo":{"id":48030945,"name":"ding2","full_name":"easySuite/ding2","owner":{"login":"easySuite","id":15833286,"avatar_url":"https://avatars.githubusercontent.com/u/15833286?v=3","gravatar_id":"","url":"https://api.github.com/users/easySuite","html_url":"https://github.com/easySuite","followers_url":"https://api.github.com/users/easySuite/followers","following_url":"https://api.github.com/users/easySuite/following{/other_user}","gists_url":"https://api.github.com/users/easySuite/gists{/gist_id}","starred_url":"https://api.github.com/users/easySuite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/easySuite/subscriptions","organizations_url":"https://api.github.com/users/easySuite/orgs","repos_url":"https://api.github.com/users/easySuite/repos","events_url":"https://api.github.com/users/easySuite/events{/privacy}","received_events_url":"https://api.github.com/users/easySuite/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/easySuite/ding2","description":"Ding install profile","fork":true,"url":"https://api.github.com/repos/easySuite/ding2","forks_url":"https://api.github.com/repos/easySuite/ding2/forks","keys_url":"https://api.github.com/repos/easySuite/ding2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/easySuite/ding2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/easySuite/ding2/teams","hooks_url":"https://api.github.com/repos/easySuite/ding2/hooks","issue_events_url":"https://api.github.com/repos/easySuite/ding2/issues/events{/number}","events_url":"https://api.github.com/repos/easySuite/ding2/events","assignees_url":"https://api.github.com/repos/easySuite/ding2/assignees{/user}","branches_url":"https://api.github.com/repos/easySuite/ding2/branches{/branch}","tags_url":"https://api.github.com/repos/easySuite/ding2/tags","blobs_url":"https://api.github.com/repos/easySuite/ding2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/easySuite/ding2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/easySuite/ding2/git/refs{/sha}","trees_url":"https://api.github.com/repos/easySuite/ding2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/easySuite/ding2/statuses/{sha}","languages_url":"https://api.github.com/repos/easySuite/ding2/languages","stargazers_url":"https://api.github.com/repos/easySuite/ding2/stargazers","contributors_url":"https://api.github.com/repos/easySuite/ding2/contributors","subscribers_url":"https://api.github.com/repos/easySuite/ding2/subscribers","subscription_url":"https://api.github.com/repos/easySuite/ding2/subscription","commits_url":"https://api.github.com/repos/easySuite/ding2/commits{/sha}","git_commits_url":"https://api.github.com/repos/easySuite/ding2/git/commits{/sha}","comments_url":"https://api.github.com/repos/easySuite/ding2/comments{/number}","issue_comment_url":"https://api.github.com/repos/easySuite/ding2/issues/comments{/number}","contents_url":"https://api.github.com/repos/easySuite/ding2/contents/{+path}","compare_url":"https://api.github.com/repos/easySuite/ding2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/easySuite/ding2/merges","archive_url":"https://api.github.com/repos/easySuite/ding2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/easySuite/ding2/downloads","issues_url":"https://api.github.com/repos/easySuite/ding2/issues{/number}","pulls_url":"https://api.github.com/repos/easySuite/ding2/pulls{/number}","milestones_url":"https://api.github.com/repos/easySuite/ding2/milestones{/number}","notifications_url":"https://api.github.com/repos/easySuite/ding2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/easySuite/ding2/labels{/name}","releases_url":"https://api.github.com/repos/easySuite/ding2/releases{/id}","deployments_url":"https://api.github.com/repos/easySuite/ding2/deployments","created_at":"2015-12-15T08:53:09Z","updated_at":"2016-05-11T07:09:02Z","pushed_at":"2016-09-27T11:58:10Z","git_url":"git://github.com/easySuite/ding2.git","ssh_url":"git@github.com:easySuite/ding2.git","clone_url":"https://github.com/easySuite/ding2.git","svn_url":"https://github.com/easySuite/ding2","homepage":"","size":95415,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"easyopac"}},"base":{"label":"ding2:master","ref":"master","sha":"f2fb31dbc673bab90878cce7792b66acd2c9de0b","user":{"login":"ding2","id":564698,"avatar_url":"https://avatars.githubusercontent.com/u/564698?v=3","gravatar_id":"","url":"https://api.github.com/users/ding2","html_url":"https://github.com/ding2","followers_url":"https://api.github.com/users/ding2/followers","following_url":"https://api.github.com/users/ding2/following{/other_user}","gists_url":"https://api.github.com/users/ding2/gists{/gist_id}","starred_url":"https://api.github.com/users/ding2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ding2/subscriptions","organizations_url":"https://api.github.com/users/ding2/orgs","repos_url":"https://api.github.com/users/ding2/repos","events_url":"https://api.github.com/users/ding2/events{/privacy}","received_events_url":"https://api.github.com/users/ding2/received_events","type":"Organization","site_admin":false},"repo":{"id":1266749,"name":"ding2","full_name":"ding2/ding2","owner":{"login":"ding2","id":564698,"avatar_url":"https://avatars.githubusercontent.com/u/564698?v=3","gravatar_id":"","url":"https://api.github.com/users/ding2","html_url":"https://github.com/ding2","followers_url":"https://api.github.com/users/ding2/followers","following_url":"https://api.github.com/users/ding2/following{/other_user}","gists_url":"https://api.github.com/users/ding2/gists{/gist_id}","starred_url":"https://api.github.com/users/ding2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ding2/subscriptions","organizations_url":"https://api.github.com/users/ding2/orgs","repos_url":"https://api.github.com/users/ding2/repos","events_url":"https://api.github.com/users/ding2/events{/privacy}","received_events_url":"https://api.github.com/users/ding2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ding2/ding2","description":"Ding install profile","fork":false,"url":"https://api.github.com/repos/ding2/ding2","forks_url":"https://api.github.com/repos/ding2/ding2/forks","keys_url":"https://api.github.com/repos/ding2/ding2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ding2/ding2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ding2/ding2/teams","hooks_url":"https://api.github.com/repos/ding2/ding2/hooks","issue_events_url":"https://api.github.com/repos/ding2/ding2/issues/events{/number}","events_url":"https://api.github.com/repos/ding2/ding2/events","assignees_url":"https://api.github.com/repos/ding2/ding2/assignees{/user}","branches_url":"https://api.github.com/repos/ding2/ding2/branches{/branch}","tags_url":"https://api.github.com/repos/ding2/ding2/tags","blobs_url":"https://api.github.com/repos/ding2/ding2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ding2/ding2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ding2/ding2/git/refs{/sha}","trees_url":"https://api.github.com/repos/ding2/ding2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ding2/ding2/statuses/{sha}","languages_url":"https://api.github.com/repos/ding2/ding2/languages","stargazers_url":"https://api.github.com/repos/ding2/ding2/stargazers","contributors_url":"https://api.github.com/repos/ding2/ding2/contributors","subscribers_url":"https://api.github.com/repos/ding2/ding2/subscribers","subscription_url":"https://api.github.com/repos/ding2/ding2/subscription","commits_url":"https://api.github.com/repos/ding2/ding2/commits{/sha}","git_commits_url":"https://api.github.com/repos/ding2/ding2/git/commits{/sha}","comments_url":"https://api.github.com/repos/ding2/ding2/comments{/number}","issue_comment_url":"https://api.github.com/repos/ding2/ding2/issues/comments{/number}","contents_url":"https://api.github.com/repos/ding2/ding2/contents/{+path}","compare_url":"https://api.github.com/repos/ding2/ding2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ding2/ding2/merges","archive_url":"https://api.github.com/repos/ding2/ding2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ding2/ding2/downloads","issues_url":"https://api.github.com/repos/ding2/ding2/issues{/number}","pulls_url":"https://api.github.com/repos/ding2/ding2/pulls{/number}","milestones_url":"https://api.github.com/repos/ding2/ding2/milestones{/number}","notifications_url":"https://api.github.com/repos/ding2/ding2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ding2/ding2/labels{/name}","releases_url":"https://api.github.com/repos/ding2/ding2/releases{/id}","deployments_url":"https://api.github.com/repos/ding2/ding2/deployments","created_at":"2011-01-18T10:54:00Z","updated_at":"2016-09-22T12:46:41Z","pushed_at":"2016-09-27T13:16:06Z","git_url":"git://github.com/ding2/ding2.git","ssh_url":"git@github.com:ding2/ding2.git","clone_url":"https://github.com/ding2/ding2.git","svn_url":"https://github.com/ding2/ding2","homepage":"","size":96646,"stargazers_count":12,"watchers_count":12,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":103,"forks":34,"open_issues":103,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ding2/ding2/pulls/282"},"html":{"href":"https://github.com/ding2/ding2/pull/282"},"issue":{"href":"https://api.github.com/repos/ding2/ding2/issues/282"},"comments":{"href":"https://api.github.com/repos/ding2/ding2/issues/282/comments"},"review_comments":{"href":"https://api.github.com/repos/ding2/ding2/pulls/282/comments"},"review_comment":{"href":"https://api.github.com/repos/ding2/ding2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ding2/ding2/pulls/282/commits"},"statuses":{"href":"https://api.github.com/repos/ding2/ding2/statuses/c9984f5be25d7b085d6ca02ba8dd05863b287590"}}}}
{"actor":{"display_login":"NicolaeGrigoriu"}}