Пример #1
0
 /**
  *
  * @return the fully rendered dashlet
  */
 function display()
 {
     $listview = parent::display();
     $GLOBALS['current_sugarfeed'] = $this;
     $listview = preg_replace_callback('/\\{([^\\^ }]+)\\.([^\\}]+)\\}/', create_function('$matches', 'if($matches[1] == "this"){$var = $matches[2]; return $GLOBALS[\'current_sugarfeed\']->$var;}else{return translate($matches[2], $matches[1]);}'), $listview);
     $listview = preg_replace('/\\[(\\w+)\\:([\\w\\-\\d]*)\\:([^\\]]*)\\]/', '<a href="index.php?module=$1&action=DetailView&record=$2"><img src="themes/default/images/$1.gif" border=0>$3</a>', $listview);
     return $listview . '</div></div>';
 }
 /**
  *
  * @return the fully rendered dashlet
  */
 function display()
 {
     $listview = parent::display();
     $GLOBALS['current_sugarfeed'] = $this;
     $listview = preg_replace_callback('/\\{([^\\^ }]+)\\.([^\\}]+)\\}/', create_function('$matches', 'if($matches[1] == "this"){$var = $matches[2]; return $GLOBALS[\'current_sugarfeed\']->$var;}else{return translate($matches[2], $matches[1]);}'), $listview);
     //grab each token and store the module for later processing
     preg_match_all('/\\[(\\w+)\\:/', $listview, $alt_modules);
     //now process each token to create the proper url and image tags in feed, leaving a string for the alt to be replaced in next step
     $listview = preg_replace('/\\[(\\w+)\\:([\\w\\-\\d]*)\\:([^\\]]*)\\]/', '<a href="index.php?module=$1&action=DetailView&record=$2"><img src="themes/default/images/$1.gif" border=0 REPLACE_ALT>$3</a>', $listview);
     /*SKIP_IMAGE_TAG*/
     //process each module for the singular version so we can populate the alt tag on the image
     $altStrings = array();
     foreach ($alt_modules[1] as $alt) {
         //create the alt string and replace the alt token
         $altString = 'alt="' . translate('LBL_VIEW', 'SugarFeed') . ' ' . $GLOBALS['app_list_strings']['moduleListSingular'][$alt] . '"';
         $listview = preg_replace('/REPLACE_ALT/', $altString, $listview, 1);
     }
     return $listview . '</div></div>';
 }
Пример #3
0
 /**
  * 
  * @return the fully rendered dashlet
  */
 function display()
 {
     $listview = parent::display();
     $GLOBALS['current_groupmessage'] = $this;
     $listview = preg_replace_callback('/\\{([^\\}]+)\\.([^\\}]+)\\}/', create_function('$matches', 'if($matches[1] == "this"){$var = $matches[2]; return $GLOBALS[\'current_groupmessage\']->$var;}else{return translate($matches[2], $matches[1]);}'), $listview);
     $listview = preg_replace('/\\[(\\w+)\\:([\\w\\-\\d]*)\\:([^\\]]*)\\]/', '<a href="index.php?module=$1&action=DetailView&record=$2"><img src="themes/default/images/$1.gif" border=0>$3</a>', $listview);
     // Make this dashlet scroll if it gets too large
     $listview = '<div class="sugarFeedDashlet">' . $listview . '</div>';
     return $listview;
 }