本文整理汇总了PHP中Editor类的典型用法代码示例。如果您正苦于以下问题:PHP Editor类的具体用法?PHP Editor怎么用?PHP Editor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Editor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: switch_to_editor
function switch_to_editor()
{
self::$session->frame();
$e = new Editor($this->session);
$e->wait_until_loaded();
return $e;
}
开发者ID:PurdyForks,项目名称:saunter.php,代码行数:7,代码来源:TextArea.php
示例2: number_of_paragraphs
/**
* @test
* @group deep
* @group ck
* @group frame
*/
public function number_of_paragraphs()
{
$e = new Editor($this->session);
$e->open()->wait_until_loaded();
$t = $e->switch_to_textarea();
$this->assertEquals($t->how_many_paragraphs(), 6);
}
开发者ID:PurdyForks,项目名称:saunter.php,代码行数:13,代码来源:FrameTest.php
示例3: save_plus
public function save_plus($data)
{
// event save
$this->save($data);
// editor save
App::import('Model', 'Editor');
$Editor = new Editor();
$user = $this->_getCurrentUser();
$relation['Editor']['account_id'] = $user['id'];
$relation['Editor']['event_id'] = $this->getLastInsertID();
return $Editor->save($relation);
}
开发者ID:rpdw6slt,项目名称:PosTom,代码行数:12,代码来源:Event.php
示例4: getEditor
/**
* @return AbstractEditor
*/
public function getEditor()
{
if ($this->isGuest) {
return Editor::model()->findByPk(EDitor::DEFAULT_EDITOR_ID);
}
return $this->getUser()->company->editor;
}
开发者ID:ZyManch,项目名称:zbank,代码行数:10,代码来源:WebUser.php
示例5: __construct
/**
* Constructor ContactForm
* @param Page $page_object
* @param string $send_method
* @param string $table_style
*/
function __construct($page_object, $send_method, $table_style = '')
{
parent::__construct();
if (!isset($page_object) || !isset($send_method)) {
throw new NewException("2 arguments for " . get_class($this) . "::__construct() are mandatory", 0, getDebugBacktrace(1));
}
if (gettype($page_object) != "object" || !is_subclass_of($page_object, "Page")) {
throw new NewException("Argument page_object for " . get_class($this) . "::__construct() error", 0, getDebugBacktrace(1));
}
$this->page_object = $page_object;
$this->mail_to = SMTP_MAIL;
$this->mail_to_name = SMTP_NAME;
$table_main = new Table();
$table_main->setClass($table_style);
$form = new Form($this->page_object);
$name = new TextBox($form, "contact_name");
$name_validation = new LiveValidation();
$name->setLiveValidation($name_validation->addValidatePresence()->setFieldName(__(CONTACTFORM_NAME)));
$table_main->addRowColumns(__(CONTACTFORM_NAME) . ": ", $name->setFocus())->setColumnWidth(2, "100%");
$email = new TextBox($form, "contact_email");
$email_validation = new LiveValidation();
$email->setLiveValidation($email_validation->addValidateEmail()->addValidatePresence()->setFieldName(__(CONTACTFORM_EMAIL)));
$table_main->addRowColumns(__(CONTACTFORM_EMAIL) . ": ", $email);
$subject = new TextBox($form, "contact_subject");
$subject_validation = new LiveValidation();
$subject->setLiveValidation($subject_validation->addValidatePresence()->setFieldName(__(CONTACTFORM_SUBJECT)));
$table_main->addRowColumns(__(CONTACTFORM_SUBJECT) . ": ", $subject);
$table_main->addRow();
$editor = new Editor($form, "contact_message");
$editor_validation = new LiveValidation();
$editor->setLiveValidation($editor_validation->addValidatePresence()->setFieldName(__(CONTACTFORM_MESSAGE)));
$editor->setToolbar(Editor::TOOLBAR_SIMPLE);
$table_main->addRow(new Object(__(CONTACTFORM_MESSAGE) . ": ", "<br/>", $editor))->setColspan(3)->setAlign(RowTable::ALIGN_LEFT);
$table_main->addRow();
$this->captcha = new Captcha($form, "contact_captcha");
$table_main->addRow($this->captcha)->setColspan(3);
$table_main->addRow();
$this->send_button = new Button($form, "contact_send", "", __(CONTACTFORM_SEND));
$this->send_button->assignEnterKey()->onClick($send_method)->setAjaxEvent();
$table_main->addRow($this->send_button)->setColspan(3);
$table_main->addRow();
$form->setContent($table_main);
$this->render = $form;
}
开发者ID:kxopa,项目名称:WebSite-PHP,代码行数:50,代码来源:ContactForm.class.php
示例6: GenEditorData
public function GenEditorData($a_attr)
{
$data = array();
$data['ownerid'] = $a_attr['ownerid'];
$data['type'] = "input_gallery";
$data['name'] = $a_attr['name'];
$data['title'] = Locales::getStringOrJSONLocale($a_attr['title']);
$locdata = Locales::ReadData($a_attr['id']);
$data['images'] = $locdata['images'];
Editor::AddData(DATA_MODULE_DATA, $data);
}
开发者ID:transformersprimeabcxyz,项目名称:cms-intel-fake,代码行数:11,代码来源:input_gallery.plugin.php
示例7: store
public function store(HelpRequest $helpRequest, User $user)
{
$help = new Help();
$help->fill($helpRequest->all());
$help->content = $helpRequest->input(\Editor::input());
$help->save();
$log = new Log();
$log->user_id = $user->id;
$log->log = "新建帮助" . $help->id;
$log->save();
return redirect()->action('AdminController@getHelp');
}
开发者ID:xuhongxu96,项目名称:tagexing2,代码行数:12,代码来源:HelpController.php
示例8: On_Editor_SaveModuleFragmentObject
function On_Editor_SaveModuleFragmentObject($a_data)
{
$object = $a_data->object;
// Save
if ($object['type'] == "iterator" && $object['childs']) {
foreach ($object['childs'] as $childs) {
Database::Query("INSERT INTO `" . DB_TBL_DATA . "` (`type`, `name`, `owner`, `moduleid`) VALUES ('itr', '" . $object['name'] . "', '" . $a_data->owner . "', '" . $a_data->moduleid . "')");
$id = Database::GetLastIncrId();
Editor::SaveModuleFragment($childs, -$id);
}
}
}
开发者ID:transformersprimeabcxyz,项目名称:cms-intel-fake,代码行数:12,代码来源:cms_iterator.plugin.php
示例9: GenEditorData
public function GenEditorData($a_attr)
{
$data = array();
$data['ownerid'] = $a_attr['ownerid'];
$data['type'] = "input_img";
$data['name'] = $a_attr['name'];
$data['width'] = $a_attr['width'];
$data['height'] = $a_attr['height'];
$unn = Locales::ReadData($a_attr['id']);
$data['hash'] = $unn['hash'];
$data['title'] = Locales::getStringOrJSONLocale($a_attr['title']);
Editor::AddData(DATA_MODULE_DATA, $data);
}
开发者ID:transformersprimeabcxyz,项目名称:cms-intel-fake,代码行数:13,代码来源:input_img.plugin.php
示例10: GenEditorData
public function GenEditorData($a_attr)
{
$data = array();
$data['ownerid'] = $a_attr['ownerid'];
$data['type'] = "input_string";
$data['name'] = $a_attr['name'];
$data['width'] = $a_attr['width'];
$data['tooltip'] = Locales::getStringOrJSONLocale($a_attr['tooltip']);
$data['title'] = Locales::getStringOrJSONLocale($a_attr['title']);
$data['datepicker'] = isset($a_attr['datepicker']) ? true : false;
$locdata = Locales::ReadData($a_attr['id']);
$data['locales'] = $locdata['text'];
Editor::AddData(DATA_MODULE_DATA, $data);
}
开发者ID:transformersprimeabcxyz,项目名称:cms-intel-fake,代码行数:14,代码来源:input_string.plugin.php
示例11: hookBootstrapLoaded
/**
* Listener for 'bootstrap_loaded' hook.
* Adds in required JS files for the editor to display
*
* @return array
*/
public function hookBootstrapLoaded()
{
if ($this->loadEditor === true && Registry::has('theme')) {
foreach (new DirectoryIterator($this->_zula->getDir('js') . '/tinymce/plugins') as $file) {
if (substr($file, 0, 1) != '.' && $file->isDir()) {
$tinyMcePlugins[] = $file->getFileName();
}
}
$tinyMcePlugins = implode(',', $tinyMcePlugins);
$this->_theme->addHead('js', array(), 'var tcmEditor = {defaultFormat: "' . Editor::defaultFormat() . '", tinymcePlugins: "' . $tinyMcePlugins . '"};');
$this->_theme->addJsFile('tinymce/jquery.tinymce.js');
$this->_theme->addJsFile('js/init.js', true, 'editor');
}
return true;
}
开发者ID:jinshana,项目名称:tangocms,代码行数:21,代码来源:listeners.php
示例12: initCK
private static function initCK()
{
include CORE_ROOT . 'class/Editor/Ckeditor.php';
self::$oCKeditor = new CKEditor();
self::$oCKeditor->returnOutput = true;
// Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
// self::$oCKeditor->basePath = '/ckeditor/'
// If not set, CKEditor will try to detect the correct path.
self::$oCKeditor->basePath = BASE_PATH . 'js/ckeditor/';
// CKFinder::SetupCKEditor(self::$oCKeditor, BASE_PATH . 'js/ckfinder/');
self::$oCKeditor->config['filebrowserBrowseUrl'] = BASE_PATH . 'admin/api/finder';
// Set global configuration (will be used by all instances of CKEditor).
// self::$oCKeditor->config['width'] = 600;
// Change default textarea attributes
// self::$oCKeditor->textareaAttributes = array("cols" => "*", "rows" => 10);
}
开发者ID:kizz66,项目名称:meat,代码行数:16,代码来源:Editor.php
示例13: GenEditorData
public function GenEditorData($a_attr)
{
$data = array();
$data['ownerid'] = $a_attr['ownerid'];
$data['type'] = "input_link";
$data['name'] = $a_attr['name'];
$data['tooltip_url'] = Locales::getStringOrJSONLocale($a_attr['tooltip_url']);
$data['tooltip_title'] = Locales::getStringOrJSONLocale($a_attr['tooltip_title']);
$data['title'] = Locales::getStringOrJSONLocale($a_attr['title']);
$locdata = Locales::ReadData($a_attr['id']);
$data['link_url'] = $locdata['link_url'];
$data['link_title'] = $locdata['link_title'];
/*foreach (Locales::$m_locales as $loc) {
$link_data = Locales::ReadStringData($a_attr['id'], $loc);
$data['link_url'] = $link_data['link_url'];
$data['link_title'][$loc] = $link_data['link_title'];
}*/
Editor::AddData(DATA_MODULE_DATA, $data);
}
开发者ID:transformersprimeabcxyz,项目名称:cms-intel-fake,代码行数:19,代码来源:input_link.plugin.php
示例14: exec
/**
* Execute an upload
* @param Editor $editor Calling Editor instance
* @return int Primary key value
*/
public function exec($editor)
{
$id = null;
$upload = $_FILES['upload'];
// Validation - PHP standard validation
if ($upload['error'] !== UPLOAD_ERR_OK) {
if ($upload['error'] === UPLOAD_ERR_INI_SIZE) {
$this->_error = "File exceeds maximum file upload size";
} else {
$this->_error = "There was an error uploading the file (" . $upload['error'] . ")";
}
return false;
}
// Validation - acceptable file extensions
if (is_array($this->_extns)) {
$extn = pathinfo($upload['name'], PATHINFO_EXTENSION);
if (in_array(strtolower($extn), array_map('strtolower', $this->_extns)) === false) {
$this->_error = $this->_extnError;
return false;
}
}
// Validation - custom callback
for ($i = 0, $ien = count($this->_validators); $i < $ien; $i++) {
$res = $this->_validators[$i]($upload);
if (is_string($res)) {
$this->_error = $res;
return false;
}
}
// Commit to the database
if ($this->_dbTable) {
$id = $this->_dbExec($editor->db());
}
// Perform file system actions
return $this->_actionExec($id);
}
开发者ID:sgabison,项目名称:resaExpress,代码行数:41,代码来源:Upload.php
示例15: getRecordAsEditTableCells
function getRecordAsEditTableCells( IdStack $idPath, Editor $editor, Structure $visibleStructure, Record $record, &$startColumn = 0 ) {
$result = '';
$childEditorMap = $editor->getAttributeEditorMap();
foreach ( $visibleStructure->getAttributes() as $visibleAttribute ) {
$childEditor = $childEditorMap->getEditorForAttribute( $visibleAttribute );
if ( $childEditor != null ) {
$attribute = $childEditor->getAttribute();
$type = $attribute->type;
$value = $record->getAttributeValue( $attribute );
$idPath->pushAttribute( $attribute );
if ( $childEditor instanceof RecordTableCellEditor ) {
$result .= getRecordAsEditTableCells( $idPath, $childEditor, $visibleAttribute->type, $value, $startColumn );
} else {
if ( $childEditor->showEditField( $idPath ) ) {
$displayValue = $childEditor->edit( $idPath, $value );
} else {
$displayValue = "";
}
$result .= '<td class="' . getHTMLClassForType( $type, $attribute ) . ' column-' . parityClass( $startColumn ) . '">' . $displayValue . '</td>';
$startColumn++;
}
$idPath->popAttribute();
}
else {
$result .= "<td/>";
}
}
return $result;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:34,代码来源:HTMLtable.php
示例16: ticket_row_editor
function ticket_row_editor()
{
global $c, $id, $editor, $can_write_principal, $privilege_names;
$ticketrow = new Editor("Tickets", "access_ticket");
$ticketrow->SetSubmitName('ticketrow');
if ($can_write_principal && $ticketrow->IsSubmit()) {
$username = $editor->Value('username');
$ugly_path = $_POST['target'];
if ($ugly_path == '/' . $username || $ugly_path == '/' . $username . '/') {
$target_collection = $id;
} else {
$username_len = strlen($username) + 2;
$sql = "SELECT collection_id FROM collection WHERE dav_name = :exact_name";
$sql .= " AND substring(dav_name FROM 1 FOR {$username_len}) = '/{$username}/'";
$params = array(':exact_name' => $ugly_path);
if (!preg_match('#/$#', $ugly_path)) {
$sql .= " OR dav_name = :truncated_name OR dav_name = :trailing_slash_name";
$params[':truncated_name'] = preg_replace('#[^/]*$#', '', $ugly_path);
$params[':trailing_slash_name'] = $ugly_path . "/";
}
$sql .= " ORDER BY LENGTH(dav_name) DESC LIMIT 1";
$qry = new AwlQuery($sql, $params);
if ($qry->Exec() && $qry->rows() > 0) {
$row = $qry->Fetch();
$target_collection = $row->collection_id;
} else {
$c->messages[] = translate('Can only add tickets for existing collection paths which you own');
return $ticketrow;
}
}
$_POST['dav_owner_id'] = $id;
$_POST['target_collection_id'] = $target_collection;
$ticket_id = check_by_regex($_POST['ticket_id'], '/[A-Za-z0-9]+/');
$ticketrow->SetWhere('dav_owner_id=' . $id . ' AND ticket_id=' . AwlQuery::quote($ticket_id));
if (isset($_POST['ticket_privileges'])) {
$privilege_bitpos = array_flip($privilege_names);
$priv_names = array_keys($_POST['ticket_privileges']);
$privs_dec = privilege_to_bits($priv_names);
$_POST['privileges'] = sprintf('%024s', decbin($privs_dec));
$ticketrow->Assign('privileges', $privs_dec);
}
$c->messages[] = translate('Creating new ticket granting privileges to this Principal');
$ticketrow->Write();
}
return $ticketrow;
}
开发者ID:derekyu1437,项目名称:davical,代码行数:46,代码来源:principal-edit.php
示例17: ob_start
)->width($this->Config('editor', 'width')
)->height($height
)->html(
);
$data = $v;
ob_start();
include($this->path_view('write.php'));
$v['content'] = ob_get_contents();
ob_end_clean();
} else {
$v['content'] = Widget::Inst()->Parse(
$this->TBN(),
'wr_no',
$v['wr_no'],
'wr_content',
Editor::Inst('', $this->Config('editor', 'name'))->db_out($v['wr_content'])
);
if($v['wr_subject']) {
if($v['wr_category']) $v['content'] = "<div class=\"{$v['wr_category']}\"></div>".$v['content'];
$v['content'] = "<h2>{$v['wr_subject']}</h2>".$v['content'];
}
if(!$key && $mode!='write' && $this->Config('mb','admin') && Widget::Inst()->Config('is_page')) {
$v['content'].= '<input class="order" type="hidden" name="order[]" value="'.$v['wr_no'].'"/>';
$v['href_modify'] = $this->Link('modify', $v['wr_no']);
$v['href_delete'] = $this->Link('delete', $v['wr_no']);
}
}
$this->list[$k] = $v;
}
开发者ID:nclco,项目名称:magicboard3,代码行数:30,代码来源:init.list.php
示例18: getVisibleStructureForEditor
protected function getVisibleStructureForEditor( Editor $editor, $showPropertyColumn, array &$suffixAttributes ) {
$leadingAttributes = array();
$childEditors = $editor->getEditors();
for ( $i = $showPropertyColumn ? 0 : 1; $i < 2; $i++ ) {
$leadingAttributes[] = $childEditors[$i]->getAttribute();
}
return new Structure( array_merge( $leadingAttributes, $suffixAttributes ) );
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:10,代码来源:OmegaWikiEditors.php
示例19: displayArticles
/**
* Displays published articles for a given category (if any)
*
* @param string $category
* @param bool $catSelector Toggles the category selector
* @return string
*/
protected function displayArticles($category = false, $catSelector = true)
{
$this->setOutputType(self::_OT_CONTENT_INDEX);
if (empty($category)) {
$this->setTitle(t('Latest articles'));
$categories = $this->_model()->getAllCategories();
$cid = null;
} else {
/**
* Attempt to get the single article category details, and check permission
*/
try {
$category = $this->_model()->getCategory($category, false);
$this->setTitle($category['title']);
$categories = array($category['id'] => $category);
$cid = $category['id'];
$resource = 'article-cat-' . $category['id'];
if (!$this->_acl->resourceExists($resource) || !$this->_acl->check($resource)) {
throw new Module_NoPermission();
}
} catch (Article_CatNoExist $e) {
throw new Module_ControllerNoExist();
}
}
/**
* Check how many to display per page, and what page we are on
*/
try {
$perPage = abs($this->_config->get('article/per_page'));
} catch (Input_KeyNoExist $e) {
$perPage = 12;
}
if ($this->inSector('SC') && $this->_input->has('get', 'page')) {
$curPage = abs($this->_input->get('page') - 1);
} else {
$curPage = 0;
}
// Get the required articles and parse their first article part body
$maxDisplayAge = $this->_config->get('article/max_display_age');
$articles = array();
foreach ($this->_model()->getAllArticles($perPage, $curPage * $perPage, $cid, false, $maxDisplayAge) as $tmpArticle) {
if (isset($categories[$tmpArticle['cat_id']])) {
$parts = $this->_model()->getArticleParts($tmpArticle['id']);
$firstPart = current($parts);
$editor = new Editor($firstPart['body']);
$editor->setContentUrl($this->_router->makeUrl('article', 'view', $tmpArticle['identifier']));
$tmpArticle['body'] = $editor->parse(true);
$tmpArticle['category_title'] = $categories[$tmpArticle['cat_id']]['title'];
$tmpArticle['category_identifier'] = $categories[$tmpArticle['cat_id']]['identifier'];
$articles[] = $tmpArticle;
}
}
$articleCount = $this->_model()->getCount();
if ($articleCount > 0) {
$pagination = new Pagination($articleCount, $perPage);
}
// Build up the view
$view = $this->loadView('index/latest.html');
$view->assign(array('META_FORMAT' => $this->getMetaFormat($this->_config->get('article/meta_format')), 'CAT_DETAILS' => $cid ? $category : null));
$view->assignHtml(array('ARTICLES' => $articles, 'PAGINATION' => isset($pagination) ? $pagination->build() : null));
if ($cid == false && $catSelector) {
/** Prepend the category selector */
$catSelectorView = $this->loadView('index/category_selector.html');
$catSelectorView->assign(array('CATEGORIES' => $categories));
return $catSelectorView->getOutput() . $view->getOutput(true);
} else {
return $view->getOutput(true);
}
}
开发者ID:jinshana,项目名称:tangocms,代码行数:76,代码来源:index.php
示例20: date
echo TB_Form::label(__('publications.page_text_preview'));
?>
<div class="col-sm-10">
<?php
echo Editor::CK('text_short', $obj->text_short, ['class' => 'form-control', 'rows' => 6], 'preview');
?>
</div>
</div>
<div class="form-group">
<?php
echo TB_Form::label(__('publications.page_text'));
?>
<div class="col-sm-10">
<?php
echo Editor::CK('text', $obj->text, ['class' => 'form-control', 'rows' => 6]);
?>
</div>
</div>
<div class="form-group">
<?php
echo TB_Form::label(__('publications.page_date'));
?>
<div class="col-sm-10">
<?php
echo Form::input('date', $obj->date ? $obj->date : date('Y-m-d'), ['class' => 'form-control']);
?>
</div>
</div>
开发者ID:eok8177,项目名称:shopCMS,代码行数:30,代码来源:v_form.php
注:本文中的Editor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论