40 | 41 |
42 | 45 | = $this->autop($this->parseHashtags($this->parseURLs($vars['object']->body, $rel))) ?> 46 | 47 |├── templates └── default │ └── entity │ ├── Video │ ├── icon.tpl.php │ └── edit.tpl.php │ └── Video.tpl.php ├── plugin.ini ├── ContentType.php ├── README.rst ├── Main.php ├── Pages └── Edit.php └── Video.php /templates/default/entity/Video/icon.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugin.ini: -------------------------------------------------------------------------------- 1 | [Plugin description] 2 | name = "Video" 3 | version = "0.0.2" 4 | author = "Christian Weiske" 5 | author_email = "cweiske@cweiske.de" 6 | author_url = "http://cweiske.de/" 7 | description = "HTML5 video plugin" 8 | -------------------------------------------------------------------------------- /ContentType.php: -------------------------------------------------------------------------------- 1 | `_ instance. 6 | Videos are embedded with a HTML5 ```` tag. 7 | 8 | Videos do not get converted. 9 | 10 | ---- 11 | 12 | I have no intention to develop this plugin anymore. 13 | Feel free to fork and continue. 14 | -------------------------------------------------------------------------------- /Main.php: -------------------------------------------------------------------------------- 1 | addPageHandler('/video/edit/?', '\IdnoPlugins\Video\Pages\Edit'); 9 | \Idno\Core\Idno::site()->addPageHandler('/video/edit/([A-Za-z0-9]+)/?', '\IdnoPlugins\Video\Pages\Edit'); 10 | \Idno\Core\Idno::site()->addPageHandler('/video/delete/([A-Za-z0-9]+)/?', '\IdnoPlugins\Video\Pages\Delete'); 11 | } 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Pages/Edit.php: -------------------------------------------------------------------------------- 1 | createGatekeeper(); // This functionality is for logged-in users only 10 | 11 | // Are we loading an entity? 12 | if (!empty($this->arguments)) { 13 | $object = \IdnoPlugins\Video\Video::getByID($this->arguments[0]); 14 | } else { 15 | $object = new \IdnoPlugins\Video\Video(); 16 | } 17 | 18 | if ($owner = $object->getOwner()) { 19 | $this->setOwner($owner); 20 | } 21 | 22 | $t = \Idno\Core\Idno::site()->template(); 23 | $edit_body = $t->__(array( 24 | 'object' => $object 25 | ))->draw('entity/Video/edit'); 26 | 27 | $body = $t->__(['body' => $edit_body])->draw('entity/editwrapper'); 28 | 29 | if (empty($object)) { 30 | $title = 'Post a video'; 31 | } else { 32 | $title = 'Edit video description'; 33 | } 34 | 35 | if (!empty($this->xhr)) { 36 | echo $body; 37 | } else { 38 | $t->__(array('body' => $body, 'title' => $title))->drawPage(); 39 | } 40 | } 41 | 42 | function postContent() { 43 | $this->createGatekeeper(); 44 | 45 | $new = false; 46 | if (!empty($this->arguments)) { 47 | $object = \IdnoPlugins\Video\Video::getByID($this->arguments[0]); 48 | } 49 | if (empty($object)) { 50 | $object = new \IdnoPlugins\Video\Video(); 51 | } 52 | 53 | if ($object->saveDataFromInput()) { 54 | $forward = $this->getInput('forward-to', $object->getDisplayURL()); 55 | $this->forward($forward); 56 | } 57 | 58 | } 59 | 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /templates/default/entity/Video.tpl.php: -------------------------------------------------------------------------------- 1 | currentPage()->isPermalink()) { 3 | $rel = 'rel="in-reply-to"'; 4 | } else { 5 | $rel = ''; 6 | } 7 | if (!empty($vars['object']->tags)) { 8 | $vars['object']->body .= '
' . $vars['object']->tags . '
'; 9 | } 10 | if (empty($vars['feed_view']) && $vars['object']->getTitle() && $vars['object']->getTitle() != 'Untitled') { 11 | ?> 12 |40 | 41 |
42 | 45 | = $this->autop($this->parseHashtags($this->parseURLs($vars['object']->body, $rel))) ?> 46 | 47 |