示例#1
0
文件: input.php 项目: adjaika/J3Base
 public function searchinput($fieldsid, $value, $extras)
 {
     return plgfieldsattachment_input::renderInput(-1, $fieldsid, $value, $extras);
 }
示例#2
0
 function getHTML($articleid, $fieldid, $category = true, $write = false)
 {
     global $globalreturn;
     $db =& JFactory::getDBO();
     $query = 'SELECT positionarticle FROM #__fieldsattach WHERE id = ' . $fieldid;
     $db->setQuery($query);
     $category = $db->loadResult();
     //$str = fieldattach::getInput($articleid, $fieldid, $category);
     $html = '';
     $valor = fieldattach::getValue($articleid, $fieldid, $category);
     $title = fieldattach::getName($articleid, $fieldid, $category);
     $published = plgfieldsattachment_input::getPublished($fieldid);
     if (!empty($valor) && $published) {
         $html = plgfieldsattachment_input::getTemplate($fieldid);
         /*
                         Templating INPUT *****************************
           [TITLE] - Title of field
                         [FIELD_ID] - Field id 
                         [VALUE] - Value of input
         */
         $valor = str_replace(";", "<br />", $valor);
         if (fieldattach::getShowTitle($fieldid)) {
             $html = str_replace("[TITLE]", $title, $html);
         } else {
             $html = str_replace("[TITLE]", "", $html);
         }
         $html = str_replace("[VALUE]", $valor, $html);
         $html = str_replace("[FIELD_ID]", $fieldid, $html);
     }
     //WRITE THE RESULT
     if ($write) {
         echo $html;
     } else {
         $globalreturn = $html;
         return $html;
     }
 }