-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding configuration option and example.
- Loading branch information
Showing
4 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,6 @@ | |
} | ||
}, | ||
"extra": { | ||
"examples": ["ckeditor.php"] | ||
"examples": ["ckeditor.php", "ckeditor2.php"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
require('../../../framework/qcubed.inc.php'); | ||
|
||
use QCubed\Plugin\QCKEditor; | ||
|
||
/** | ||
* Class SampleForm2 | ||
* | ||
* This example demonstrates how to call an initialization function to customize the ck editor | ||
*/ | ||
class SampleForm2 extends QForm { | ||
protected $txtEditor; | ||
protected $btnSubmit; | ||
protected $pnlResult; | ||
|
||
protected function Form_Create() { | ||
$this->txtEditor = new QCKEditor($this); | ||
$this->txtEditor->Text = '<b>Something</b> to start with.'; | ||
$this->txtEditor->Configuration = 'ckConfig'; | ||
|
||
$this->btnSubmit = new QButton($this); | ||
$this->btnSubmit->Text = "Submit"; | ||
$this->btnSubmit->AddAction(new QClickEvent(), new QAjaxAction('submit_click')); | ||
|
||
$this->pnlResult = new QPanel($this); | ||
$this->pnlResult->HtmlEntities = true; | ||
} | ||
|
||
protected function submit_click($strFormId, $strControlId, $param) { | ||
$this->pnlResult->Text = $this->txtEditor->Text; | ||
} | ||
} | ||
|
||
SampleForm2::Run('SampleForm2'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php require(__DOCROOT__ . __EXAMPLES__ . '/includes/header.inc.php'); ?> | ||
<script> | ||
ckConfig = { | ||
language: 'fr', | ||
uiColor: '#9AB8F3' | ||
}; | ||
</script> | ||
|
||
|
||
<?php $this->RenderBegin(); ?> | ||
|
||
<div class="instructions"> | ||
<h1 class="instruction_title">QCKEditor: Implementation of the CKEditor HTML editor.</h1> | ||
<p> | ||
<b>QCKEditor</b> implements the <a href="http://ckeditor.com">CKEditor HTML editor</a>. It allows you | ||
to create a text editing block with full HTML editing capabilities. The text returned from it is HTML. | ||
</p> | ||
<?php $this->txtEditor->Render(); ?> | ||
<?php $this->btnSubmit->Render(); ?> | ||
<h3>The HTML you typed:</h3> | ||
<?php $this->pnlResult->Render(); ?> | ||
</div> | ||
|
||
<?php $this->RenderEnd(); ?> | ||
<?php require(__DOCROOT__ . __EXAMPLES__ . '/includes/footer.inc.php'); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters