Changeset 655 for plugins/typo
- Timestamp:
- 01/05/09 20:04:55 (15 years ago)
- Location:
- plugins/typo
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/typo/CHANGELOG
r648 r655 1 1 Typo plugin 1.4 for Dotclear 2 2 2 =========================================== 3 * Hyphenation is not more stored in database (entries and comments) 4 * Admin action on entries limited to typo transformation 5 * Hyphenation disabled (unable to develop something good enough) 3 * Admin action on entries - draft 4 * Hyphenation feature removed from this plugin 6 5 7 6 Typo plugin 1.3 for Dotclear 2 -
plugins/typo/_admin.php
r648 r655 12 12 13 13 require_once dirname(__FILE__).'/inc/smartypants.php'; 14 require_once dirname(__FILE__).'/inc/hyphenation.php';15 14 16 15 /* Add behavior callback, will be used for all types of posts (standard, page, galery item, ...) */ -
plugins/typo/_define.php
r648 r655 13 13 $this->registerModule( 14 14 /* Name */ "Typo", 15 /* Description*/ "Brings smart typographic punctuation and soft hyphenation HTML entities for your entries",15 /* Description*/ "Brings smart typographic replacements for your entries", 16 16 /* Author */ "Franck Paul", 17 17 /* Version */ '1.4', -
plugins/typo/_public.php
r648 r655 12 12 13 13 require_once dirname(__FILE__).'/inc/smartypants.php'; 14 require_once dirname(__FILE__).'/inc/hyphenation.php';15 14 16 15 /* Add behavior callback for typo replacement in comments */ … … 18 17 $core->addBehavior('publicBeforeCommentPreview',array('dcTypo','previewTypoComments')); 19 18 20 /* Add behavior callback for hyphenation in entries and comments */21 //$core->addBehavior('coreBlogGetPosts',array('dcTypo','prepareTypoEntries'));22 //$core->addBehavior('coreBlogGetComments',array('dcTypo','prepareTypoComments'));23 24 /* Add behavior callback for hyphenation in entries and comments */25 //$core->addBehavior('publicEntryBeforeContent',array('dcTypo','hyphenateEntry'));26 //$core->addBehavior('publicCommentBeforeContent',array('dcTypo','hyphenateComment'));27 28 19 class dcTypo 29 20 { 30 public static function hyphenateEntry(&$core,&$_ctx)31 {32 if ($core->blog->settings->typo_active && $core->blog->settings->typo_hyphenation)33 {34 if ($_ctx->posts->exists('post_lang') && ($_ctx->posts->exists('post_excerpt_xhtml') || $_ctx->posts->exists('post_content_xhtml'))) {35 $language = $_ctx->posts->post_lang;36 $hyphenate = preset_hyphenation($language, $path_to_patterns, $dictionary,37 $leftmin, $rightmin, $charmin);38 if ($hyphenate) {39 if ($_ctx->posts->exists('post_excerpt_xhtml')) {40 $_ctx->posts->post_excerpt_xhtml = hyphenation($_ctx->posts->post_excerpt_xhtml, $language, $path_to_patterns, $dictionary,41 $leftmin, $rightmin, $charmin);42 }43 if ($_ctx->posts->exists('post_content_xhtml')) {44 $_ctx->posts->post_content_xhtml = hyphenation($_ctx->posts->post_content_xhtml, $language, $path_to_patterns, $dictionary,45 $leftmin, $rightmin, $charmin);46 }47 }48 }49 }50 }51 52 public static function hyphenateComment(&$core,&$_ctx)53 {54 if ($core->blog->settings->typo_active && $core->blog->settings->typo_hyphenation_comments)55 {56 if ($_ctx->posts->exists('post_lang') && $_ctx->comments->exists('comment_content')) {57 $language = $_ctx->posts->post_lang;58 $hyphenate = preset_hyphenation($language, $path_to_patterns, $dictionary, $leftmin, $rightmin, $charmin);59 if ($hyphenate) {60 $_ctx->comments->comment_content = hyphenation($_ctx->comments->comment_content, $language, $path_to_patterns, $dictionary,61 $leftmin, $rightmin, $charmin);62 }63 }64 }65 }66 67 public static function prepareTypoEntries(&$rs)68 {69 global $core;70 71 if ($core->blog->settings->typo_active && $core->blog->settings->typo_hyphenation)72 {73 $rs = $rs->toStatic();74 if ($rs->exists('post_lang') && ($rs->exists('post_excerpt_xhtml') || $rs->exists('post_content_xhtml'))) {75 while ($rs->fetch()) {76 $language = $rs->post_lang;77 $hyphenate = preset_hyphenation($language, $path_to_patterns, $dictionary,78 $leftmin, $rightmin, $charmin);79 if ($hyphenate) {80 if ($rs->exists('post_excerpt_xhtml')) {81 $rs->post_excerpt_xhtml = hyphenation($rs->post_excerpt_xhtml, $language, $path_to_patterns, $dictionary,82 $leftmin, $rightmin, $charmin);83 }84 if ($rs->exists('post_content_xhtml')) {85 $rs->post_content_xhtml = hyphenation($rs->post_content_xhtml, $language, $path_to_patterns, $dictionary,86 $leftmin, $rightmin, $charmin);87 }88 }89 }90 }91 }92 }93 94 public static function prepareTypoComments(&$rs)95 {96 global $core;97 global $_ctx;98 99 if ($core->blog->settings->typo_active && $core->blog->settings->typo_hyphenation_comments)100 {101 $rs = $rs->toStatic();102 if ($_ctx->posts->exists('post_lang') && $rs->exists('comment_content')) {103 while ($rs->fetch()) {104 $language = $_ctx->posts->post_lang;105 $hyphenate = preset_hyphenation($language, $path_to_patterns, $dictionary, $leftmin, $rightmin, $charmin);106 if ($hyphenate) {107 $rs->comment_content = hyphenation($rs->comment_content, $language, $path_to_patterns, $dictionary,108 $leftmin, $rightmin, $charmin);109 }110 }111 }112 }113 }114 115 21 public static function updateTypoComments(&$blog,&$cur) 116 22 { -
plugins/typo/index.php
r648 r655 31 31 $core->blog->settings->put('typo_entries',true,'boolean'); 32 32 $core->blog->settings->put('typo_comments',false,'boolean'); 33 $core->blog->settings->put('typo_hyphenation',false,'boolean');34 $core->blog->settings->put('typo_hyphenation_comments',false,'boolean');35 33 $core->blog->triggerBlog(); 36 34 http::redirect(http::getSelfURI()); … … 59 57 $typo_entries = (boolean)$core->blog->settings->typo_entries; 60 58 $typo_comments = (boolean)$core->blog->settings->typo_comments; 61 $typo_hyphenation = (boolean)$core->blog->settings->typo_hyphenation;62 $typo_hyphenation_comments = (boolean)$core->blog->settings->typo_hyphenation_comments;63 59 64 60 // Saving new configuration … … 71 67 $typo_entries = (empty($_POST['entries']))?false:true; 72 68 $typo_comments = (empty($_POST['comments']))?false:true; 73 $typo_hyphenation = (empty($_POST['hyphenation']))?false:true;74 $typo_hyphenation_comments = (empty($_POST['hyphenation_comments']))?false:true;75 69 $core->blog->settings->put('typo_active',$typo_active,'boolean'); 76 70 $core->blog->settings->put('typo_entries',$typo_entries,'boolean'); 77 71 $core->blog->settings->put('typo_comments',$typo_comments,'boolean'); 78 $core->blog->settings->put('typo_hyphenation',$typo_hyphenation,'boolean');79 $core->blog->settings->put('typo_hyphenation_comments',$typo_hyphenation_comments,'boolean');80 72 $core->blog->triggerBlog(); 81 73 $msg = __('Configuration successfully updated.'); … … 119 111 </p> 120 112 <p class="form-note"><?php echo __('Activating this option enforces typographic replacements in blog comments (excluding trackbacks)'); ?></p> 121 <p class="field">122 <?php echo form::checkbox('hyphenation', 1, $typo_hyphenation); ?>123 <label class="classic" for="hyphenation"><?php echo __('Enable hyphenation for entries'); ?></label>124 </p>125 <p class="form-note"><?php echo __('Activating this option enforces soft hyphenation insertion in blog entries'); ?></p>126 <p class="field">127 <?php echo form::checkbox('hyphenation_comments', 1, $typo_hyphenation_comments); ?>128 <label class="classic" for="hyphenation_comments"><?php echo __('Enable hyphenation for comments'); ?></label>129 </p>130 <p class="form-note"><?php echo __('Activating this option enforces soft hyphenation insertion in blog comments (excluding trackbacks)'); ?></p>131 113 </fieldset> 132 114 -
plugins/typo/locales/fr/main.po
r648 r655 7 7 "Project-Id-Version: Dotclear 2 typo extension\n" 8 8 "Report-Msgid-Bugs-To: \n" 9 "POT-Creation-Date: 200 8-12-25 17:16+0100\n"10 "PO-Revision-Date: 200 8-12-25 17:17+0100\n"9 "POT-Creation-Date: 2009-01-05 19:57+0100\n" 10 "PO-Revision-Date: 2009-01-05 19:58+0100\n" 11 11 "Last-Translator: Franck Paul <carnet.franck.paul@gmail.com>\n" 12 12 "Language-Team: Franck Paul <franck.paul@free.fr>\n" … … 30 30 msgstr "Appliquer les remplacements typographiques pour les billets sélectionnés" 31 31 32 msgid " Apply soft hyphenation insertion for selected entries"33 msgstr "A ppliquer l'insertion de marques de césure optionnelles pour les billets sélectionnés"32 msgid "Warning! These replacements will not be undoable." 33 msgstr "Attention ces remplacements sont irreversibles." 34 34 35 35 msgid "Configuration successfully updated." … … 57 57 msgstr "Activer cette option permet le remplacement des éléments typographiques pour les commentaires (rétroliens exclus)" 58 58 59 msgid "Enable hyphenation for entries"60 msgstr "Activer l'insertion des marques de césure optionnelles"61 62 msgid "Activating this option enforces soft hyphenation insertion in blog entries"63 msgstr "Activer cette option permet l'insertion de marques de césure optionnelles dans le contenu des billets de ce blog"64 65 msgid "Enable hyphenation for comments"66 msgstr "Activer l'insertion des marques de césure optionnelles pour les commentaires également"67 68 msgid "Activating this option enforces soft hyphenation insertion in blog comments (excluding trackbacks)"69 msgstr "Activer cette option permet l'insertion de marques de césure optionnelles pour les commentaires (rétroliens exclus)"70 71 59 msgid "Save configuration" 72 60 msgstr "Enregistrer la configuration" 73 61 62 #~ msgid "Apply soft hyphenation insertion for selected entries" 63 #~ msgstr "Appliquer l'insertion de marques de césure optionnelles pour les billets sélectionnés" 64 #~ msgid "Enable hyphenation for entries" 65 #~ msgstr "Activer l'insertion des marques de césure optionnelles" 66 #~ msgid "Activating this option enforces soft hyphenation insertion in blog entries" 67 #~ msgstr "Activer cette option permet l'insertion de marques de césure optionnelles dans le contenu des billets de ce blog" 68 #~ msgid "Enable hyphenation for comments" 69 #~ msgstr "Activer l'insertion des marques de césure optionnelles pour les commentaires également" 70 #~ msgid "Activating this option enforces soft hyphenation insertion in blog comments (excluding trackbacks)" 71 #~ msgstr "Activer cette option permet l'insertion de marques de césure optionnelles pour les commentaires (rétroliens exclus)" 74 72 #~ msgid "Activating this plugin enforces typographic replacements in blog entries" 75 73 #~ msgstr "Activer cette extension permet le remplacement des éléments typographiques dans le contenu des billets de ce blog"
Note: See TracChangeset
for help on using the changeset viewer.