コード例 #1
0
ファイル: select.php プロジェクト: xenten/swift-kanban
 function getHTML($articleid, $fieldsid, $category = false, $write = false)
 {
     global $globalreturn;
     //$str  = fieldattach::getSelect($articleid, $fieldsid);
     $valor = fieldattach::getValue($articleid, $fieldsid, $category);
     $title = fieldattach::getName($articleid, $fieldsid, $category);
     $html = "";
     if (!empty($valor)) {
         $isNull = plgfieldsattachment_select::isNull($fieldsid, $valor, $category);
         //echo "<br />ISNULL:".$isNull."---<br/>";
         if (!$isNull) {
             $valorselects = fieldattach::getValueSelect($fieldsid, $valor);
             $html .= '<div id="cel_' . $fieldsid . '" class=" ">';
             if (fieldattach::getShowTitle($fieldsid)) {
                 $html .= '<span class="title">' . $title . ' </span>';
             }
             $html .= '<span class="value">' . $valorselects . '</span></div>';
         } else {
             $html = "";
         }
     }
     //WRITE THE RESULT
     if ($write) {
         echo $html;
     } else {
         $globalreturn = $html;
         return $html;
     }
 }
コード例 #2
0
ファイル: select.php プロジェクト: AxelFG/ckbran-inf
 function getHTML($articleid, $fieldsid, $category = false, $write = false)
 {
     global $globalreturn;
     //$str  = fieldattach::getSelect($articleid, $fieldsid);
     $valor = fieldattach::getValue($articleid, $fieldsid, $category);
     $title = fieldattach::getName($articleid, $fieldsid, $category);
     $published = plgfieldsattachment_select::getPublished($fieldsid);
     $html = "";
     if (!empty($valor) && $published) {
         $isNull = plgfieldsattachment_select::isNull($fieldsid, $valor, $category);
         //echo "<br />ISNULL:".$isNull."---<br/>";
         if (!$isNull) {
             $valorselects = fieldattach::getValueSelect($fieldsid, $valor);
             $html = plgfieldsattachment_select::getTemplate($fieldsid);
             /*
                                         Templating Laouyt *****************************
                 [TITLE] - Title of field
                                         [FIELD_ID] - Field id 
                                         [VALUE] - Value of input
                                         [ARTICLE_ID] - Article id
             */
             if (fieldattach::getShowTitle($fieldsid)) {
                 $html = str_replace("[TITLE]", $title, $html);
             } else {
                 $html = str_replace("[TITLE]", "", $html);
             }
             $html = str_replace("[VALUE]", stripslashes($valorselects), $html);
             $html = str_replace("[FIELD_ID]", $fieldsid, $html);
             $html = str_replace("[ARTICLE_ID]", $articleid, $html);
         } else {
             $html = "";
         }
     }
     //WRITE THE RESULT
     if ($write) {
         echo $html;
     } else {
         $globalreturn = $html;
         return $html;
     }
 }