| 943 |
} |
} |
| 944 |
|
|
| 945 |
/** |
/** |
| 946 |
* Display views_mail_admin views here. |
* Display views_mail_log views here. |
| 947 |
*/ |
*/ |
| 948 |
function views_mail_logs() { |
function views_mail_logs() { |
| 949 |
|
|
| 950 |
$form['#suffix'] = $explanation; |
$form['#suffix'] = $explanation; |
| 951 |
|
|
| 952 |
$res = db_query("SELECT name,description FROM {views_view} WHERE tag = 'views_mail_admin' ORDER BY description"); |
$res = db_query("SELECT name,description FROM {views_view} WHERE tag = 'views_mail_log' ORDER BY description"); |
| 953 |
|
|
| 954 |
while ($view = db_fetch_object($res)) { |
while ($view = db_fetch_object($res)) { |
| 955 |
|
|
| 2218 |
), |
), |
| 2219 |
); |
); |
| 2220 |
} |
} |
| 2221 |
|
|
| 2222 |
|
|
| 2223 |
|
/** |
| 2224 |
|
* Build link to views_mail configure view. |
| 2225 |
|
* |
| 2226 |
|
* @param string: $viewname Name of the view |
| 2227 |
|
* |
| 2228 |
|
* @return link to views_mail configure view |
| 2229 |
|
*/ |
| 2230 |
|
function views_mail_create_link($viewname) { |
| 2231 |
|
|
| 2232 |
|
// We got the view name. Now, get the $query (exposed filters). |
| 2233 |
|
// We only need to return a $query if there is a '&' present. |
| 2234 |
|
$query = $_SERVER['QUERY_STRING']; |
| 2235 |
|
if (preg_match('/\&/', $query)) { |
| 2236 |
|
//Remove the 'q=' and only return what's after the & |
| 2237 |
|
$args = preg_replace('/^q=([^&]*)&(.*)$/', '\2', $query); |
| 2238 |
|
} else { |
| 2239 |
|
$args = ""; |
| 2240 |
|
} |
| 2241 |
|
|
| 2242 |
|
$link = l(t('Configure Views Mail mailing'), "views_mail/config/$viewname", array('query' => "$args")); |
| 2243 |
|
|
| 2244 |
|
return $link; |
| 2245 |
|
} |