Skip to content

Instantly share code, notes, and snippets.

@davidmars
Last active August 29, 2015 14:02
Show Gist options
  • Save davidmars/ff64e8e5f9db653ccf46 to your computer and use it in GitHub Desktop.
Save davidmars/ff64e8e5f9db653ccf46 to your computer and use it in GitHub Desktop.
Affiche un champ texte éditable pour l'admin dans lequel il pourra saisir du texte enrichi au moyen de medium-editor.
<?php
/* @var $this View */
/* @var $vv VV_special_page */
$vv = $_vars;
$richTextAttributes="";
if(TheHuman::isAdmin()){
//custom config for the rich text editor, hide and display buttons.
$richText=new RichText();
$richText->h1=true;
$richText->h2=true;
$richText->underline=false;
$richTextAttributes=$richText->getMediumEditorAttributes();
}
?>
<div class="text-style-sample" <?=$richTextAttributes?>>
<?=$vv->attrAdminFieldString(
"extraVars[sampleField_translated]",
FORMAT_STRING_RICH_TEXT,
"this is a test","div")
?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment