Changeset 3874:ab8368569446 for plugins/blogroll
- Timestamp:
- 09/14/18 12:16:17 (7 years ago)
- Branch:
- default
- Location:
- plugins/blogroll
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/blogroll/_admin.php
r3731 r3874 18 18 function blogroll_dashboard($core, $icons) 19 19 { 20 $icons['blogroll'] = new ArrayObject( array(20 $icons['blogroll'] = new ArrayObject([ 21 21 __('Blogroll'), 22 22 $core->adminurl->get('admin.plugin.blogroll'), 23 23 dcPage::getPF('blogroll/icon.png') 24 ));24 ]); 25 25 } 26 26 function blogroll_dashboard_favorites($core, $favs) 27 27 { 28 $favs->register('blogroll', array(28 $favs->register('blogroll', [ 29 29 'title' => __('Blogroll'), 30 30 'url' => $core->adminurl->get('admin.plugin.blogroll'), … … 32 32 'large-icon' => dcPage::getPF('blogroll/icon.png'), 33 33 'permissions' => 'usage,contentadmin' 34 ));34 ]); 35 35 } 36 36 function blogroll_users_actions_headers() -
plugins/blogroll/_define.php
r3731 r3874 17 17 "Olivier Meunier", // Author 18 18 '1.4', // Version 19 array(19 [ 20 20 'permissions' => 'blogroll', 21 21 'type' => 'plugin' 22 )22 ] 23 23 ); -
plugins/blogroll/_public.php
r3731 r3874 15 15 16 16 # Blogroll template functions 17 $core->tpl->addValue('Blogroll', array('tplBlogroll', 'blogroll'));18 $core->tpl->addValue('BlogrollXbelLink', array('tplBlogroll', 'blogrollXbelLink'));19 20 $core->url->register('xbel', 'xbel', '^xbel(?:/?)$', array('urlBlogroll', 'xbel'));17 $core->tpl->addValue('Blogroll', ['tplBlogroll', 'blogroll']); 18 $core->tpl->addValue('BlogrollXbelLink', ['tplBlogroll', 'blogrollXbelLink']); 19 20 $core->url->register('xbel', 'xbel', '^xbel(?:/?)$', ['urlBlogroll', 'xbel']); 21 21 22 22 class tplBlogroll … … 75 75 return ''; 76 76 } 77 $hierarchy = array($hierarchy[$category]);77 $hierarchy = [$hierarchy[$category]]; 78 78 } 79 79 -
plugins/blogroll/_widgets.php
r3731 r3874 12 12 if (!defined('DC_RC_PATH')) {return;} 13 13 14 $core->addBehavior('initWidgets', array('blogrollWidgets', 'initWidgets'));15 $core->addBehavior('initDefaultWidgets', array('blogrollWidgets', 'initDefaultWidgets'));14 $core->addBehavior('initWidgets', ['blogrollWidgets', 'initWidgets']); 15 $core->addBehavior('initDefaultWidgets', ['blogrollWidgets', 'initDefaultWidgets']); 16 16 17 17 class blogrollWidgets … … 19 19 public static function initWidgets($w) 20 20 { 21 $w->create('links', __('Blogroll'), array('tplBlogroll', 'linksWidget'), null, 'Blogroll list');21 $w->create('links', __('Blogroll'), ['tplBlogroll', 'linksWidget'], null, 'Blogroll list'); 22 22 $w->links->setting('title', __('Title (optional)') . ' :', __('Links')); 23 23 … … 25 25 $h = $br->getLinksHierarchy($br->getLinks()); 26 26 $h = array_keys($h); 27 $categories = array(__('All categories') => '');27 $categories = [__('All categories') => '']; 28 28 foreach ($h as $v) { 29 29 if ($v) { … … 35 35 36 36 $w->links->setting('homeonly', __('Display on:'), 1, 'combo', 37 array(37 [ 38 38 __('All pages') => 0, 39 39 __('Home page only') => 1, 40 40 __('Except on home page') => 2 41 )41 ] 42 42 ); 43 43 $w->links->setting('content_only', __('Content only'), 0, 'check'); -
plugins/blogroll/class.dc.blogroll.php
r3817 r3874 25 25 } 26 26 27 public function getLinks($params = array())27 public function getLinks($params = []) 28 28 { 29 29 $strReq = 'SELECT link_id, link_title, link_desc, link_href, ' . … … 46 46 } 47 47 48 public function getLangs($params = array())48 public function getLangs($params = []) 49 49 { 50 50 // Use post_lang as an alias of link_lang to be able to use the dcAdminCombos::getLangsCombo() function … … 207 207 public function getLinksHierarchy($rs) 208 208 { 209 $res = array();209 $res = []; 210 210 211 211 foreach ($rs->rows() as $k => $v) { -
plugins/blogroll/class.dc.importblogroll.php
r3731 r3874 36 36 $outlines = $xml->xpath("//outline"); 37 37 38 $this->entries = array();38 $this->entries = []; 39 39 foreach ($outlines as $outline) { 40 40 if (isset($outline['htmlUrl'])) { … … 66 66 $outlines = $xml->xpath("//bookmark"); 67 67 68 $this->entries = array();68 $this->entries = []; 69 69 foreach ($outlines as $outline) { 70 70 if (!isset($outline['href'])) { -
plugins/blogroll/edit.php
r3817 r3874 85 85 86 86 # Languages combo 87 $links = $blogroll->getLangs( array('order' => 'asc'));87 $links = $blogroll->getLangs(['order' => 'asc']); 88 88 $lang_combo = dcAdminCombos::getLangsCombo($links, true); 89 89 … … 97 97 <?php 98 98 echo dcPage::breadcrumb( 99 array(99 [ 100 100 html::escapeHTML($core->blog->name) => '', 101 101 __('Blogroll') => $p_url 102 )) .102 ]) . 103 103 dcPage::notices(); 104 104 ?> … … 113 113 114 114 '<p><label for="link_desc" class="required classic"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label> ' . 115 form::field('link_desc', 30, 255, array(115 form::field('link_desc', 30, 255, [ 116 116 'default' => html::escapeHTML($link_desc), 117 117 'extra_html' => 'required placeholder="' . __('Title') . '"' 118 )) .118 ]) . 119 119 120 120 form::hidden('edit', 1) . … … 133 133 134 134 '<p><label for="link_title" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label> ' . 135 form::field('link_title', 30, 255, array(135 form::field('link_title', 30, 255, [ 136 136 'default' => html::escapeHTML($link_title), 137 137 'extra_html' => 'required placeholder="' . __('Title') . '"' 138 )) .138 ]) . 139 139 '</p>' . 140 140 141 141 '<p><label for="link_href" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('URL:') . '</label> ' . 142 form::url('link_href', array(142 form::url('link_href', [ 143 143 'size' => 30, 144 144 'default' => html::escapeHTML($link_href), 145 145 'extra_html' => 'required placeholder="' . __('URL') . '"' 146 )) .146 ]) . 147 147 '</p>' . 148 148 … … 167 167 '<th>' . __('_xfn_Me') . '</th>' . 168 168 '<td><p>' . '<label class="classic">' . 169 form::checkbox( array('identity'), 'me', ($link_xfn == 'me')) . ' ' .169 form::checkbox(['identity'], 'me', ($link_xfn == 'me')) . ' ' . 170 170 __('_xfn_Another link for myself') . '</label></p></td>' . 171 171 '</tr>' . … … 174 174 '<th>' . __('_xfn_Friendship') . '</th>' . 175 175 '<td><p>' . 176 '<label class="classic">' . form::radio( array('friendship'), 'contact',176 '<label class="classic">' . form::radio(['friendship'], 'contact', 177 177 strpos($link_xfn, 'contact') !== false) . __('_xfn_Contact') . '</label> ' . 178 '<label class="classic">' . form::radio( array('friendship'), 'acquaintance',178 '<label class="classic">' . form::radio(['friendship'], 'acquaintance', 179 179 strpos($link_xfn, 'acquaintance') !== false) . __('_xfn_Acquaintance') . '</label> ' . 180 '<label class="classic">' . form::radio( array('friendship'), 'friend',180 '<label class="classic">' . form::radio(['friendship'], 'friend', 181 181 strpos($link_xfn, 'friend') !== false) . __('_xfn_Friend') . '</label> ' . 182 '<label class="classic">' . form::radio( array('friendship'), '') . __('None') . '</label>' .182 '<label class="classic">' . form::radio(['friendship'], '') . __('None') . '</label>' . 183 183 '</p></td>' . 184 184 '</tr>' . … … 187 187 '<th>' . __('_xfn_Physical') . '</th>' . 188 188 '<td><p>' . 189 '<label class="classic">' . form::checkbox( array('physical'), 'met',189 '<label class="classic">' . form::checkbox(['physical'], 'met', 190 190 strpos($link_xfn, 'met') !== false) . __('_xfn_Met') . '</label>' . 191 191 '</p></td>' . … … 195 195 '<th>' . __('_xfn_Professional') . '</th>' . 196 196 '<td><p>' . 197 '<label class="classic">' . form::checkbox( array('professional[]'), 'co-worker',197 '<label class="classic">' . form::checkbox(['professional[]'], 'co-worker', 198 198 strpos($link_xfn, 'co-worker') !== false) . __('_xfn_Co-worker') . '</label> ' . 199 '<label class="classic">' . form::checkbox( array('professional[]'), 'colleague',199 '<label class="classic">' . form::checkbox(['professional[]'], 'colleague', 200 200 strpos($link_xfn, 'colleague') !== false) . __('_xfn_Colleague') . '</label>' . 201 201 '</p></td>' . … … 205 205 '<th>' . __('_xfn_Geographical') . '</th>' . 206 206 '<td><p>' . 207 '<label class="classic">' . form::radio( array('geographical'), 'co-resident',207 '<label class="classic">' . form::radio(['geographical'], 'co-resident', 208 208 strpos($link_xfn, 'co-resident') !== false) . __('_xfn_Co-resident') . '</label> ' . 209 '<label class="classic">' . form::radio( array('geographical'), 'neighbor',209 '<label class="classic">' . form::radio(['geographical'], 'neighbor', 210 210 strpos($link_xfn, 'neighbor') !== false) . __('_xfn_Neighbor') . '</label> ' . 211 '<label class="classic">' . form::radio( array('geographical'), '') . __('None') . '</label>' .211 '<label class="classic">' . form::radio(['geographical'], '') . __('None') . '</label>' . 212 212 '</p></td>' . 213 213 '</tr>' . … … 216 216 '<th>' . __('_xfn_Family') . '</th>' . 217 217 '<td><p>' . 218 '<label class="classic">' . form::radio( array('family'), 'child',218 '<label class="classic">' . form::radio(['family'], 'child', 219 219 strpos($link_xfn, 'child') !== false) . __('_xfn_Child') . '</label> ' . 220 '<label class="classic">' . form::radio( array('family'), 'parent',220 '<label class="classic">' . form::radio(['family'], 'parent', 221 221 strpos($link_xfn, 'parent') !== false) . __('_xfn_Parent') . '</label> ' . 222 '<label class="classic">' . form::radio( array('family'), 'sibling',222 '<label class="classic">' . form::radio(['family'], 'sibling', 223 223 strpos($link_xfn, 'sibling') !== false) . __('_xfn_Sibling') . '</label> ' . 224 '<label class="classic">' . form::radio( array('family'), 'spouse',224 '<label class="classic">' . form::radio(['family'], 'spouse', 225 225 strpos($link_xfn, 'spouse') !== false) . __('_xfn_Spouse') . '</label> ' . 226 '<label class="classic">' . form::radio( array('family'), 'kin',226 '<label class="classic">' . form::radio(['family'], 'kin', 227 227 strpos($link_xfn, 'kin') !== false) . __('_xfn_Kin') . '</label> ' . 228 '<label class="classic">' . form::radio( array('family'), '') . __('None') . '</label>' .228 '<label class="classic">' . form::radio(['family'], '') . __('None') . '</label>' . 229 229 '</p></td>' . 230 230 '</tr>' . … … 233 233 '<th>' . __('_xfn_Romantic') . '</th>' . 234 234 '<td><p>' . 235 '<label class="classic">' . form::checkbox( array('romantic[]'), 'muse',235 '<label class="classic">' . form::checkbox(['romantic[]'], 'muse', 236 236 strpos($link_xfn, 'muse') !== false) . __('_xfn_Muse') . '</label> ' . 237 '<label class="classic">' . form::checkbox( array('romantic[]'), 'crush',237 '<label class="classic">' . form::checkbox(['romantic[]'], 'crush', 238 238 strpos($link_xfn, 'crush') !== false) . __('_xfn_Crush') . '</label> ' . 239 '<label class="classic">' . form::checkbox( array('romantic[]'), 'date',239 '<label class="classic">' . form::checkbox(['romantic[]'], 'date', 240 240 strpos($link_xfn, 'date') !== false) . __('_xfn_Date') . '</label> ' . 241 '<label class="classic">' . form::checkbox( array('romantic[]'), 'sweetheart',241 '<label class="classic">' . form::checkbox(['romantic[]'], 'sweetheart', 242 242 strpos($link_xfn, 'sweetheart') !== false) . __('_xfn_Sweetheart') . '</label> ' . 243 243 '</p></td>' . -
plugins/blogroll/index.php
r3731 r3874 125 125 126 126 # Order links 127 $order = array();127 $order = []; 128 128 if (empty($_POST['links_order']) && !empty($_POST['order'])) { 129 129 $order = $_POST['order']; … … 178 178 <?php 179 179 echo dcPage::breadcrumb( 180 array(180 [ 181 181 html::escapeHTML($core->blog->name) => '', 182 182 __('Blogroll') => '' 183 )) .183 ]) . 184 184 dcPage::notices(); 185 185 ?> … … 208 208 echo 209 209 '<tr class="line" id="l_' . $rs->link_id . '">' . 210 '<td class="handle minimal">' . form::field( array('order[' . $rs->link_id . ']'), 2, 5, array(210 '<td class="handle minimal">' . form::field(['order[' . $rs->link_id . ']'], 2, 5, [ 211 211 'default' => $position, 212 212 'class' => 'position', 213 213 'extra_html' => 'title="' . __('position') . '"' 214 )) .214 ]) . 215 215 '</td>' . 216 '<td class="minimal">' . form::checkbox( array('remove[]'), $rs->link_id,217 array(216 '<td class="minimal">' . form::checkbox(['remove[]'], $rs->link_id, 217 [ 218 218 'extra_html' => 'title="' . __('select this link') . '"' 219 )219 ] 220 220 ) . '</td>'; 221 221 … … 244 244 echo 245 245 form::hidden('links_order', '') . 246 form::hidden( array('p'), 'blogroll') .246 form::hidden(['p'], 'blogroll') . 247 247 $core->formNonce(); 248 248 ?> … … 268 268 '<h3>' . __('Add a new link') . '</h3>' . 269 269 '<p class="col"><label for="link_title" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label> ' . 270 form::field('link_title', 30, 255, array(270 form::field('link_title', 30, 255, [ 271 271 'default' => $link_title, 272 272 'extra_html' => 'required placeholder="' . __('Title') . '"' 273 )) .273 ]) . 274 274 '</p>' . 275 275 276 276 '<p class="col"><label for="link_href" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('URL:') . '</label> ' . 277 form::field('link_href', 30, 255, array(277 form::field('link_href', 30, 255, [ 278 278 'default' => $link_href, 279 279 'extra_html' => 'required placeholder="' . __('URL') . '"' 280 )) .280 ]) . 281 281 '</p>' . 282 282 … … 288 288 form::field('link_lang', 5, 5, $link_lang) . 289 289 '</p>' . 290 '<p>' . form::hidden( array('p'), 'blogroll') .290 '<p>' . form::hidden(['p'], 'blogroll') . 291 291 $core->formNonce() . 292 292 '<input type="submit" name="add_link" value="' . __('Save') . '" /></p>' . … … 299 299 '<h3>' . __('Add a new category') . '</h3>' . 300 300 '<p><label for="cat_title" class=" classic required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label> ' . 301 form::field('cat_title', 30, 255, array(301 form::field('cat_title', 30, 255, [ 302 302 'default' => $cat_title, 303 303 'extra_html' => 'required placeholder="' . __('Title') . '"' 304 )) .304 ]) . 305 305 ' ' . 306 form::hidden( array('p'), 'blogroll') .306 form::hidden(['p'], 'blogroll') . 307 307 $core->formNonce() . 308 308 '<input type="submit" name="add_cat" value="' . __('Save') . '" /></p>' . … … 318 318 '<p><label for="links_file" class=" classic required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('OPML or XBEL File:') . '</label> ' . 319 319 '<input type="file" id="links_file" name="links_file" required /></p>' . 320 '<p>' . form::hidden( array('p'), 'blogroll') .320 '<p>' . form::hidden(['p'], 'blogroll') . 321 321 $core->formNonce() . 322 322 '<input type="submit" name="import_links" value="' . __('Import') . '" /></p>' . … … 342 342 343 343 echo 344 '<tr><td>' . form::checkbox( array('entries[]'), $i) . '</td>' .344 '<tr><td>' . form::checkbox(['entries[]'], $i) . '</td>' . 345 345 '<td nowrap><a href="' . $url . '">' . $title . '</a>' . 346 346 '<input type="hidden" name="url[' . $i . ']" value="' . $url . '" />' . … … 358 358 359 359 '<p class="col right">' . 360 form::hidden( array('p'), 'blogroll') .360 form::hidden(['p'], 'blogroll') . 361 361 $core->formNonce() . 362 362 '<input type="submit" name="cancel_import" value="' . __('Cancel') . '" /> ' .
Note: See TracChangeset
for help on using the changeset viewer.