Lines Matching +full:gitlab +full:. +full:project +(+path:plugin +path:gitlabproject) -(+path:plugin +path:gitlabproject +path:lang)
3 * Gitlab Syntax Plugin: display Gitlab project
9 require 'gitlab/gitlab.php';
29 $this->Lexer->addSpecialPattern('<gitlab[^>]*/>', $mode, 'plugin_gitlabproject');
33 $json_file = file_get_contents(__DIR__.'/server.json');
51 preg_match("/server *= *(['\"])(.*?)\\1/", $match, $server);
60 $data['server'] = $this->getConf('server.default');
63 $data['token'] = $this->getConf('token.default');
66 // Match @project
67 preg_match("/project *= *(['\"])(.*?)\\1/", $match, $project);
68 if (count($project) != 0) {
69 $data['project'] = $project[2];
84 $renderer->doc .= $data['text'];
96 $renderer->doc .= $renderer->_xmlEntities($data['text']);
103 // Gitlab object
104 $gitlab = new DokuwikiGitlab($data);
106 // Project
107 $project = $gitlab->getProject();
108 $project_url = $project['web_url'];
109 $project_name = $project['name'];
110 if(empty($project)) {
114 $date_time = $this->getDateTime($project['last_activity_at']);
115 $namespace = $project['namespace']['name'];
118 $kind = $project['namespace']['kind'];
119 $unwanted_members = $this->getConf('unwanted.users');
120 $members = $gitlab->getProjectMembers($kind, $unwanted_members);
126 $img_url = DOKU_URL . 'lib/plugins/gitlabproject/images/gitlab.png';
129 $renderer->doc .= '<div class="gitlab">';
130 $renderer->doc .= '<span><img src="'.$img_url.'" class="gitlab"></span>';
131 $renderer->doc .= '<b class="gitlab">'.$this->getLang('gitlab.project').'</b><br>';
132 $renderer->doc .= '<hr class="gitlab">';
133 $renderer->doc .= '<a href="'.$project_url.'" class="gitlab">'.$project_name.'</a>';
134 …$renderer->doc .= ' - <b>Namespace:</b> <a href="'.$data['server'].'/'.$namespace.'"> '.$namespace…
135 …$renderer->doc .= '<p><b>'.$this->getLang('gitlab.activity').':</b> '.$date_time['date'].' - '.$da…
136 $renderer->doc .= '<p><b>'.$this->getLang('gitlab.members').':</b>';
141 $renderer->doc .= ' <a href="'.$member['web_url'].'">'.$member['username'].'</a> ';
142 $renderer->doc .= '('.$gitlab->getRoleName($member['access_level']).')';
143 if ($i != $total_members) $renderer->doc .= ',';
145 $renderer->doc .= '</p>';
146 $renderer->doc .= '</div>';
148 $gitlab->closeClient();
153 $img_url = DOKU_URL . 'lib/plugins/gitlabproject/images/gitlab.png';
154 $renderer->doc .= '<div class="gitlab">';
155 $renderer->doc .= '<span><img src="'.$img_url.'" class="gitlab"></span>';
156 $renderer->doc .= '<b class="gitlab">'.$this->getLang('gitlab.project').'</b><br>';
157 $renderer->doc .= '<hr class="gitlab">';
158 $renderer->doc .= '<p>'.$this->getLang('gitlab.error').'</p>';
159 $renderer->doc .= '</div>';