Example #1
0
 private function _collitem_element_make(&$el, $i, $identifier, $fcid, $annotation = '', $stylename = 'expothumb')
 {
     $icon_info = _expo_public318_get_content_by_id($identifier, 'icon_info');
     $icon_uri = _expo_public318_get_icon_by_id($identifier, $icon_info);
     $icontag = WG::render_styled_image($icon_uri, $stylename);
     $el['icon'] = ['#markup' => '<div class="collitem-icon">' . $icontag . '</div>', '#weight' => -10];
     $el['annotationwrapper'] = ['#prefix' => '<div class="annotationwrapper">', '#suffix' => '</div>'];
     $el['annotationwrapper']['annotation'] = array('#type' => 'textarea', '#title' => t('我的註記'), '#attributes' => ['class' => ['theannotation']]);
     $el['target'] = ['#type' => 'hidden', '#value' => 'public318://' . $identifier, '#attributes' => ['class' => ['thetarget']]];
     $el['actions'] = ['#type' => 'container', '#prefix' => '<span class="collitem-edit-actions">', '#suffix' => '</span>', '#weight' => 50];
     $el['actions']['remove'] = array('#markup' => '<a href="#" class="collitem-remove btn btn-default" data-index="' . $i . '">移除</i></a>');
 }
Example #2
0
 private static function _fetch_public318($entity)
 {
     $ns = 'public318';
     $ext = 'jpg';
     $col = array('identifier' => $entity['identifier'], 'icon' => $entity['icon'], 'body' => $entity['text']);
     $identifier = $entity['identifier'];
     if ($entity['icon']) {
         $icon_realpath = _expo_public318_get_icon_by_id($identifier, $entity['icon_info']);
     }
     return true;
 }