当前位置: 首页>>代码示例>>PHP>>正文


PHP DolEditor类代码示例

本文整理汇总了PHP中DolEditor的典型用法代码示例。如果您正苦于以下问题:PHP DolEditor类的具体用法?PHP DolEditor怎么用?PHP DolEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DolEditor类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showInputField

 /**
  * Return HTML string to put an input field into a page
  *
  * @param  string  $key            Key of attribute
  * @param  string  $value          Value to show (for date type it must be in timestamp format)
  * @param  string  $moreparam      To add more parametes on html input tag
  * @param  string  $keyprefix      Prefix string to add into name and id of field (can be used to avoid duplicate names)
  * @param  string  $keysuffix      Suffix string to add into name and id of field (can be used to avoid duplicate names)
  * @param  int     $showsize       Value for size attributed
  * @param  int     $objectid       Current object id
  * @return string
  */
 function showInputField($key, $value, $moreparam = '', $keyprefix = '', $keysuffix = '', $showsize = 0, $objectid = 0)
 {
     global $conf, $langs;
     $label = $this->attribute_label[$key];
     $type = $this->attribute_type[$key];
     $size = $this->attribute_size[$key];
     $elementtype = $this->attribute_elementtype[$key];
     $unique = $this->attribute_unique[$key];
     $required = $this->attribute_required[$key];
     $param = $this->attribute_param[$key];
     $perms = $this->attribute_perms[$key];
     $list = $this->attribute_list[$key];
     if (empty($showsize)) {
         if ($type == 'date') {
             $showsize = 10;
         } elseif ($type == 'datetime') {
             $showsize = 19;
         } elseif (in_array($type, array('int', 'double'))) {
             $showsize = 10;
         } else {
             $showsize = round($size);
             if ($showsize > 48) {
                 $showsize = 48;
             }
         }
     }
     if (in_array($type, array('date', 'datetime'))) {
         $tmp = explode(',', $size);
         $newsize = $tmp[0];
         $showtime = in_array($type, array('datetime')) ? 1 : 0;
         // Do not show current date when field not required (see select_date() method)
         if (!$required && $value == '') {
             $value = '-1';
         }
         require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
         global $form;
         if (!is_object($form)) {
             $form = new Form($this->db);
         }
         // TODO Must also support $moreparam
         $out = $form->select_date($value, $keysuffix . 'options_' . $key . $keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
     } elseif (in_array($type, array('int'))) {
         $tmp = explode(',', $size);
         $newsize = $tmp[0];
         $out = '<input type="text" class="flat" name="' . $keysuffix . 'options_' . $key . $keyprefix . '" size="' . $showsize . '" maxlength="' . $newsize . '" value="' . $value . '"' . ($moreparam ? $moreparam : '') . '>';
     } elseif ($type == 'varchar') {
         $out = '<input type="text" class="flat" name="' . $keysuffix . 'options_' . $key . $keyprefix . '" size="' . $showsize . '" maxlength="' . $size . '" value="' . $value . '"' . ($moreparam ? $moreparam : '') . '>';
     } elseif ($type == 'text') {
         require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
         $doleditor = new DolEditor($keysuffix . 'options_' . $key . $keyprefix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, 5, 100);
         $out = $doleditor->Create(1);
     } elseif ($type == 'boolean') {
         $checked = '';
         if (!empty($value)) {
             $checked = ' checked value="1" ';
         } else {
             $checked = ' value="1" ';
         }
         $out = '<input type="checkbox" class="flat" name="' . $keysuffix . 'options_' . $key . $keyprefix . '" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . '>';
     } elseif ($type == 'mail') {
         $out = '<input type="text" class="flat" name="' . $keysuffix . 'options_' . $key . $keyprefix . '" size="32" value="' . $value . '" ' . ($moreparam ? $moreparam : '') . '>';
     } elseif ($type == 'phone') {
         $out = '<input type="text" class="flat" name="' . $keysuffix . 'options_' . $key . $keyprefix . '"  size="20" value="' . $value . '" ' . ($moreparam ? $moreparam : '') . '>';
     } elseif ($type == 'price') {
         $out = '<input type="text" class="flat" name="' . $keysuffix . 'options_' . $key . $keyprefix . '"  size="6" value="' . price($value) . '" ' . ($moreparam ? $moreparam : '') . '> ' . $langs->getCurrencySymbol($conf->currency);
     } elseif ($type == 'double') {
         if (!empty($value)) {
             $value = price($value);
         }
         $out = '<input type="text" class="flat" name="' . $keysuffix . 'options_' . $key . $keyprefix . '"  size="6" value="' . $value . '" ' . ($moreparam ? $moreparam : '') . '> ';
     } elseif ($type == 'select') {
         $out = '';
         if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_EXTRAFIELDS_USE_SELECT2)) {
             include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
             $out .= ajax_combobox($keysuffix . 'options_' . $key . $keyprefix, array(), 0);
         }
         $out .= '<select class="flat" name="' . $keysuffix . 'options_' . $key . $keyprefix . '" id="options_' . $key . $keyprefix . '" ' . ($moreparam ? $moreparam : '') . '>';
         $out .= '<option value="0">&nbsp;</option>';
         foreach ($param['options'] as $key => $val) {
             list($val, $parent) = explode('|', $val);
             $out .= '<option value="' . $key . '"';
             $out .= $value == $key ? ' selected' : '';
             $out .= !empty($parent) ? ' parent="' . $parent . '"' : '';
             $out .= '>' . $val . '</option>';
         }
         $out .= '</select>';
     } elseif ($type == 'sellist') {
         $out = '';
//.........这里部分代码省略.........
开发者ID:Samara94,项目名称:dolibarr,代码行数:101,代码来源:extrafields.class.php

示例2: print_fiche_titre

  */
 if (($action == 'edit' || $action == 're-edit') && 1) {
     print_fiche_titre($langs->trans("WarehouseEdit"), $mesg);
     print '<form action="fiche.php" method="POST">';
     print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
     print '<input type="hidden" name="action" value="update">';
     print '<input type="hidden" name="id" value="' . $object->id . '">';
     print '<table class="border" width="100%">';
     // Ref
     print '<tr><td width="20%" class="fieldrequired">' . $langs->trans("Ref") . '</td><td colspan="3"><input name="libelle" size="20" value="' . $object->libelle . '"></td></tr>';
     print '<tr><td width="20%">' . $langs->trans("LocationSummary") . '</td><td colspan="3"><input name="lieu" size="40" value="' . $object->lieu . '"></td></tr>';
     // Description
     print '<tr><td valign="top">' . $langs->trans("Description") . '</td><td colspan="3">';
     // Editeur wysiwyg
     require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
     $doleditor = new DolEditor('desc', $object->description, '', 180, 'dolibarr_notes', 'In', false, true, $conf->fckeditor->enabled, 5, 70);
     $doleditor->Create();
     print '</td></tr>';
     print '<tr><td>' . $langs->trans('Address') . '</td><td colspan="3"><textarea name="address" cols="60" rows="3" wrap="soft">';
     print $object->address;
     print '</textarea></td></tr>';
     // Zip / Town
     print '<tr><td>' . $langs->trans('Zip') . '</td><td>';
     print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
     print '</td><td>' . $langs->trans('Town') . '</td><td>';
     print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
     print '</td></tr>';
     // Country
     print '<tr><td width="25%">' . $langs->trans('Country') . '</td><td colspan="3">';
     print $form->select_country($object->country_id ? $object->country_id : $mysoc->country_code, 'country_id');
     if ($user->admin) {
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:fiche.php

示例3: fieldList

/**
 *	Show fields in insert/edit mode
 *
 * 	@param		array	$fieldlist		Array of fields
 * 	@param		Object	$obj			If we show a particular record, obj is filled with record fields
 *  @param		string	$tabname		Name of SQL table
 *  @param		string	$context		'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
 *	@return		void
 */
function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
{
    global $conf, $langs, $db;
    global $form;
    global $region_id;
    global $elementList, $sourceList, $localtax_typeList;
    global $bc;
    $formadmin = new FormAdmin($db);
    $formcompany = new FormCompany($db);
    foreach ($fieldlist as $field => $value) {
        if ($fieldlist[$field] == 'country') {
            if (in_array('region_id', $fieldlist)) {
                print '<td>';
                //print join(',',$fieldlist);
                print '</td>';
                continue;
            }
            // For state page, we do not show the country input (we link to region, not country)
            print '<td>';
            $fieldname = 'country';
            print $form->select_country(!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : ''), $fieldname, '', 28, 'maxwidth300');
            print '</td>';
        } elseif ($fieldlist[$field] == 'country_id') {
            if (!in_array('country', $fieldlist)) {
                $country_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
                print '<td>';
                print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $country_id . '">';
                print '</td>';
            }
        } elseif ($fieldlist[$field] == 'region') {
            print '<td>';
            $formcompany->select_region($region_id, 'region');
            print '</td>';
        } elseif ($fieldlist[$field] == 'region_id') {
            $region_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
            print '<td>';
            print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $region_id . '">';
            print '</td>';
        } elseif ($fieldlist[$field] == 'lang') {
            print '<td>';
            print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang');
            print '</td>';
        } elseif ($fieldlist[$field] == 'type_template') {
            print '<td>';
            print $form->selectarray('type_template', $elementList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
            print '</td>';
        } elseif ($fieldlist[$field] == 'element') {
            print '<td>';
            print $form->selectarray('element', $elementList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
            print '</td>';
        } elseif ($fieldlist[$field] == 'source') {
            print '<td>';
            print $form->selectarray('source', $sourceList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
            print '</td>';
        } elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX . "c_actioncomm") {
            print '<td>';
            print 'user<input type="hidden" name="type" value="user">';
            print '</td>';
        } elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible') {
            print '<td>';
            print $form->selectyesno($fieldlist[$field], !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', 1);
            print '</td>';
        } elseif (in_array($fieldlist[$field], array('nbjour', 'decalage', 'taux', 'localtax1', 'localtax2'))) {
            $align = "left";
            if (in_array($fieldlist[$field], array('taux', 'localtax1', 'localtax2'))) {
                $align = "right";
            }
            // Fields aligned on right
            print '<td align="' . $align . '">';
            print '<input type="text" class="flat" value="' . (isset($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="3" name="' . $fieldlist[$field] . '">';
            print '</td>';
        } elseif (in_array($fieldlist[$field], array('libelle_facture'))) {
            print '<td><textarea cols="30" rows="' . ROWS_2 . '" class="flat" name="' . $fieldlist[$field] . '">' . (!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '</textarea></td>';
        } elseif (in_array($fieldlist[$field], array('content'))) {
            if ($tabname == MAIN_DB_PREFIX . 'c_email_templates') {
                print '<td colspan="4"></td></tr><tr class="pair nohover"><td colspan="5">';
                // To create an artificial CR for the current tr we are on
            } else {
                print '<td>';
            }
            if ($context != 'hide') {
                //print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'</textarea>';
                $doleditor = new DolEditor($fieldlist[$field], !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', '', 140, 'dolibarr_mailings', 'In', 0, false, true, ROWS_5, '90%');
                print $doleditor->Create(1);
            } else {
                print '&nbsp;';
            }
            print '</td>';
        } elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
            print '<td><input type="text" class="flat" value="' . price(!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="8" name="' . $fieldlist[$field] . '"></td>';
        } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist}[$field])) {
//.........这里部分代码省略.........
开发者ID:Samara94,项目名称:dolibarr,代码行数:101,代码来源:dict.php

示例4: is_object

 print $form->selectarray('model', $liste, $conf->global->FACTURE_ADDON_PDF);
 print "</td></tr>";
 // Public note
 print '<tr>';
 print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
 print '<td valign="top" colspan="2">';
 $note_public = $object->getDefaultCreateValueFor('note_public', is_object($objectsrc) ? $objectsrc->note_public : null);
 $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
 print $doleditor->Create(1);
 // Private note
 if (empty($user->societe_id)) {
     print '<tr>';
     print '<td class="border" valign="top">' . $langs->trans('NotePrivate') . '</td>';
     print '<td valign="top" colspan="2">';
     $note_private = $object->getDefaultCreateValueFor('note_private', !empty($origin) && !empty($originid) && is_object($objectsrc) ? $objectsrc->note_private : null);
     $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
     print $doleditor->Create(1);
     // print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea>
     print '</td></tr>';
 }
 // Lines from source
 if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
     // TODO for compatibility
     if ($origin == 'contrat') {
         // Calcul contrat->price (HT), contrat->total (TTC), contrat->tva
         $objectsrc->remise_absolue = $remise_absolue;
         $objectsrc->remise_percent = $remise_percent;
         $objectsrc->update_price(1, -1, 1);
     }
     print "\n<!-- " . $classname . " info -->";
     print "\n";
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:facture.php

示例5: strtolower

        } else {
            if ($value == 1) {
                print '<a href="' . $_SERVER['PHP_SELF'] . '?action=disable_' . strtolower($const) . '">' . img_picto($langs->trans("Enabled"), 'switch_on') . '</a>';
            }
        }
        print "</td>";
        print '</tr>';
    }
    print '</table>' . "\n";
    print '<br>' . "\n";
    print_fiche_titre($langs->trans("TestSubmitForm"), '(mode=' . $mode . ')', '');
    print '<form name="formtest" method="POST" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
    print '<input type="hidden" name="mode" value="' . dol_escape_htmltag($mode) . '">';
    $uselocalbrowser = true;
    $readonly = $mode == 'dolibarr_readonly' ? 1 : 0;
    $editor = new DolEditor('formtestfield', isset($conf->global->FCKEDITOR_TEST) ? $conf->global->FCKEDITOR_TEST : 'Test', '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, 8, $readonly);
    $editor->Create();
    print '<center><br><input class="button" type="submit" name="save" value="' . $langs->trans("Save") . '"></center>' . "\n";
    print '<div id="divforlog"></div>';
    print '</form>' . "\n";
    // Add env of ckeditor
    // This is to show how CKEditor detect browser to understand why editor is disabled or not
    if (1 == 2) {
        print '<br><script language="javascript">
	    function jsdump(obj, id) {
		    var out = \'\';
		    for (var i in obj) {
		        out += i + ": " + obj[i] + "<br>\\n";
		    }

		    jQuery("#"+id).html(out);
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:31,代码来源:fckeditor.php

示例6: get_form


//.........这里部分代码省略.........
         if (!empty($this->withbody)) {
             $defaultmessage = "";
             // TODO    A partir du type, proposer liste de messages dans table llx_c_email_template
             if ($this->param["models"] == 'facture_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendInvoice");
             } elseif ($this->param["models"] == 'facture_relance') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendInvoiceReminder");
             } elseif ($this->param["models"] == 'propal_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendProposal");
             } elseif ($this->param["models"] == 'order_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendOrder");
             } elseif ($this->param["models"] == 'order_supplier_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendSupplierOrder");
             } elseif ($this->param["models"] == 'invoice_supplier_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendSupplierInvoice");
             } elseif ($this->param["models"] == 'shipping_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendShipping");
             } elseif ($this->param["models"] == 'fichinter_send') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentSendFichInter");
             } elseif ($this->param["models"] == 'thirdparty') {
                 $defaultmessage = $langs->transnoentities("PredefinedMailContentThirdparty");
             } elseif (!is_numeric($this->withbody)) {
                 $defaultmessage = $this->withbody;
             }
             // Complete substitution array
             if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) {
                 require_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
                 $langs->load('paypal');
                 if ($this->param["models"] == 'order_send') {
                     $url = getPaypalPaymentUrl(0, 'order', $this->substit['__ORDERREF__']);
                     $this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url));
                 }
                 if ($this->param["models"] == 'facture_send') {
                     $url = getPaypalPaymentUrl(0, 'invoice', $this->substit['__FACREF__']);
                     $this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url));
                 }
             }
             $defaultmessage = str_replace('\\n', "\n", $defaultmessage);
             // Deal with format differences between message and signature (text / HTML)
             if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) {
                 $this->substit['__SIGNATURE__'] = dol_nl2br($this->substit['__SIGNATURE__']);
             } else {
                 if (!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__SIGNATURE__'])) {
                     $defaultmessage = dol_nl2br($defaultmessage);
                 }
             }
             if (isset($_POST["message"])) {
                 $defaultmessage = $_POST["message"];
             } else {
                 $defaultmessage = make_substitutions($defaultmessage, $this->substit);
                 // Clean first \n and br (to avoid empty line when CONTACTCIVNAME is empty)
                 $defaultmessage = preg_replace("/^(<br>)+/", "", $defaultmessage);
                 $defaultmessage = preg_replace("/^\n+/", "", $defaultmessage);
             }
             $out .= '<tr>';
             $out .= '<td width="180" valign="top">' . $langs->trans("MailText") . '</td>';
             $out .= '<td>';
             if ($this->withbodyreadonly) {
                 $out .= nl2br($defaultmessage);
                 $out .= '<input type="hidden" id="message" name="message" value="' . $defaultmessage . '" />';
             } else {
                 if (!isset($this->ckeditortoolbar)) {
                     $this->ckeditortoolbar = 'dolibarr_notes';
                 }
                 // Editor wysiwyg
                 require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
                 if ($this->withfckeditor == -1) {
                     if (!empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
                         $this->withfckeditor = 1;
                     } else {
                         $this->withfckeditor = 0;
                     }
                 }
                 $doleditor = new DolEditor('message', $defaultmessage, '', 280, $this->ckeditortoolbar, 'In', true, true, $this->withfckeditor, 8, 72);
                 $out .= $doleditor->Create(1);
             }
             $out .= "</td></tr>\n";
         }
         if ($this->withform == 1 || $this->withform == -1) {
             $out .= '<tr><td align="center" colspan="2"><center>';
             $out .= '<input class="button" type="submit" id="sendmail" name="sendmail" value="' . $langs->trans("SendMail") . '"';
             // Add a javascript test to avoid to forget to submit file before sending email
             if ($this->withfile == 2 && $conf->use_javascript_ajax) {
                 $out .= ' onClick="if (document.mailform.addedfile.value != \'\') { alert(\'' . dol_escape_js($langs->trans("FileWasNotUploaded")) . '\'); return false; } else { return true; }"';
             }
             $out .= ' />';
             if ($this->withcancel) {
                 $out .= ' &nbsp; &nbsp; ';
                 $out .= '<input class="button" type="submit" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '" />';
             }
             $out .= '</center></td></tr>' . "\n";
         }
         $out .= '</table>' . "\n";
         if ($this->withform == 1) {
             $out .= '</form>' . "\n";
         }
         $out .= "<!-- Fin form mail -->\n";
         return $out;
     }
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:101,代码来源:html.formmail.class.php

示例7: form_constantes

function form_constantes($tableau)
{
    global $db, $bc, $langs, $conf, $_Avery_Labels;
    $form = new Form($db);
    print '<table class="noborder" width="100%">';
    print '<tr class="liste_titre">';
    print '<td>' . $langs->trans("Description") . '</td>';
    print '<td>' . $langs->trans("Value") . '*</td>';
    print '<td>&nbsp;</td>';
    print '<td align="center" width="80">' . $langs->trans("Action") . '</td>';
    print "</tr>\n";
    $var = true;
    $listofparam = array();
    foreach ($tableau as $const) {
        $sql = "SELECT ";
        $sql .= "rowid";
        $sql .= ", " . $db->decrypt('name') . " as name";
        $sql .= ", " . $db->decrypt('value') . " as value";
        $sql .= ", type";
        $sql .= ", note";
        $sql .= " FROM " . MAIN_DB_PREFIX . "const";
        $sql .= " WHERE " . $db->decrypt('name') . " = '" . $const . "'";
        $sql .= " AND entity in (0, " . $conf->entity . ")";
        $sql .= " ORDER BY name ASC, entity DESC";
        $result = $db->query($sql);
        dol_syslog("List params sql=" . $sql);
        if ($result) {
            $obj = $db->fetch_object($result);
            // Take first result of select
            $var = !$var;
            print "\n" . '<form action="adherent.php" method="POST">';
            print "<tr " . $bc[$var] . ">";
            // Affiche nom constante
            print '<td>';
            print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
            print '<input type="hidden" name="action" value="update">';
            print '<input type="hidden" name="rowid" value="' . $rowid . '">';
            print '<input type="hidden" name="constname" value="' . $const . '">';
            print '<input type="hidden" name="constnote" value="' . nl2br($obj->note) . '">';
            print $langs->trans("Desc" . $const) != "Desc" . $const ? $langs->trans("Desc" . $const) : ($obj->note ? $obj->note : $const);
            if ($const == 'ADHERENT_MAILMAN_URL') {
                print '. ' . $langs->trans("Example") . ': <a href="#" id="exampleclick1">' . img_down() . '</a><br>';
                //print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&subscribees=%EMAIL%&send_welcome_msg_to_this_batch=1';
                print '<div id="example1" class="hidden">';
                print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/add?subscribees_upload=%EMAIL%&adminpw=%MAILMAN_ADMINPW%&subscribe_or_invite=0&send_welcome_msg_to_this_batch=0&notification_to_list_owner=0';
                print '</div>';
            }
            if ($const == 'ADHERENT_MAILMAN_UNSUB_URL') {
                print '. ' . $langs->trans("Example") . ': <a href="#" id="exampleclick2">' . img_down() . '</a><br>';
                print '<div id="example2" class="hidden">';
                print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/remove?unsubscribees_upload=%EMAIL%&adminpw=%MAILMAN_ADMINPW%&send_unsub_ack_to_this_batch=0&send_unsub_notifications_to_list_owner=0';
                print '</div>';
                //print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
            }
            print "</td>\n";
            if ($const == 'ADHERENT_CARD_TYPE' || $const == 'ADHERENT_ETIQUETTE_TYPE') {
                print '<td>';
                // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php)
                require_once DOL_DOCUMENT_ROOT . '/lib/format_cards.lib.php';
                $arrayoflabels = array();
                foreach (array_keys($_Avery_Labels) as $codecards) {
                    $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name'];
                }
                print $form->selectarray('constvalue', $arrayoflabels, $obj->value ? $obj->value : 'CARD', 1, 0, 0);
                print '</td><td>';
                print '<input type="hidden" name="consttype" value="yesno">';
                print '</td>';
            } else {
                print '<td>';
                //print 'aa'.$const;
                if (in_array($const, array('ADHERENT_CARD_TEXT', 'ADHERENT_CARD_TEXT_RIGHT'))) {
                    print '<textarea class="flat" name="constvalue" cols="35" rows="5" wrap="soft">' . "\n";
                    print $obj->value;
                    print "</textarea>\n";
                    print '</td><td>';
                    print '<input type="hidden" name="consttype" value="texte">';
                } else {
                    if (in_array($const, array('ADHERENT_AUTOREGISTER_MAIL', 'ADHERENT_MAIL_VALID', 'ADHERENT_MAIL_COTIS', 'ADHERENT_MAIL_RESIL'))) {
                        require_once DOL_DOCUMENT_ROOT . "/lib/doleditor.class.php";
                        $doleditor = new DolEditor('constvalue_' . $const, $obj->value, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, 5, 60);
                        $doleditor->Create();
                        print '</td><td>';
                        print '<input type="hidden" name="consttype" value="texte">';
                    } else {
                        if ($obj->type == 'yesno') {
                            print $form->selectyesno('constvalue', $obj->value, 1);
                            print '</td><td>';
                            print '<input type="hidden" name="consttype" value="yesno">';
                        } else {
                            print '<input type="text" class="flat" size="48" name="constvalue" value="' . $obj->value . '">';
                            print '</td><td>';
                            print '<input type="hidden" name="consttype" value="chaine">';
                        }
                    }
                }
                print '</td>';
            }
            print '<td align="center">';
            print '<input type="submit" class="button" value="' . $langs->trans("Update") . '" name="Button"> &nbsp;';
            // print '<a href="adherent.php?name='.$const.'&action=unset">'.img_delete().'</a>';
//.........这里部分代码省略.........
开发者ID:ripasch,项目名称:dolibarr,代码行数:101,代码来源:adherent.php

示例8: array

$arrayofjs = array();
$arrayofcss = array('/opensurvey/css/style.css');
llxHeader('', $langs->trans("OpenSurvey"), '', "", 0, 0, $arrayofjs, $arrayofcss);
print load_fiche_titre($langs->trans("CreatePoll") . ' (1 / 2)');
//debut du formulaire
print '<form name="formulaire" action="" method="POST">' . "\n";
dol_fiche_head();
//Affichage des différents champs textes a remplir
print '<table class="border" width="100%">' . "\n";
print '<tr><td class="fieldrequired">' . $langs->trans("PollTitle") . '</td><td><input type="text" name="titre" size="40" maxlength="80" value="' . $_SESSION["titre"] . '"></td>' . "\n";
if (!$_SESSION["titre"] && (GETPOST('creation_sondage_date') || GETPOST('creation_sondage_autre'))) {
    setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PollTitle")), null, 'errors');
}
print '</tr>' . "\n";
print '<tr><td>' . $langs->trans("Description") . '</td><td>';
$doleditor = new DolEditor('commentaires', $_SESSION["commentaires"], '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, 120);
$doleditor->Create(0, '');
print '</td>' . "\n";
print '</tr>' . "\n";
print '<tr><td class="fieldrequired">' . $langs->trans("ExpireDate") . '</td><td>';
print $form->select_date($champdatefin ? $champdatefin : -1, 'champdatefin', '', '', '', "add", 1, 0, 1);
print '</tr>' . "\n";
print '</table>' . "\n";
dol_fiche_end();
//focus javascript sur le premier champ
print '<script type="text/javascript">' . "\n";
print 'document.formulaire.titre.focus();' . "\n";
print '</script>' . "\n";
print '<br>' . "\n";
// Check or not
if ($_SESSION["mailsonde"]) {
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:create_survey.php

示例9: form_constantes


//.........这里部分代码省略.........
            // Take first result of select
            $var = !$var;
            // For avoid warning in strict mode
            if (empty($obj)) {
                $obj = (object) array('rowid' => '', 'name' => '', 'value' => '', 'type' => '', 'note' => '');
            }
            if (empty($strictw3c)) {
                print "\n" . '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
            }
            print "<tr " . $bc[$var] . ">";
            // Show constant
            print '<td>';
            print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
            print '<input type="hidden" name="action" value="update">';
            print '<input type="hidden" name="rowid' . (empty($strictw3c) ? '' : '[]') . '" value="' . $obj->rowid . '">';
            print '<input type="hidden" name="constname' . (empty($strictw3c) ? '' : '[]') . '" value="' . $const . '">';
            print '<input type="hidden" name="constnote' . (empty($strictw3c) ? '' : '[]') . '" value="' . nl2br(dol_escape_htmltag($obj->note)) . '">';
            print $langs->trans('Desc' . $const);
            if ($const == 'ADHERENT_MAILMAN_URL') {
                print '. ' . $langs->trans("Example") . ': <a href="#" id="exampleclick1">' . img_down() . '</a><br>';
                //print 'http://lists.exampe.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&subscribees=%EMAIL%&send_welcome_msg_to_this_batch=1';
                print '<div id="example1" class="hidden">';
                print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/add?subscribees_upload=%EMAIL%&amp;adminpw=%MAILMAN_ADMINPW%&amp;subscribe_or_invite=0&amp;send_welcome_msg_to_this_batch=0&amp;notification_to_list_owner=0';
                print '</div>';
            }
            if ($const == 'ADHERENT_MAILMAN_UNSUB_URL') {
                print '. ' . $langs->trans("Example") . ': <a href="#" id="exampleclick2">' . img_down() . '</a><br>';
                print '<div id="example2" class="hidden">';
                print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?unsubscribees_upload=%EMAIL%&amp;adminpw=%MAILMAN_ADMINPW%&amp;send_unsub_ack_to_this_batch=0&amp;send_unsub_notifications_to_list_owner=0';
                print '</div>';
                //print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
            }
            if ($const == 'ADHERENT_MAILMAN_LISTS') {
                print '. ' . $langs->trans("Example") . ': <a href="#" id="exampleclick3">' . img_down() . '</a><br>';
                print '<div id="example3" class="hidden">';
                print 'mymailmanlist<br>';
                print 'mymailmanlist1,mymailmanlist2<br>';
                print 'TYPE:Type1:mymailmanlist1,TYPE:Type2:mymailmanlist2<br>';
                if ($conf->categorie->enabled) {
                    print 'CATEG:Categ1:mymailmanlist1,CATEG:Categ2:mymailmanlist2<br>';
                }
                print '</div>';
                //print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
            }
            print "</td>\n";
            // Value
            if ($const == 'ADHERENT_CARD_TYPE' || $const == 'ADHERENT_ETIQUETTE_TYPE') {
                print '<td>';
                // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php)
                require_once DOL_DOCUMENT_ROOT . '/core/lib/format_cards.lib.php';
                $arrayoflabels = array();
                foreach (array_keys($_Avery_Labels) as $codecards) {
                    $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name'];
                }
                print $form->selectarray('constvalue' . (empty($strictw3c) ? '' : '[]'), $arrayoflabels, $obj->value ? $obj->value : 'CARD', 1, 0, 0);
                print '<input type="hidden" name="consttype" value="yesno">';
                print '</td>';
            } else {
                print '<td>';
                if (in_array($const, array('ADHERENT_CARD_TEXT', 'ADHERENT_CARD_TEXT_RIGHT', 'ADHERENT_ETIQUETTE_TEXT'))) {
                    print '<textarea class="flat" name="constvalue' . (empty($strictw3c) ? '' : '[]') . '" cols="50" rows="5" wrap="soft">' . "\n";
                    print $obj->value;
                    print "</textarea>\n";
                    print '<input type="hidden" name="consttype" value="texte">';
                } else {
                    if (in_array($const, array('ADHERENT_AUTOREGISTER_NOTIF_MAIL', 'ADHERENT_AUTOREGISTER_MAIL', 'ADHERENT_MAIL_VALID', 'ADHERENT_MAIL_COTIS', 'ADHERENT_MAIL_RESIL'))) {
                        require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
                        $doleditor = new DolEditor('constvalue_' . $const . (empty($strictw3c) ? '' : '[]'), $obj->value, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, 5, 60);
                        $doleditor->Create();
                        print '<input type="hidden" name="consttype' . (empty($strictw3c) ? '' : '[]') . '" value="texte">';
                    } else {
                        if ($obj->type == 'yesno') {
                            print $form->selectyesno('constvalue' . (empty($strictw3c) ? '' : '[]'), $obj->value, 1);
                            print '<input type="hidden" name="consttype' . (empty($strictw3c) ? '' : '[]') . '" value="yesno">';
                        } else {
                            print '<input type="text" class="flat" size="48" name="constvalue' . (empty($strictw3c) ? '' : '[]') . '" value="' . dol_escape_htmltag($obj->value) . '">';
                            print '<input type="hidden" name="consttype' . (empty($strictw3c) ? '' : '[]') . '" value="chaine">';
                        }
                    }
                }
                print '</td>';
            }
            // Submit
            if (empty($strictw3c)) {
                print '<td align="center">';
                print '<input type="submit" class="button" value="' . $langs->trans("Update") . '" name="Button">';
                print "</td>";
            }
            print "</tr>\n";
            if (empty($strictw3c)) {
                print "</form>\n";
            }
        }
    }
    print '</table>';
    if (!empty($strictw3c) && $strictw3c == 1) {
        print '<div align="center"><input type="submit" class="button" value="' . $langs->trans("Update") . '" name="update"></div>';
        print "</form>\n";
    }
}
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:101,代码来源:admin.lib.php

示例10: get_form


//.........这里部分代码省略.........
                $out .= "</td></tr>\n";
            }
            // Message
            if (!empty($this->withbody)) {
                $defaultmessage = "";
                if (count($arraydefaultmessage) > 0 && $arraydefaultmessage['content']) {
                    $defaultmessage = $arraydefaultmessage['content'];
                } elseif (!is_numeric($this->withbody)) {
                    $defaultmessage = $this->withbody;
                }
                // Complete substitution array
                if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) {
                    require_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
                    $langs->load('paypal');
                    if ($this->param["models"] == 'order_send') {
                        $url = getPaypalPaymentUrl(0, 'order', $this->substit['__ORDERREF__']);
                        $this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url));
                    }
                    if ($this->param["models"] == 'facture_send') {
                        $url = getPaypalPaymentUrl(0, 'invoice', $this->substit['__FACREF__']);
                        $this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url));
                    }
                }
                $defaultmessage = str_replace('\\n', "\n", $defaultmessage);
                // Deal with format differences between message and signature (text / HTML)
                if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) {
                    $this->substit['__SIGNATURE__'] = dol_nl2br($this->substit['__SIGNATURE__']);
                } else {
                    if (!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__SIGNATURE__'])) {
                        $defaultmessage = dol_nl2br($defaultmessage);
                    }
                }
                if (isset($_POST["message"]) && !$_POST['modelselected']) {
                    $defaultmessage = $_POST["message"];
                } else {
                    $defaultmessage = make_substitutions($defaultmessage, $this->substit);
                    // Clean first \n and br (to avoid empty line when CONTACTCIVNAME is empty)
                    $defaultmessage = preg_replace("/^(<br>)+/", "", $defaultmessage);
                    $defaultmessage = preg_replace("/^\n+/", "", $defaultmessage);
                }
                $out .= '<tr>';
                $out .= '<td width="180" valign="top">' . $langs->trans("MailText") . '</td>';
                $out .= '<td>';
                if ($this->withbodyreadonly) {
                    $out .= nl2br($defaultmessage);
                    $out .= '<input type="hidden" id="message" name="message" value="' . $defaultmessage . '" />';
                } else {
                    if (!isset($this->ckeditortoolbar)) {
                        $this->ckeditortoolbar = 'dolibarr_notes';
                    }
                    // Editor wysiwyg
                    require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
                    if ($this->withfckeditor == -1) {
                        if (!empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
                            $this->withfckeditor = 1;
                        } else {
                            $this->withfckeditor = 0;
                        }
                    }
                    $doleditor = new DolEditor('message', $defaultmessage, '', 280, $this->ckeditortoolbar, 'In', true, true, $this->withfckeditor, 8, 72);
                    $out .= $doleditor->Create(1);
                }
                $out .= "</td></tr>\n";
            }
            if ($this->withform == 1 || $this->withform == -1) {
                $out .= '<tr><td align="center" colspan="2"><div class="center">';
                $out .= '<input class="button" type="submit" id="sendmail" name="sendmail" value="' . $langs->trans("SendMail") . '"';
                // Add a javascript test to avoid to forget to submit file before sending email
                if ($this->withfile == 2 && $conf->use_javascript_ajax) {
                    $out .= ' onClick="if (document.mailform.addedfile.value != \'\') { alert(\'' . dol_escape_js($langs->trans("FileWasNotUploaded")) . '\'); return false; } else { return true; }"';
                }
                $out .= ' />';
                if ($this->withcancel) {
                    $out .= ' &nbsp; &nbsp; ';
                    $out .= '<input class="button" type="submit" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '" />';
                }
                $out .= '</div></td></tr>' . "\n";
            }
            $out .= '</table>' . "\n";
            if ($this->withform == 1) {
                $out .= '</form>' . "\n";
            }
            // Disable enter key if option MAIN_MAILFORM_DISABLE_ENTERKEY is set
            if (!empty($conf->global->MAIN_MAILFORM_DISABLE_ENTERKEY)) {
                $out .= '<script type="text/javascript" language="javascript">';
                $out .= 'jQuery(document).ready(function () {';
                $out .= '	$(document).on("keypress", \'#mailform\', function (e) {		/* Note this is calle at every key pressed ! */
	    						var code = e.keyCode || e.which;
	    						if (code == 13) {
	        						e.preventDefault();
	        						return false;
	    						}
							});';
                $out .= '		})';
                $out .= '</script>';
            }
            $out .= "<!-- End form mail -->\n";
            return $out;
        }
    }
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:101,代码来源:html.formmail.class.php

示例11: editfieldval

 /**
  * Output val field for an editable field
  *
  * @param	string	$text			Text of label (not used in this function)
  * @param	string	$htmlname		Name of select field
  * @param	string	$value			Value to show/edit
  * @param	object	$object			Object
  * @param	boolean	$perm			Permission to allow button to edit parameter
  * @param	string	$typeofdata		Type of data ('string' by default, 'amount', 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...)
  * @param	string	$editvalue		When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value
  * @param	object	$extObject		External object
  * @param	mixed	$custommsg		String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
  * @param	string	$moreparam		More param to add on a href URL
  * @return  string					HTML edit field
  */
 function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata = 'string', $editvalue = '', $extObject = null, $custommsg = null, $moreparam = '')
 {
     global $conf, $langs, $db;
     $ret = '';
     // Check parameters
     if (empty($typeofdata)) {
         return 'ErrorBadParameter';
     }
     // When option to edit inline is activated
     if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;|datehourpicker/', $typeofdata)) {
         $ret .= $this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
     } else {
         if (GETPOST('action') == 'edit' . $htmlname) {
             $ret .= "\n";
             $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
             $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
             $ret .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
             $ret .= '<input type="hidden" name="id" value="' . $object->id . '">';
             $ret .= '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
             $ret .= '<tr><td>';
             if (preg_match('/^(string|email|numeric|amount)/', $typeofdata)) {
                 $tmp = explode(':', $typeofdata);
                 $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . ($tmp[1] ? ' size="' . $tmp[1] . '"' : '') . '>';
             } else {
                 if (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
                     $tmp = explode(':', $typeofdata);
                     $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . ($tmp[1] ? $tmp[1] : '20') . '" cols="' . ($tmp[2] ? $tmp[2] : '100') . '">' . ($editvalue ? $editvalue : $value) . '</textarea>';
                 } else {
                     if ($typeofdata == 'day' || $typeofdata == 'datepicker') {
                         $ret .= $this->form_date($_SERVER['PHP_SELF'] . '?id=' . $object->id, $value, $htmlname);
                     } else {
                         if ($typeofdata == 'datehourpicker') {
                             $ret .= $this->form_date($_SERVER['PHP_SELF'] . '?id=' . $object->id, $value, $htmlname, 1, 1);
                         } else {
                             if (preg_match('/^select;/', $typeofdata)) {
                                 $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
                                 foreach ($arraydata as $val) {
                                     $tmp = explode(':', $val);
                                     $arraylist[$tmp[0]] = $tmp[1];
                                 }
                                 $ret .= $this->selectarray($htmlname, $arraylist, $value);
                             } else {
                                 if (preg_match('/^ckeditor/', $typeofdata)) {
                                     $tmp = explode(':', $typeofdata);
                                     require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
                                     $doleditor = new DolEditor($htmlname, $editvalue ? $editvalue : $value, $tmp[2] ? $tmp[2] : '', $tmp[3] ? $tmp[3] : '100', $tmp[1] ? $tmp[1] : 'dolibarr_notes', 'In', $tmp[5] ? $tmp[5] : 0, true, true, $tmp[6] ? $tmp[6] : '20', $tmp[7] ? $tmp[7] : '100');
                                     $ret .= $doleditor->Create(1);
                                 }
                             }
                         }
                     }
                 }
             }
             $ret .= '</td>';
             if ($typeofdata != 'day' && $typeofdata != 'datepicker' && $typeofdata != 'datehourpicker') {
                 $ret .= '<td align="left">';
                 $ret .= '<input type="submit" class="button" name="modify" value="' . $langs->trans("Modify") . '">';
                 if (preg_match('/ckeditor|textarea/', $typeofdata)) {
                     $ret .= '<br>' . "\n";
                 }
                 $ret .= '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
                 $ret .= '</td>';
             }
             $ret .= '</tr></table>' . "\n";
             $ret .= '</form>' . "\n";
         } else {
             if ($typeofdata == 'email') {
                 $ret .= dol_print_email($value, 0, 0, 0, 0, 1);
             } elseif ($typeofdata == 'amount') {
                 $ret .= $value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : '';
             } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
                 $ret .= dol_htmlentitiesbr($value);
             } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
                 $ret .= dol_print_date($value, 'day');
             } elseif ($typeofdata == 'datehourpicker') {
                 $ret .= dol_print_date($value, 'dayhour');
             } else {
                 if (preg_match('/^select;/', $typeofdata)) {
                     $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
                     foreach ($arraydata as $val) {
                         $tmp = explode(':', $val);
                         $arraylist[$tmp[0]] = $tmp[1];
                     }
                     $ret .= $arraylist[$value];
                 } else {
//.........这里部分代码省略.........
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:101,代码来源:html.form.class.php

示例12: showInputField

 /**
  *  Return HTML string to put an input field into a page
  *
  *  @param	string	$key             Key of attribute
  *  @param  string	$value           Value to show
  *  @param  string	$moreparam       To add more parametes on html input tag
  *  @return	void
  */
 function showInputField($key, $value, $moreparam = '')
 {
     global $conf;
     $label = $this->attribute_label[$key];
     $type = $this->attribute_type[$key];
     $size = $this->attribute_size[$key];
     $elementtype = $this->attribute_elementtype[$key];
     if ($type == 'date') {
         $showsize = 10;
     } elseif ($type == 'datetime') {
         $showsize = 19;
     } elseif ($type == 'int') {
         $showsize = 10;
     } else {
         $showsize = round($size);
         if ($showsize > 48) {
             $showsize = 48;
         }
     }
     if ($type == 'int') {
         $out = '<input type="text" name="options_' . $key . '" size="' . $showsize . '" maxlength="' . $size . '" value="' . $value . '"' . ($moreparam ? $moreparam : '') . '>';
     } else {
         if ($type == 'varchar') {
             $out = '<input type="text" name="options_' . $key . '" size="' . $showsize . '" maxlength="' . $size . '" value="' . $value . '"' . ($moreparam ? $moreparam : '') . '>';
         } else {
             if ($type == 'text') {
                 require_once DOL_DOCUMENT_ROOT . "/core/class/doleditor.class.php";
                 $doleditor = new DolEditor('options_' . $key, $value, '', 200, 'dolibarr_notes', 'In', false, false, $conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE, 5, 100);
                 $out = $doleditor->Create(1);
             } else {
                 if ($type == 'date') {
                     $out .= ' (YYYY-MM-DD)';
                 } else {
                     if ($type == 'datetime') {
                         $out .= ' (YYYY-MM-DD HH:MM:SS)';
                     }
                 }
             }
         }
     }
     return $out;
 }
开发者ID:nrjacker4,项目名称:crm-php,代码行数:50,代码来源:extrafields.class.php

示例13: foreach

print '<td>' . $langs->trans("Mention") . '</td>' . "\n";
print '<td>&nbsp;</td>' . "\n";
print '</tr>';
foreach ($TFactor as $idFactor) {
    $factor = new TFactor();
    $factor->load($PDOdb, $idFactor);
    // Example with a yes / no select
    $var = !$var;
    print '<tr ' . $bc[$var] . '>';
    ob_start();
    $form->select_comptes($factor->fk_bank_account, 'TFactor[' . $factor->getId() . '][fk_bank_account]');
    $selectBank = ob_get_clean();
    echo '<td>' . $form->select_thirdparty_list($factor->fk_soc, 'TFactor[' . $factor->getId() . '][fk_soc]', 'fournisseur=1') . '<br />' . $selectBank . '</td>';
    // supplier
    if (!empty($conf->fckeditor->enabled)) {
        $editor = new DolEditor('TFactor[' . $factor->getId() . '][mention]', $factor->mention, '', 200);
        echo '<td>' . $editor->Create(1) . '<td>';
    } else {
        echo '<td>' . $formCore->zonetexte('', 'TFactor[' . $factor->getId() . '][mention]', $factor->mention, 80, 5) . '</td>';
    }
    echo '<td><a href="?action=delete_factor&id=' . $factor->getId() . '">' . img_delete($langs->trans('Delete')) . '</a></td>';
    print '</tr>';
}
print '</table><div class="tabsAction">';
echo $formCore->btsubmit($langs->trans('Add'), 'bt_add', '', 'butAction');
echo $formCore->btsubmit($langs->trans('Save'), 'bt_save', '', 'butAction');
echo '</div>';
$formCore->end();
// Setup page goes here
$var = false;
print '<table class="noborder" width="100%">';
开发者ID:ATM-Consulting,项目名称:dolibarr_module_factor,代码行数:31,代码来源:factor_setup.php


注:本文中的DolEditor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。