Skip to content

Commit

Permalink
Premiere release publique
Browse files Browse the repository at this point in the history
  • Loading branch information
Gvx- committed Oct 16, 2015
0 parents commit d12ccad
Show file tree
Hide file tree
Showing 27 changed files with 2,023 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Changelog
=========

Version 2.0.0 (2015-10-16)
--------------------------
* Première release publique
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# README #

Ce plugin pour [Dotclear](http://fr.dotclear.org/) permet d'inserer du code HTML dans les pages publiques depuis un editeur de code interne.

## Caractéristiques ##
L'editeur de code utilise la coloration syntaxique de [CodeMirror](http://codemirror.net/)

## Pré-requis ##
* Dotclear 2.7 ou plus

## Utilisation ##
Le plugin met a disposition 2 editeurs de code HTML:
* Un editeur pour inserer du code dans le header (balise `<head>`)
* Un editeur pour inserer du code dans le footer de la page

## Téléchargements ##
Vous pouvez télécharger les packages [ici](https://bitbucket.org/Gvx_/dcscript/downloads)

## Signaler un dysfonctionnement ##
Vous pouvez signaler un dysfonctionnement ou faire une demande d’amélioration [ici](https://bitbucket.org/Gvx_/dcscript/issues/new)

## Licence ##
Ce code est sous licence [GPL version 2.0](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
339 changes: 339 additions & 0 deletions dcScript/LICENSE

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions dcScript/_admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/* -- BEGIN LICENSE BLOCK -----------------------------------------------------
* This file is part of plugin dcScript for Dotclear 2.
* Copyright © 2014-2015 Gvx
* Licensed under the GPL version 2.0 license.
* (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* -- END LICENSE BLOCK -----------------------------------------------------*/
if (!defined('DC_CONTEXT_ADMIN')) { return; }

if(!$core->auth->check('admin',$core->blog->id)) { return; }

$core->addBehavior('adminDashboardFavorites', array($core->dcScript, 'adminDashboardFavs'));

$core->dcScript->adminMenu('System');
73 changes: 73 additions & 0 deletions dcScript/_config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php
/* -- BEGIN LICENSE BLOCK -----------------------------------------------------
* This file is part of plugin dcScript for Dotclear 2.
* Copyright © 2014-2015 Gvx
* Licensed under the GPL version 2.0 license.
* (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* -- END LICENSE BLOCK -----------------------------------------------------*/
if (!defined('DC_CONTEXT_ADMIN')) { return; }

dcPage::check('admin');

if (isset($_POST['save'])) {
try {
$core->dcScript->settings('enabled', !empty($_POST['enabled']));
$core->dcScript->settings('header_code_enabled', !empty($_POST['header_code_enabled']));
$core->dcScript->settings('footer_code_enabled', !empty($_POST['footer_code_enabled']));
$core->dcScript->settings('backup_ext', html::escapeHTML($_POST['backup']));
$core->blog->triggerBlog();
dcPage::addSuccessNotice(__('Configuration successfully updated.'));
} catch(exception $e) {
//$core->error->add($e->getMessage());
$core->error->add(__('Unable to save the configuration'));
}
if(empty($_REQUEST['redir'])) {
$core->error->add(__('Redirection not found'));
$core->adminurl->redirect('admin.home');
}
http::redirect($_REQUEST['redir']);
}

echo
'<div class="fieldset">
<h3>'.__('Activation').'</h3>
<p>
'.form::checkbox('enabled','1',$core->dcScript->settings('enabled')).
'<label class="classic" for="enabled">
'.sprintf(__('Enable %s on this blog'), html::escapeHTML(__($core->plugins->moduleInfo($core->dcScript->plugin_id, 'name')))).
'</label>
</p>
<p class="form-note">'.__('Enable the plugin on this blog.').'</p>
</div>
<div id="options">
<div class="fieldset">
<h3>'.__('Active codes').'</h3>
<div class="two-cols clear">
<div class="col">
<p>
'.form::checkbox('header_code_enabled','1',$core->dcScript->settings('header_code_enabled'))
.'<label class="classic" for="header_code_enabled">'.__('Enable header code').'</label>
</p>
<p class="form-note">'.__('Enable public header code.').'</p>
</div>
<div class="col">
<p>
'.form::checkbox('footer_code_enabled','1',$core->dcScript->settings('footer_code_enabled'))
.'<label class="classic" for="footer_code_enabled">'.__('Enable footer code').'</label>
</p>
<p class="form-note">'.__('Enable public footer code.').'</p>
</div>
</div>
<div class="clear"></div>
</div>
<div class="fieldset clear">
<h3>'.__('Options').'</h3>
<p>
<label class="classic" for="backup">'.__('Extension Backup Files').' : </label>
'.form::field('backup',25,255,$core->dcScript->settings('backup_ext'),'classic').'
</p>
<p class="form-note">'.__('Default extension backup files.').'</p>
</div>
</div>
';
dcPage::helpBlock('dcScript-config');
30 changes: 30 additions & 0 deletions dcScript/_define.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/* -- BEGIN LICENSE BLOCK -----------------------------------------------------
* This file is part of plugin dcScript for Dotclear 2.
* Copyright © 2014-2015 Gvx
* Licensed under the GPL version 2.0 license.
* (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* -- END LICENSE BLOCK -----------------------------------------------------*/
if (!defined('DC_RC_PATH')) { return; }

$this->registerModule(
/* Name */ 'dcScript',
/* Description*/ 'Add script for DC 2.7+',
/* Author */ 'Gvx',
/* Version */ '2.0.0-r0034',
array(
'permissions' => 'admin',
'type' => 'plugin',
'Priority' => 1000,
'support' /* url */ => 'http://forum.dotclear.org/index.php',
'details' /* url */ => 'http://plugins.dotaddict.org/dc2/',
'requires' /*id*/ => array(

)
)
);

# ---------------------------------------------------------
# use codemirror version 5.7
# see: http://codemirror.net/
# ---------------------------------------------------------
10 changes: 10 additions & 0 deletions dcScript/_install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
/* -- BEGIN LICENSE BLOCK -----------------------------------------------------
* This file is part of plugin dcScript for Dotclear 2.
* Copyright © 2014-2015 Gvx
* Licensed under the GPL version 2.0 license.
* (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* -- END LICENSE BLOCK -----------------------------------------------------*/
if (!defined('DC_CONTEXT_ADMIN')) { return; }

return $core->dcScript->install('2.7');
22 changes: 22 additions & 0 deletions dcScript/_prepend.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/* -- BEGIN LICENSE BLOCK -----------------------------------------------------
* This file is part of plugin dcScript for Dotclear 2.
* Copyright © 2014-2015 Gvx
* Licensed under the GPL version 2.0 license.
* (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* -- END LICENSE BLOCK -----------------------------------------------------*/
if (!defined('DC_RC_PATH')) { return; } # public & admin

# chargement des class du plugin
$__autoload['dcScript'] = dirname(__FILE__).'/inc/class.dcScript.php';

# initialisation
dcScript::init(array(
'perm' => 'admin', # permissions acces page administration
'icons' => array( # icones pour menu & tableau de bord
'small' => '/inc/icon-small.png',
'large' => '/inc/icon-large.png'
)
));

if (!defined('DC_CONTEXT_ADMIN')) { return false; } # admin only
11 changes: 11 additions & 0 deletions dcScript/_public.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/* -- BEGIN LICENSE BLOCK -----------------------------------------------------
* This file is part of plugin dcScript for Dotclear 2.
* Copyright © 2014-2015 Gvx
* Licensed under the GPL version 2.0 license.
* (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* -- END LICENSE BLOCK -----------------------------------------------------*/
if (!defined('DC_RC_PATH')) { return; }

$core->addBehavior('publicHeadContent', array('dcScript', 'publicHeadContent'));
$core->addBehavior('publicFooterContent', array('dcScript', 'publicFooterContent'));
19 changes: 19 additions & 0 deletions dcScript/codemirror/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (C) 2014 by Marijn Haverbeke <marijnh@gmail.com> and others

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
37 changes: 37 additions & 0 deletions dcScript/codemirror/codemirror-compressed.js

Large diffs are not rendered by default.

Loading

0 comments on commit d12ccad

Please sign in to comment.