12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- require dirname(__FILE__).'/inc/prepend.php';
- require dirname(__FILE__).'/../inc/incutio/class.httpClient.php';
- require dirname(__FILE__).'/../inc/libs/lib.validator.php';
- $auth->check(1);
- include dirname(__FILE__).'/inc/connexion.php';
- openPopup(__('Entry validation'));
- $post_id = (!empty($_GET['post_id'])) ? $_GET['post_id'] : '';
- $co_id = (!empty($_GET['co_id'])) ? $_GET['co_id'] : '';
- $is_post = $is_comment = false;
- if ($post_id != '')
- {
- $post = $blog->getPostByID($post_id);
- $is_post = true;
- echo '<h2>'.__('Entry validation').'</h2>';
- }
- elseif ($co_id != '')
- {
- $comment = $blog->getComment($co_id);
- $is_comment = true;
- echo '<h2>'.__('Comment validation').'</h2>';
- }
- if ((empty($post) || $post->isEmpty()) && (empty($comment) || $comment->isEmpty()))
- {
- echo
- '<div class="erreur"><p><strong>'.__('Error(s)').' :</strong></p>'.
- '<p>'.($is_post ? __('No entry') : __('No comment')).'</p></div>';
- }
- else
- {
- flush();
-
- if ($post_id != '') {
- $content = $post->f('post_chapo')."\n".$post->f('post_content');
- } else {
- $content = $comment->f('comment_content');
- }
-
- if (($valid = validator::xhtml($content)) === false)
- {
- echo '<p>'.__('Cannot connect to server.').'</p>';
- }
- elseif ($valid['valid'] == true)
- {
- echo '<h3>'.($is_post ? __('Valid entry') : __('Valid comment')).'</h3>';
- }
- elseif ($valid['valid'] == false)
- {
- echo '<h3>'.($is_post ? __('Invalid entry') : __('Invalid comment')).'</h3>';
-
- if ($valid['errors'] != '')
- {
- echo '<p>'.__('Errors list').' :</p>';
- echo $valid['errors'];
- }
- }
-
- echo '<p class="small">'.sprintf(__('Validation done with %s'),'WDG HTML Validator').'<br />'.
- 'http://www.htmlhelp.com/tools/validator/</p>';
- echo '<p><img src="images/wdglogo-small.gif" alt="" /></p>';
- }
- closePopup();
- ?>
|