- Timestamp:
- 09/09/08 20:29:18 (2 months ago)
- Location:
- trunk/app
- Files:
-
- 5 modified
-
views/entries/admin_start.ctp (modified) (1 diff)
-
views/wikis/admin_add.ctp (modified) (1 diff)
-
views/wikis/admin_edit.ctp (modified) (1 diff)
-
views/wikis/admin_listing.ctp (modified) (1 diff)
-
webroot/js/wikitoolbar.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/views/entries/admin_start.ctp
r739 r764 30 30 echo $html->div('main-item', $tmp, array('title'=>'Messages', 'onclick'=>"document.location.href='/admin/messages/listing'")); 31 31 32 //$tmp = $html->link($html->image('wikis.png', array('title'=>'Wikis', 'alt'=>'Wikis')), '/admin/wikis/listing', null, null, false);33 //$tmp .= $html->link('Wikis', '/admin/wikis/listing', array('title'=>'Wikis', 'class'=>'main-item-caption'));34 //echo $html->div('main-item', $tmp, array('title'=>'Blog', 'onclick'=>"document.location.href='/admin/wikis/listing'"));32 $tmp = $html->link($html->image('wikis.png', array('title'=>'Wikis', 'alt'=>'Wikis')), '/admin/wikis/listing', null, null, false); 33 $tmp .= $html->link('Wikis', '/admin/wikis/listing', array('title'=>'Wikis', 'class'=>'main-item-caption')); 34 echo $html->div('main-item', $tmp, array('title'=>'Blog', 'onclick'=>"document.location.href='/admin/wikis/listing'")); 35 35 36 36 $tmp = $html->link($html->image('mmultimedia.png',array('title'=>__('Shared files', true), 'alt'=>__('Shared files', true))), '/admin/shares/listing', null, null, false); -
trunk/app/views/wikis/admin_add.ctp
r597 r764 3 3 <legend><?php __('Add Wiki');?></legend> 4 4 <?php 5 echo $html->div('optional',$form->input('Wiki.title', array('size' => 60)));6 echo $html->div('optional',$form->label('Wiki.subject_id', 'Subject:').$form->select('Wiki.subject_id', $subjects, null, null, false));7 echo $html->div('optional',$form->label('Wiki.content', 'Content').$form->textarea('Wiki.content', array('cols' => 60, 'rows' => 10)));8 echo $html->div('optional',$form->label('Wiki.status', 'Status:').$form->checkbox('Wiki.status', array('value'=>1)));5 echo $html->div('optional',$form->input('Wiki.title', array('size'=>60, 'maxlength'=>80))); 6 echo $html->div('optional',$form->label('Wiki.subject_id', __('Subject', true)).$form->select('Wiki.subject_id', $subjects, null, null, false)); 7 echo $html->div('optional',$form->label('Wiki.content', 'Content').$form->textarea('Wiki.content', array('cols' => 90, 'rows' => 20))); 8 echo $html->div('optional',$form->label('Wiki.status', __('Published', true)).$form->checkbox('Wiki.status', array('value'=>1))); 9 9 10 echo $html->div('submit', $form->end( 'Add'));10 echo $html->div('submit', $form->end(__('Save', true))); 11 11 ?> 12 12 </fieldset> -
trunk/app/views/wikis/admin_edit.ctp
r599 r764 8 8 <legend><?php __('Edit Wiki'); ?></legend> 9 9 <?php 10 echo $html->div('optional',$form->input('Wiki.title', array('size' => 60))); 11 echo $html->div('optional',$form->label('Wiki.subject_id', 'Subject:').$form->select('Wiki.subject_id', $subjects, null, null, false)); 12 echo $html->div('optional',$form->label('Wiki.content', 'Content').$form->textarea('Wiki.content', array('cols'=>100,'rows' =>15, 'class'=>'wikitext'))); 10 echo $form->input('Wiki.title', array('size' => 60, 'maxlength'=>80)); 11 echo $form->label('Wiki.subject_id', __('Subject', true)); 12 echo $form->select('Wiki.subject_id', $subjects, null, null, false); 13 echo $this->element('wikibar'); 14 echo $form->textarea('Wiki.content', array('cols'=>100,'rows' =>20, 'class'=>'wikitext')); 13 15 echo $html->div('optional',$form->label('Wiki.status', 'Status:').$form->checkbox('Wiki.status', array('value'=>1))); 14 16 -
trunk/app/views/wikis/admin_listing.ctp
r597 r764 1 <script type="text/javascript">2 window.onload = timedMsg;3 </script>4 1 <?php 5 //die(debug($session->read('Auth.User.email')));6 7 $session->flash();8 2 9 echo $html->addCrumb('Control Tools', '/admin/entries/start');3 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 10 4 echo $html->getCrumbs(' / '); 11 5 12 echo $html->div('title_section', __('Wiki pages', true));6 echo $html->div('title_section', __('WikiPages', true)); 13 7 14 echo $html->para(null, $html->link($html->image('actions/new.png', array('alt'=>'Add wiki', 'title'=>'Add wiki')), '/admin/wikis/add', null, false, false)); 15 8 echo $html->para(null, $html->link($html->image('actions/new.png', array('alt'=>__('Add new', true), 'title'=>__('Add new', true))), '/admin/wikis/add', null, false, false)); 16 9 ?> 17 10 <table class="tbadmin"> 18 11 <?php 19 20 $th = array ('Edit', 'Title', 'Status', 'Delete'); 12 $th = array(__('Edit', true), __('Title', true), __('Status', true), __('Delete', true)); 21 13 echo $html->tableHeaders($th); 22 14 foreach ($data as $val): 23 $tr = array (24 $gags->sendEdit($val['Entry']['id'], 'Entry'),25 $val['Entry']['title'],26 $html->link($gags->setStatus($val['Entry']['status']), '/admin/entries/change/'.$val['Entry']['id'].'/'.$val['Entry']['status']),27 $gags->confirmDel($val['Entry']['id'], 'Entry')28 );15 $tr = array( 16 $gags->sendEdit($val['Wiki']['id'], 'Wiki'), 17 $val['Wiki']['title'], 18 $html->link($gags->setStatus($val['Wiki']['status']),'/admin/wikis/change/'.$val['Wiki']['id'].'/'.$val['Wiki']['status']), 19 $gags->confirmDel($val['Wiki']['id'], 'Wiki') 20 ); 29 21 30 22 echo $html->tableCells($tr, array("class"=>"altRow", "onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='altRow'"), -
trunk/app/webroot/js/wikitoolbar.js
r598 r764 1 function addWikiFormattingToolbar(textarea) {2 if ((typeof(document["selection"]) == "undefined")3 && (typeof(textarea["setSelectionRange"]) == "undefined")) {4 return;5 }6 7 var toolbar = document.createElement("div");8 toolbar.className = "wikitoolbar";9 10 function addButton(id, title, fn) {11 var a = document.createElement("a");12 a.href = "#";13 a.id = id;14 a.title = title;15 a.onclick = function() { try { fn() } catch (e) { } return false };16 a.tabIndex = 400;17 toolbar.appendChild(a);18 }19 20 function encloseSelection(prefix, suffix) {21 textarea.focus();22 var start, end, sel, scrollPos, subst;23 if (typeof(document["selection"]) != "undefined") {24 sel = document.selection.createRange().text;25 } else if (typeof(textarea["setSelectionRange"]) != "undefined") {26 start = textarea.selectionStart;27 end = textarea.selectionEnd;28 scrollPos = textarea.scrollTop;29 sel = textarea.value.substring(start, end);30 }31 if (sel.match(/ $/)) { // exclude ending space char, if any32 sel = sel.substring(0, sel.length - 1);33 suffix = suffix + " ";34 }35 subst = prefix + sel + suffix;36 if (typeof(document["selection"]) != "undefined") {37 var range = document.selection.createRange().text = subst;38 textarea.caretPos -= suffix.length;39 } else if (typeof(textarea["setSelectionRange"]) != "undefined") {40 textarea.value = textarea.value.substring(0, start) + subst +41 textarea.value.substring(end);42 if (sel) {43 textarea.setSelectionRange(start + subst.length, start + subst.length);44 } else {45 textarea.setSelectionRange(start + prefix.length, start + prefix.length);46 }47 textarea.scrollTop = scrollPos;48 }49 }50 51 addButton("strong", "Bold text: '''Example'''", function() {52 encloseSelection("'''", "'''");53 });54 addButton("em", "Italic text: ''Example''", function() {55 encloseSelection("''", "''");56 });57 addButton("heading", "Heading: == Example ==", function() {58 encloseSelection("\n== ", " ==\n", "Heading");59 });60 addButton("link", "Link: [http://www.example.com/ Example]", function() {61 encloseSelection("[", "]");62 });63 addButton("code", "Code block: {{{ example }}}", function() {64 encloseSelection("\n{{{\n", "\n}}}\n");65 });66 addButton("hr", "Horizontal rule: ----", function() {67 encloseSelection("\n----\n", "");68 });69 addButton("np", "New paragraph", function() {70 encloseSelection("\n\n", "");71 });72 addButton("br", "Line break: [[BR]]", function() {73 encloseSelection("[[BR]]\n", "");74 });75 76 textarea.parentNode.insertBefore(toolbar, textarea);77 }78 79 // Add the toolbar to all <textarea> elements on the page with the class80 // 'wikitext'.81 var re = /\bwikitext\b/;82 var textareas = document.getElementsByTagName("textarea");83 for (var i = 0; i < textareas.length; i++) {84 var textarea = textareas[i];85 if (textarea.className && re.test(textarea.className)) {86 addWikiFormattingToolbar(textarea);87 }88 }
