Пример #1
0
    public static function showMailingList($mailings, &$lists, $start, $limit, $total, $emailsearch, $listId, $listType, $forms, $show, $action, $setLimit = null, $setSort = null)
    {
        $Itemid = JRequest::getInt('Itemid');
        $mainframe = JFactory::getApplication();
        $my = JFactory::getUser();
        $mainPath = JNEWS_PATH_ADMIN_IMAGES2 . 'header/';
        $css = '.icon-48-newsletter { background-image:url(' . $mainPath . 'newsletter.png)}';
        $doc = JFactory::getDocument();
        $doc->addStyleDeclaration($css, $type = 'text/css');
        //		$img = 'newsletter.png';
        $item = !empty($Itemid) ? '&Itemid=' . $Itemid : '';
        $hidden = '<input type="hidden" name="listid" value="' . $listId . '" />';
        $hidden .= '<input type="hidden" name="act" value="' . $action . '" />';
        $hidden .= '<input type="hidden" name="limit" value="' . $limit . '" />';
        $pos = strpos($forms['main'], "<form");
        if ($pos !== false) {
            $forms['select'] = "";
        }
        echo $forms['main'];
        // top portion before the table list
        // for search
        $toSearch = new stdClass();
        $toSearch->forms = $forms['select'];
        $toSearch->hidden = $hidden;
        $toSearch->listsearch = $emailsearch;
        $toSearch->id = 'emailsearch';
        $title = !empty($lists['title']) ? $lists['title'] : '';
        echo jnews::setTop($toSearch, $title, $setLimit);
        ?>

	<table class="<?php 
        echo jnews::myTheme();
        ?>
">
		<thead>
			<tr>
				<th width="40" height="20" align="center" class="title"><center>#</center></th>
				 <?php 
        if ($show['select']) {
            ?>
				<th width="32"  align="center" class="title">&nbsp;</th>
				 <?php 
        }
        if ($show['status']) {
            ?>
				<th  width="40" class="title" align="center"><center><?php 
            echo jnews::HTML_GridSort(_JNEWS_PUBLISHED, 'published', $setSort->orderDir, $setSort->orderValue);
            ?>
</center></th>
				 <?php 
        }
        if (empty($listType) || $listType == 0) {
            $listType = JRequest::getVar('listype', 0);
            //listType to listype
        }
        if ($listType == 2) {
            $show['delay'] = true;
            if ($show['delay']) {
                ?>
				<th width="80"  class="title" align="center"><center><?php 
                echo jnews::HTML_GridSort(_JNEWS_LIST_DELAY, 'delay', $setSort->orderDir, $setSort->orderValue);
                ?>
</center></th>
				 <?php 
            }
        }
        if ($listType == 1 or $listType == 7) {
            if ($show['sentdate']) {
                ?>
				<th width="140"  class="title"><?php 
                echo jnews::HTML_GridSort(_JNEWS_LIST_DATE, 'send_date', $setSort->orderDir, $setSort->orderValue);
                ?>
</th>
				 <?php 
            }
        }
        ?>
				<th class="title" align="left"><?php 
        echo jnews::HTML_GridSort(_JNEWS_LIST_SUB, 'subject', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				<?php 
        if ($mainframe->isAdmin()) {
            ?>
				 <?php 
            if ($show['status']) {
                ?>
				<th width="40" class="title" align="center"><center><?php 
                echo jnews::HTML_GridSort(_JNEWS_VISIBLE, 'visible', $setSort->orderDir, $setSort->orderValue);
                ?>
</center></th>
				<?php 
            }
        }
        ?>
				<?php 
        if (!empty($show['send']) && $show['send'] || $mainframe->isAdmin()) {
            if ($listType == 1) {
                ?>
					<th width="100" class="title" align="left"><?php 
                echo _JNEWS_SENDBTN;
                ?>
</th>
				<?php 
            }
        }
        if ($mainframe->isAdmin()) {
            ?>
				<th width="100" class="title" align="left"><?php 
            echo _JNEWS_DELETEBTN;
            ?>
</th>
				 <?php 
        }
        if ($mainframe->isAdmin()) {
            ?>
<th width="140"  class="title"><?php 
            echo jnews::HTML_GridSort(_JNEWS_CREATE_DATE, 'createdate', $setSort->orderDir, $setSort->orderValue);
            ?>
</th><?php 
        }
        if ($show['id']) {
            ?>
				<th width="40" class="title"><center><?php 
            echo jnews::HTML_GridSort('ID', 'id', $setSort->orderDir, $setSort->orderValue);
            ?>
</center></th>
				<?php 
        }
        ?>
			</tr>
		</thead>
	<?php 
        if (!empty($mailings)) {
            $i = 0;
            if (version_compare(JVERSION, '3.0.0', '<')) {
                $onClickFct = '';
            } else {
                $onClickFct = 'Joomla.';
            }
            foreach ($mailings as $mailing) {
                ?>
	<tr class="row<?php 
                echo ($i + 1) % 2;
                ?>
">
		<td  height="20" align="center"><center><?php 
                echo $i + 1 + $start;
                ?>
</center></td>
		 <?php 
                if (version_compare(JVERSION, '3.0.0', '<')) {
                    $onClickFct = '';
                } else {
                    $onClickFct = 'Joomla.';
                }
                if ($show['select']) {
                    ?>
		<td  align="center"><input type="radio" id="cb<?php 
                    echo $i;
                    ?>
" name="mailingid" value="<?php 
                    echo $mailing->id;
                    ?>
" onclick="<?php 
                    echo $onClickFct;
                    ?>
isChecked(this.checked);" /></td>
		 <?php 
                }
                if ($show['status']) {
                    switch ($mailing->published) {
                        case '1':
                            $img = '16/status_g.png';
                            jnews::getLegend('status_g.png', _JNEWS_VISIBLE . '/' . _JNEWS_TEMPLATE_PUBLISH);
                            break;
                        case '2':
                            $img = '16/status_y.png';
                            jnews::getLegend('status_y.png', _JNEWS_SCHEDULED);
                            break;
                        default:
                            $img = '16/status_r.png';
                            jnews::getLegend('status_r.png', _JNEWS_NOTVISIBLE . '/' . _JNEWS_UNPUBLISHED);
                            break;
                    }
                    $publishStatus = !empty($mailing->published) && $mailing->published == 1 ? 'unpublishMailing' : 'publishMailing';
                    ?>
		<td  align="center"><center><img src="<?php 
                    echo JNEWS_PATH_ADMIN_IMAGES2 . $img;
                    ?>
" width="12" height="12" border="0" alt="" /></center></td>
		<?php 
                }
                if ($listType == 2) {
                    if ($show['delay']) {
                        $delay = $mailing->delay / 1440;
                        ?>
		<td  align="center"><?php 
                        echo $delay;
                        ?>
</td>
		 <?php 
                    }
                }
                if ($listType == 1 or $listType == 7) {
                    if ($show['sentdate']) {
                        ?>
		<td width="200"><div align="center"><?php 
                        if ($mailing->send_date == 0 or $mailing->send_date == 1) {
                            echo '0000-00-00 00:00:00';
                        } else {
                            echo date('D, d M Y H:i:s', jnews::getNow(0, true, $mailing->send_date));
                        }
                    }
                    ?>
</div></td>
		 <?php 
                }
                $backendLink = $show['index'] == 'index' ? false : true;
                if (!$show['admin'] or $mailing->published == 1 and ($mailing->mailing_type == 1 or $mailing->mailing_type == 7 or $mailing->mailing_type == 2)) {
                    $link = 'option=' . JNEWS_OPTION . '&act=' . $action . '&task=view&listid=' . $listId . '&mailingid=' . $mailing->id . '&listype=' . $mailing->mailing_type . $item;
                } else {
                    $link = 'option=' . JNEWS_OPTION . '&act=' . $action . '&task=edit&mailingid=' . $mailing->id . '&listid=' . $listId . '&listype=' . $mailing->mailing_type . $item;
                }
                $link = jNews_Tools::completeLink($link, true, true, false);
                ?>
		<td align="left">
		<?php 
                if ($mainframe->isAdmin()) {
                    echo '<a  href="' . $link . '" >';
                    echo $mailing->subject;
                    echo '</a>';
                } else {
                    if ($GLOBALS[JNEWS . 'level'] > 1 || $mailing->published == 1) {
                        $archiveLinkType = !empty($GLOBALS[JNEWS . 'archive_link']) ? $GLOBALS[JNEWS . 'archive_link'] : '';
                        switch ($archiveLinkType) {
                            case 'popup':
                                $link .= '&tmpl=component';
                                echo '<a href="#" onClick="window.open(\'' . $link . '\', \'Detail\', \'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=800,height=600,left=150,top=150\');" >';
                                echo $mailing->subject;
                                echo '</a>';
                                break;
                            case 'newpage':
                                echo '<a  href="' . $link . '" target="_blank">';
                                echo $mailing->subject;
                                echo '</a>';
                                break;
                            case 'standard':
                            default:
                                echo '<a  href="' . $link . '" >';
                                echo $mailing->subject;
                                echo '</a>';
                                break;
                        }
                    } else {
                        echo $mailing->subject;
                    }
                }
                ?>
		</td>
		 <?php 
                if ($mainframe->isAdmin()) {
                    if ($show['status']) {
                        if ($mailing->visible == 1) {
                            $img = '16/status_g.png';
                            jnews::getLegend('status_g.png', _JNEWS_VISIBLE . '/' . _JNEWS_TEMPLATE_PUBLISH);
                        } else {
                            $img = '16/status_r.png';
                            jnews::getLegend('status_r.png', _JNEWS_NOTVISIBLE . '/' . _JNEWS_UNPUBLISHED);
                        }
                        $delQimg = 'delete_queue.png';
                        ?>
		<td align="center"><center>
			<a href="<?php 
                        $listidmailing = JRequest::getVar('listid');
                        $listtypemailing = JRequest::getInt('listype');
                        echo jnews::createToggleLink('mailing', 'visible', 'mailingid', $mailing->id, 'toggle', $listidmailing, $listtypemailing);
                        ?>
"> <img src="<?php 
                        echo JNEWS_PATH_ADMIN_IMAGES2 . $img;
                        ?>
" width="12" height="12" border="0" alt="" /> </a>
		</center></td>
		 <?php 
                    }
                }
                ?>
		<?php 
                if (!empty($show['send']) && $show['send'] || $mainframe->isAdmin()) {
                    if ($listType == 1) {
                        ?>
		<td align="center"><center>
			<?php 
                        JHTML::_('behavior.modal');
                        //we check here if we are in the fe or be
                        $sendready = true;
                        if (!$mainframe->isAdmin()) {
                            $sendready = false;
                        }
                        $linkFomr5 = jNews_Tools::completeLink('option=' . JNEWS_OPTION . '&act=mailing&task=sendready&mailingid=' . $mailing->id . '&listype=' . $mailing->mailing_type, $sendready, false, true);
                        ?>
			<a class="modal" href="<?php 
                        echo $linkFomr5;
                        ?>
" rel="{handler: 'iframe', size: {x: 750, y: 500}}">
			<img src="<?php 
                        echo JNEWS_PATH_ADMIN_IMAGES2 . 'message_sent.png';
                        ?>
"width="18" height="18" border="0" alt=""/> </a>
		</center></td>
		<?php 
                    }
                }
                if ($mainframe->isAdmin()) {
                    ?>
<script language="javascript" type="text/javascript">
	function deleteQueue(url){
		if(!confirm("Are you sure you want to delete the entries of this mailing from the Queue?")){
			return false;
		}else{
			window.location = url;
		}
	}
</script>
		<td align="center"><center>
			<a onclick="deleteQueue('<?php 
                    echo 'index.php?option=' . JNEWS_OPTION . '&act=mailing&task=deletequeue&mailingid=' . $mailing->id . '&listype=' . $mailing->mailing_type;
                    ?>
')" href="#"> <img src="<?php 
                    echo JNEWS_PATH_ADMIN_IMAGES2 . $delQimg;
                    ?>
"width="18" height="18" border="0" alt=""/> </a>
		</center></td>
		 <?php 
                }
                if ($mainframe->isAdmin()) {
                    ?>
		 <td align="center"><?php 
                    if ($mailing->createdate <= 0) {
                        echo '0000-00-00 00:00:00';
                    } else {
                        echo date('D, d M Y H:i:s', jnews::getNow(0, true, $mailing->createdate));
                    }
                    ?>
		 </td><?php 
                }
                if ($show['id']) {
                    ?>
		<td align="center"><center><?php 
                    echo $mailing->id;
                    ?>
</center></td>
		<?php 
                }
                ?>
	</tr>
	<?php 
                $i++;
            }
        }
        ?>
    <?php 
        if (is_array($listType)) {
            $listType = implode(',', $listType);
        }
        ?>
	</table>
    <input type="hidden" name="act" value="<?php 
        echo $action;
        ?>
" />
    <input type="hidden" name="listid" value="<?php 
        echo $listId;
        ?>
" />
    <input type="hidden" name="listype" value="<?php 
        echo $listType;
        ?>
" />
	<?php 
        echo '<br />';
        echo jnews::setLegend();
    }
Пример #2
0
    public static function showListingLists($lists, $action, $task, $forms, $show, $listsearch = '', $limit = 0, $setLimit = null, $totalSubs = null, $setSort = null, $totalUnSubs = null)
    {
        $Itemid = JRequest::getInt('Itemid');
        $mainframe = JFactory::getApplication();
        $my = JFactory::getUser();
        $loggedin = false;
        if ($my->id > 0) {
            $loggedin = true;
        }
        if (empty($Itemid) and !$mainframe->isAdmin() and !empty($GLOBALS[JNEWS . 'itemidAca'])) {
            $Itemid = $GLOBALS[JNEWS . 'itemidAca'];
        }
        if (!empty($Itemid)) {
            $item = '&Itemid=' . $Itemid;
        } else {
            $item = '';
        }
        echo $forms['main'];
        // top portion before the table list
        if ($mainframe->isAdmin()) {
            // for search
            $toSearch = new stdClass();
            $toSearch->listsearch = $listsearch;
            $toSearch->id = 'listsearch';
            echo jnews::setTop($toSearch, null, $setLimit);
        }
        echo '<table class="' . jnews::myTheme() . '"><thead><tr>';
        echo '<th width="2%" class="title">#</td>';
        if ($show['select']) {
            echo '<th width="3%" style="text-align:center;" class="title"></th>';
        }
        echo '<th width="30%" class="title"><center>' . jnews::HTML_GridSort(_JNEWS_LIST_NAME, 'list_name', $setSort->orderDir, $setSort->orderValue) . '</th>';
        if ($show['sender']) {
            echo '<th width="20%" class="title"><center>' . jnews::HTML_GridSort(_JNEWS_LIST_SENDER, 'sendername', $setSort->orderDir, $setSort->orderValue) . '</center> </th>';
        }
        if ($show['sender_email']) {
            echo ' <th width="15%" class="title"><center>' . _JNEWS_SENDER_EMAIL . '</center></th>';
        }
        if ($show['mailings_link']) {
            echo '<th width="17%" class="title"><center>' . _JNEWS_MENU_MAILING_TITLE . '</center></th>';
        }
        if ($show['mailings_sub']) {
            echo '<th width="17%" class="title"><center>' . _JNEWS_SUBSCRIBER_CONFIG . '</center></th>';
            echo '<th width="17%" class="title"><center>' . _JNEWS_UNSUBSCRIBER_CONFIG . '</center></th>';
        }
        if ($show['visible']) {
            echo '<th width="5%" class="title"><center>' . jnews::HTML_GridSort(_JNEWS_VISIBLE, 'hidden', $setSort->orderDir, $setSort->orderValue) . '</center></th>';
        }
        if ($show['published']) {
            echo '<th width="5%" class="title"><center>' . jnews::HTML_GridSort(_JNEWS_PUBLISHED, 'published', $setSort->orderDir, $setSort->orderValue) . '</center></th>';
        }
        if ($show['buttons']) {
            if ($GLOBALS[JNEWS . 'allow_unregistered'] or $loggedin) {
                echo '<th class="title" width="90"><center>' . _JNEWS_SUBSCRIB . '</center></th>';
            }
            if ($GLOBALS[JNEWS . 'show_archive'] == '1') {
                echo '<th class="title" width="90"><center>' . _JNEWS_VIEW_ARCHIVE . '</center></th>';
            }
        }
        if ($show['id']) {
            echo '<th width="2%" class="title">' . jnews::HTML_GridSort('ID', 'id', $setSort->orderDir, $setSort->orderValue) . '</th>';
        }
        echo '</tr></thead>';
        $i = 0;
        $ctr = 0;
        //total subs
        if (!empty($lists)) {
            if (version_compare(JVERSION, '3.0.0', '<')) {
                $onClickFct = '';
            } else {
                $onClickFct = 'Joomla.';
            }
            foreach ($lists as $list) {
                $i++;
                if ($list->list_type == 1 or $list->list_type == 7) {
                    //mariap
                    $linkArchive = 'option=' . JNEWS_OPTION . '&act=mailing&listid=' . $list->id . '&listype=' . $list->list_type . '&task=archive' . $item;
                } else {
                    $linkArchive = '#';
                }
                ?>
		<tr class="row<?php 
                echo ($i + 2) % 2;
                ?>
">
			<?php 
                $num = isset($setLimit->start) ? $i + $setLimit->start : $i;
                echo '<td width="2%" class="title"><center>' . $num . '</center></td>';
                ?>
			<?php 
                if ($show['select']) {
                    ?>
			<td><center><input type="radio" name="listid" value="<?php 
                    echo $list->id;
                    ?>
" onclick="<?php 
                    echo $onClickFct;
                    ?>
isChecked(this.checked);" /></center></td>
			<?php 
                }
                if ($show['index'] == 'index') {
                    if ($mainframe->isAdmin()) {
                        if (jnews::checkPermissions('admin')) {
                            $link = 'option=' . JNEWS_OPTION . '&act=' . $action . '&task=' . $task . '&listid=' . $list->id . $item;
                        } else {
                            $link = $linkArchive;
                        }
                    } else {
                        if (jnews::checkPermissions('admin')) {
                            $link = 'option=' . JNEWS_OPTION . '&act=' . $action . '&task=' . $task . '&listid=' . $list->id . '&listype=' . $list->list_type . $item;
                        } else {
                            $link = $linkArchive;
                        }
                    }
                    $link = jNews_Tools::completeLink($link, false);
                } else {
                    if ($mainframe->isAdmin()) {
                        $link = 'option=' . JNEWS_OPTION . '&act=' . $action . '&task=' . $task . '&listid=' . $list->id;
                        $link = jNews_Tools::completeLink($link);
                    } else {
                        $link = 'option=' . JNEWS_OPTION . '&act=' . $action . '&task=' . $task . '&listid=' . $list->id . '&listype=' . $list->list_type;
                        $link = jNews_Tools::completeLink($link);
                    }
                }
                ?>
			<td>
				<span class="aca_letter_names" <?php 
                if ($link == "#" or $link == "administrator/#") {
                    echo " onclick='return false;' ";
                }
                ?>
>
				<?php 
                echo jNews_Tools::toolTip($list->list_desc, $list->list_name, '', '', $list->list_name, $link, 1);
                ?>
				</span>
			</td>

			<?php 
                if ($show['sender']) {
                    echo '<td>' . $list->sendername . '</td>';
                }
                if ($show['sender_email']) {
                    echo ' <td width="20%" class="title">' . $list->senderemail . '</td>';
                }
                if ($show['mailings_link']) {
                    $ltype = isset($list->list_type) && $list->list_type == 2 ? 2 : 1;
                    if ($show['index'] == 'index') {
                        $link = 'option=' . JNEWS_OPTION . '&act=mailing&task=show&listid=' . $list->id;
                        if (!empty($ltype)) {
                            $link .= '&listype=' . $ltype;
                        }
                        $link .= $item;
                        $link = jNews_Tools::completeLink($link, false);
                    } else {
                        $link = 'option=' . JNEWS_OPTION . '&act=mailing&task=show&listid=' . $list->id;
                        if (!empty($ltype)) {
                            $link .= '&listype=' . $ltype;
                        }
                        $link = jNews_Tools::completeLink($link);
                    }
                    //for autoresponder list only we need to filter the autoresponders to their associated list
                    if ($action == 'arlist') {
                        $link = 'index.php?option=' . JNEWS_OPTION . '&act=mailing&listype=2&listid=' . $list->id;
                    }
                    //listType to listype
                    ?>
				<td><center><a href="<?php 
                    echo $link;
                    ?>
"> <?php 
                    echo _JNEWS_MALING_EDIT_VIEW;
                    ?>
</a></center></td>
			<?php 
                }
                if ($show['mailings_sub']) {
                    if ($show['index'] == 'index') {
                        $link = 'option=' . JNEWS_OPTION . '&act=subscribers&listid=' . $list->id . '&subtype=1' . $item;
                        $link = jNews_Tools::completeLink($link, false);
                        $linkUnsubscribed = 'option=' . JNEWS_OPTION . '&act=subscribers&listid=' . $list->id . '&subtype=2' . $item;
                        $linkUnsubscribed = jNews_Tools::completeLink($linkUnsubscribed, false);
                    } else {
                        $link = 'option=' . JNEWS_OPTION . '&act=subscribers&listid=' . $list->id . '&subtype=1';
                        $link = jNews_Tools::completeLink($link);
                        $linkUnsubscribed = 'option=' . JNEWS_OPTION . '&act=subscribers&listid=' . $list->id . '&subtype=2';
                        $linkUnsubscribed = jNews_Tools::completeLink($linkUnsubscribed);
                    }
                    ?>
				<td><center><a href="<?php 
                    echo $link;
                    ?>
">
				<?php 
                    echo _JNEWS_SUBCRIBERS_VIEW . " ( {$totalSubs[$ctr]} ) ";
                    ?>
					</center>
				</td>
				<td><center><a href="<?php 
                    echo $linkUnsubscribed;
                    ?>
">
				<?php 
                    echo _JNEWS_UNSUBCRIBERS_VIEW . " ( {$totalUnSubs[$ctr]} ) ";
                    // $totalSubs[$ctr]
                    ?>
					</center>
				</td>
			<?php 
                    $ctr++;
                }
                if ($show['visible']) {
                    if ($list->hidden == 1) {
                        $img = '16/status_g.png';
                        jnews::getLegend('status_g.png', _JNEWS_VISIBLE . '/' . _JNEWS_TEMPLATE_PUBLISH);
                    } else {
                        $img = '16/status_r.png';
                        jnews::getLegend('status_r.png', _JNEWS_NOTVISIBLE . '/' . _JNEWS_UNPUBLISHED);
                    }
                    ?>
			<td height="20"><center>
			<?php 
                    if ($mainframe->isAdmin()) {
                        ?>
				<a href="<?php 
                        $act = JRequest::getVar('act', 'list', '', 'WORD');
                        echo jnews::createToggleLink($act, 'hidden', 'listid', $list->id);
                        ?>
"> <img src="<?php 
                        echo JNEWS_PATH_ADMIN_IMAGES2 . $img;
                        ?>
" width="12" height="12" border="0" alt="" /> </a>
			<?php 
                    } else {
                        ?>
				<img src="<?php 
                        echo JNEWS_PATH_ADMIN_IMAGES2 . $img;
                        ?>
" width="12" height="12" border="0" alt="" />
			<?php 
                    }
                    ?>
			</center></td>
			<?php 
                }
                if ($show['published']) {
                    ?>
			<td align="center"><center>
				<?php 
                    if ($list->published == 1) {
                        $img = '16/status_g.png';
                        $alt = 'Published';
                        jnews::getLegend('status_g.png', _JNEWS_VISIBLE . '/' . _JNEWS_TEMPLATE_PUBLISH);
                    } else {
                        if ($list->published == 2) {
                            $img = '16/status_y.png';
                            $alt = 'Scheduled';
                            jnews::getLegend('status_y.png', _JNEWS_SCHEDULED);
                        } else {
                            $img = '16/status_r.png';
                            $alt = 'Unpublished';
                            jnews::getLegend('status_r.png', _JNEWS_NOTVISIBLE . '/' . _JNEWS_UNPUBLISHED);
                        }
                    }
                    $status = !empty($list->published) && $list->published == 1 ? 'unpublish' : 'publish';
                    if ($mainframe->isAdmin()) {
                        ?>
					<a href="<?php 
                        $act = JRequest::getVar('act', 'list', '', 'WORD');
                        echo jnews::createToggleLink($act, $status, 'listid', $list->id, 'togle');
                        ?>
"> <img src="<?php 
                        echo JNEWS_PATH_ADMIN_IMAGES2 . $img;
                        ?>
" width="12" height="12" border="0" alt="<?php 
                        echo $alt;
                        ?>
" /> </a>
				<?php 
                    } else {
                        ?>
					 <img src="<?php 
                        echo JNEWS_PATH_ADMIN_IMAGES2 . $img;
                        ?>
" width="12" height="12" border="0" alt="<?php 
                        echo $alt;
                        ?>
" />
				<?php 
                    }
                    ?>
			</center></td>
			<?php 
                }
                ?>


	<?php 
                if ($show['buttons']) {
                    $backendLink = $show['index'] == 'index' ? false : true;
                    if ($GLOBALS[JNEWS . 'allow_unregistered'] or $loggedin) {
                        $link = 'index.php?option=' . JNEWS_OPTION . '&act=subone&listid=' . $list->id . $item;
                        $link = JRoute::_($link);
                        $img = 'folder_add_f2.png';
                        echo '<td align="center" height="24"><center>';
                        echo '<a href="' . $link . '" >' . "\n\r";
                        echo '<img src="' . JNEWS_JPATH_LIVE . '/components/' . JNEWS_OPTION . '/images/' . $img . '" width="20" height="20" border="0" alt="" /></a></center></td>' . "\n\r";
                    }
                    if (($list->list_type == 1 or $list->list_type == 7) && $GLOBALS[JNEWS . 'show_archive'] == '1') {
                        $linkArchive = 'option=' . JNEWS_OPTION . '&act=mailing&listid=' . $list->id . '&listype=' . $list->list_type . '&task=archive' . $item;
                        $linkArchive = jNews_Tools::completeLink($linkArchive, true);
                        $img = 'move_f2.png';
                        echo '<td height="24"><center>';
                        echo '<a href="' . $linkArchive . '" >' . "\n\r";
                        echo '<img src="' . JNEWS_JPATH_LIVE . '/components/' . JNEWS_OPTION . '/images/' . $img . '" width="20" height="20" border="0" alt="' . _JNEWS_VIEW_ARCHIVE . '" /></a></center></td>' . "\n\r";
                    } elseif ($GLOBALS[JNEWS . 'show_archive'] == '1') {
                        //ifthe list is an autoresponder don't need to show the archives
                        echo '<td height="24"><center>-</center></td>' . "\n\r";
                    }
                }
                if ($show['id']) {
                    echo '<td width="2%" class="title"><center>' . $list->id . '</center></td>';
                }
                echo '	</tr>' . "\n\r";
            }
        }
        echo '</table>';
        echo '<br />';
        echo jnews::setLegend();
    }
Пример #3
0
    public static function showSubscribers($subscribers, $action, $listId, &$lists, $start, $limit, $total, $showAdmin, $theLetterId, $emailsearch, $forms, $setLimit = null, $front = false, $setSort = null)
    {
        $my = JFactory::getUser();
        $mainframe = JFactory::getApplication();
        ?>

	<script language="javascript" type="text/javascript">
	//<!--
	function jnewsletterselectall(){
		var i = 0;
		allcheck = document.getElementById("selectallcheck");
		if(allcheck.checked) checkedvalue = 1;
		else checkedvalue = 0;

		while(myelement = document.getElementById("cid["+i+"]")){
			myelement.checked = checkedvalue;
			i++;
		}

		if(checkedvalue){
			document.getElementById("boxcount").value = i;
		}else{
			document.getElementById("boxcount").value = 0;
		}
	}
	 //-->
	</script>

	<?php 
        if ($listId == 0) {
            $message = _JNEWS_SUSCRIB_LIST;
        } else {
            $lt_name = jNews_Lists::getLists($listId, 0, null, '', false, false, true);
            $message = _JNEWS_SUSCRIB_LIST_UNIQUE . "<span style='color: rgb(51, 51, 51);'>" . @$lt_name[0]->list_name . "</span>";
        }
        $filter = _JNEWS_SEL_LIST . '  ' . $lists['listid'] . ' ' . $lists['subscirberType'];
        $hidden = '<input type="hidden" name="listid" value="' . $listId . '" />';
        $hidden .= '<input type="hidden" name="limit" value="' . $limit . '" />';
        $pos = strpos($forms['main'], "<form");
        if ($pos !== false) {
            $forms['select'] = "";
        }
        echo $forms['main'];
        // top portion before the table list
        // for search
        $toSearch = new stdClass();
        $toSearch->forms = $forms['select'];
        $toSearch->hidden = $hidden;
        $toSearch->listsearch = $emailsearch;
        $toSearch->id = 'emailsearch';
        echo jnews::setTop($toSearch, $message, $setLimit, $filter);
        ?>

		<table class="<?php 
        echo jnews::myTheme();
        ?>
">
		<thead>
		<tr>
			<th class="title">#</th>
			<th class="title"><input type="checkbox" id="selectallcheck" name="allchecked" onclick="jnewsletterselectall();"/></th>
			<th class="title"><?php 
        echo jnews::HTML_GridSort(_JNEWS_INPUT_NAME, 'name', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
		<?php 
        if ($mainframe->isAdmin()) {
            ?>
			<th class="title"><?php 
            echo jnews::HTML_GridSort(_JNEWS_INPUT_EMAIL, 'email', $setSort->orderDir, $setSort->orderValue);
            ?>
</th>
		<?php 
        } else {
            if ($GLOBALS[JNEWS . 'show_sub_email']) {
                ?>
				<th class="title"><?php 
                echo jnews::HTML_GridSort(_JNEWS_INPUT_EMAIL, 'email', $setSort->orderDir, $setSort->orderValue);
                ?>
</th>
		<?php 
            }
        }
        //endelse
        if ($mainframe->isAdmin()) {
            ?>
			<th class="title"><?php 
            echo jnews::HTML_GridSort(_JNEWS_SIGNUP_DATE, 'subscribe_date', $setSort->orderDir, $setSort->orderValue);
            ?>
</th>
		<?php 
        }
        ?>
			<th class="title"><center><?php 
        echo jnews::HTML_GridSort(_JNEWS_REGISTERED, 'user_id', $setSort->orderDir, $setSort->orderValue);
        ?>
</center></th>
			<th class="title"><center><?php 
        echo jnews::HTML_GridSort(_JNEWS_CONFIRMED, 'confirmed', $setSort->orderDir, $setSort->orderValue);
        ?>
</center></th>
			<th class="title"><center><?php 
        echo jnews::HTML_GridSort(_JNEWS_HTML, 'receive_html', $setSort->orderDir, $setSort->orderValue);
        ?>
</center></th>
		<?php 
        if ($GLOBALS[JNEWS . 'level'] > 2) {
            //check if the version of jnewsletter is pro
            if ($GLOBALS[JNEWS . 'show_column1'] == 1) {
                ?>
				<th class="title"><center><?php 
                echo $GLOBALS[JNEWS . 'column1_name'];
            }
            //<!--/center></th><!--column 1 in the subscribers list-BE-->
            if ($GLOBALS[JNEWS . 'show_column2'] == 1) {
                ?>
				<th class="title"><center><?php 
                echo $GLOBALS[JNEWS . 'column2_name'];
            }
            if ($GLOBALS[JNEWS . 'show_column3'] == 1) {
                ?>
				<th class="title"><center><?php 
                echo $GLOBALS[JNEWS . 'column3_name'];
            }
            if ($GLOBALS[JNEWS . 'show_column4'] == 1) {
                ?>
				<th class="title"><center><?php 
                echo $GLOBALS[JNEWS . 'column4_name'];
            }
            if ($GLOBALS[JNEWS . 'show_column5'] == 1) {
                ?>
				<th class="title"><center><?php 
                echo $GLOBALS[JNEWS . 'column5_name'];
            }
        }
        if (jnews::checkPermissions('admin')) {
            ?>
			<th class="title"><?php 
            echo jnews::HTML_GridSort('ID', 'id', $setSort->orderDir, $setSort->orderValue);
            ?>
</th>
		<?php 
        }
        ?>
		</tr>
		</thead>
		<?php 
        $i = 0;
        if (!empty($subscribers)) {
            if (version_compare(JVERSION, '3.0.0', '<')) {
                $onClickFct = '';
            } else {
                $onClickFct = 'Joomla.';
            }
            foreach ($subscribers as $subscriber) {
                $subscriber->email = trim($subscriber->email);
                if (!jNews_Subscribers::validEmail($subscriber->email)) {
                    continue;
                }
                if ($subscriber->user_id != 0) {
                    $img = '16/status_g.png';
                    $alt = 'Registered';
                    jnews::getLegend('status_g.png', _JNEWS_REGISTERED . '/' . _JNEWS_CONFIRMED);
                } else {
                    $img = '16/status_r.png';
                    $alt = 'Unregistered';
                    jnews::getLegend('status_r.png', _JNEWS_SUBSCRIBERS_UNREGISTERED . '/' . _JNEWS_PIE_UNCONFIRMED);
                }
                //endelse
                if ($subscriber->confirmed == 1) {
                    $imgC = '16/status_g.png';
                    $altC = 'Confirmed';
                    jnews::getLegend('status_g.png', _JNEWS_REGISTERED . '/' . _JNEWS_CONFIRMED);
                } else {
                    $imgC = '16/status_r.png';
                    $altC = 'Not confirmed';
                    jnews::getLegend('status_r.png', _JNEWS_SUBSCRIBERS_UNREGISTERED . '/' . _JNEWS_PIE_UNCONFIRMED);
                }
                //endelse
                if ($subscriber->receive_html == 1) {
                    $imgH = '16/status_g.png';
                    $altH = 'HTML';
                    jnews::getLegend('status_g.png', _JNEWS_REGISTERED . '/' . _JNEWS_CONFIRMED);
                } else {
                    $imgH = '16/status_r.png';
                    $altH = 'TEXT';
                    jnews::getLegend('status_r.png', _JNEWS_SUBSCRIBERS_UNREGISTERED . '/' . _JNEWS_PIE_UNCONFIRMED);
                }
                //endelse
                ?>
					<tr class="row<?php 
                echo ($i + 1) % 2;
                ?>
">
						<td><center><?php 
                echo $i + 1 + $start;
                ?>
</center></td>

						<td>
							<center><input type="checkbox" id="cid[<?php 
                echo $i;
                ?>
]" name="cid[<?php 
                echo $i;
                ?>
]" value="<?php 
                echo $subscriber->id;
                ?>
" onclick="<?php 
                echo $onClickFct;
                ?>
isChecked(this.checked);" /></center>
						</td>
						<td>

			<?php 
                if (!$front) {
                    $href = "index.php?option=" . JNEWS_OPTION . "&act=" . $action . "&task=show&userid=" . $subscriber->id;
                } else {
                    $link = "option=" . JNEWS_OPTION . "&act=" . $action . "&task=show&userid=" . $subscriber->id;
                    $href = jNews_Tools::completeLink($link, false, true);
                }
                ?>

						<a href=<?php 
                echo $href;
                ?>
 >
						<?php 
                echo $subscriber->name;
                ?>
</a>
						</td>
					<?php 
                if (!jNews_Subscribers::validEmail($subscriber->email)) {
                    $subscriber->email = '';
                }
                if ($mainframe->isAdmin()) {
                    ?>
						<td><?php 
                    echo $subscriber->email;
                    ?>
</td>
					<?php 
                } else {
                    if ($GLOBALS[JNEWS . 'show_sub_email']) {
                        ?>
							<td><?php 
                        echo $subscriber->email;
                        ?>
</td>
					<?php 
                    }
                }
                //endelse
                if ($mainframe->isAdmin()) {
                    ?>
						<td><div align="center">
						<?php 
                    echo date('D, d M Y H:i:s', jnews::getNow(0, true, $subscriber->subscribe_date));
                }
                ?>
					</div></td>
						<td align="center">
							<img src="<?php 
                echo JNEWS_PATH_ADMIN_IMAGES2 . $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
						</td>

						<td align="center">
							<a href="<?php 
                echo jnews::createToggleLink('subscribers', 'confirmed', 'subid', $subscriber->id, 'toggle', $listId);
                ?>
"> <img src="<?php 
                echo JNEWS_PATH_ADMIN_IMAGES2 . $imgC;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $altC;
                ?>
" /> </a>
						</td>
						<td align="center">
							<a href="<?php 
                echo jnews::createToggleLink('subscribers', 'receive_html', 'subid', $subscriber->id, 'toggle', $listId);
                ?>
"> <img src="<?php 
                echo JNEWS_PATH_ADMIN_IMAGES2 . $imgH;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $altH;
                ?>
" /> </a>
						</td>
						<?php 
                $i++;
                ?>
						<?php 
                if ($GLOBALS[JNEWS . 'level'] > 2) {
                    //check if the version of jnewsletter is 5.0.2
                    if ($GLOBALS[JNEWS . 'show_column1'] == 1) {
                        ?>
 <!--check to show/hide column 1 data in the subscribers list-->
							<td align="center"> <!--data for column1-->
								<?php 
                        echo $subscriber->column1;
                    }
                    ?>
							</td>
							<?php 
                    if ($GLOBALS[JNEWS . 'show_column2'] == 1) {
                        ?>
 <!--check to show/hide column 2 data in the subscribers list-->
							<td align="center"> <!--data for column1-->
								<?php 
                        echo $subscriber->column2;
                    }
                    ?>
							</td>
							<?php 
                    if ($GLOBALS[JNEWS . 'show_column3'] == 1) {
                        ?>
 <!--check to show/hide column 3 data in the subscribers list-->
							<td align="center"> <!--data for column3-->
								<?php 
                        echo $subscriber->column3;
                    }
                    ?>
							</td>
							<?php 
                    if ($GLOBALS[JNEWS . 'show_column4'] == 1) {
                        ?>
 <!--check to show/hide column 4 data in the subscribers list-->
							<td align="center"> <!--data for column4-->
								<?php 
                        echo $subscriber->column4;
                    }
                    ?>
							</td>
							<?php 
                    if ($GLOBALS[JNEWS . 'show_column5'] == 1) {
                        ?>
 <!--check to show/hide column 5 data in the subscribers list-->
							<td align="center"> <!--data for column5-->
								<?php 
                        echo $subscriber->column5;
                    }
                }
                //end check of version
                if (jnews::checkPermissions('admin')) {
                    echo '<td align="center">' . $subscriber->id . '</td>';
                }
                ?>
						</td>
					<?php 
            }
        }
        ?>
			</tr>
		</table>
		<input type="hidden" name="option" value="<?php 
        echo JNEWS_OPTION;
        ?>
" />
		<input type="hidden" name="act" value="<?php 
        echo $action;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="userid" value="" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $setSort->orderValue;
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $setSort->orderDir;
        ?>
" />
		<input type="hidden" id="boxcount" name="boxchecked" value="0" />
		<?php 
        if (version_compare(JVERSION, '3.0.0', '<')) {
            echo JHTML::_('form.token');
        } else {
            echo JHtml::_('form.token');
        }
        ?>
		</form>
		<?php 
        echo '<br />';
        echo jnews::setLegend();
    }
Пример #4
0
function jnewsbot_content_editab($forms)
{
    if (version_compare(JVERSION, '3.0.0', '<')) {
        JHTML::_('behavior.mootools');
    } else {
        JHtmlBehavior::framework();
    }
    $siteContent = new siteContent();
    //	$limit = -1;
    $limit = 5;
    $limittotal = $siteContent->countSiteCount();
    $setLimit = jnews::setLimitPagination($limittotal);
    $action = JRequest::getVar('act', '', '', 'WORD');
    $task = JRequest::getVar('task');
    $contentsearch = JRequest::getVar('contentsearch', '');
    echo $forms['main'];
    $hidden = '<input type="hidden" name="option" value="' . JNEWS_OPTION . '" />';
    $hidden .= '<input type="hidden" name="limit" value="' . $limit . '" />';
    $toSearch = new stdClass();
    $toSearch->forms = '';
    $toSearch->hidden = $hidden;
    $toSearch->listsearch = $contentsearch;
    $toSearch->id = 'contentsearch';
    $app = JFactory::getApplication();
    $setSort = new stdClass();
    if (!isset($_POST['c_filter_order'])) {
        $setSort->orderValue = "a.id";
    } else {
        $setSort->orderValue = $_POST['filter_order'];
    }
    //$setSort->orderValue = $app->getUserStateFromRequest(JNEWS_OPTION . '.content.filter_order', 'filter_order', 'a.id', 'cmd');
    $setSort->orderDir = $app->getUserStateFromRequest(JNEWS_OPTION . '.content.filter_order_Dir', 'filter_order_Dir', 'desc', 'word');
    //$setSort->orderValue  = "a.id";
    $contentItems = jnewsbot_content_getitems($contentsearch, $setLimit, $setSort);
    ob_start();
    $js = "function setContentTag(id, url, changeType , hide_title)\n           {\n\n                if(hide_title ==undefined)\n                {\n                    var check_title =  document.getElementById('hide_title_no').checked;\n                    if(check_title) hide_title = 0;\n                    else            hide_title = 1;\n\n                }\n\n\n\n                var form = document.adminForm;\n                if(!form)\n                {\n                        form = document.mosForm;\n                }\n\n                if(form.content_type[2].checked === false)\n                {\n                        document.getElementById('hide_title_yes').disabled=false;\n                }\n                else\n                {\n                      document.getElementById('hide_title_no').click();\n                      hide_title = 0;\n                      document.getElementById('hide_title_yes').disabled=true;\n                }\n                if(id!=null)\n                {\n                        for (i=0; i<form.content_type.length; i++)\n                        {\n                                if (form.content_type[i].checked)\n                                {\n                                        var content_type = form.content_type[i].value;\n                                }\n                        }";
    //   if ( @include_once( JNEWSPATH_ADMIN . 'social' .DS. 'class.social.php' ) ) {
    if (!$GLOBALS[JNEWS . 'use_tags'] and class_exists('jNews_Social') or !$GLOBALS[JNEWS . 'use_tags'] and $GLOBALS[JNEWS . 'level'] > 2) {
        $js .= "\n                            if(changeType!=null)\n                                id = document.getElementById('insertbot').value;\n\n                            template = window.top.document.getElementById('template_id');\n                            templateid = template.value;\n\n                            var tag =  id;\n                            if(id != 0)\n                                getContent(id, content_type, url,templateid);\n\n                            form.contenttag.value = tag;\n                    }\n                    //if id == null\n                    else\n                    {\n                            var tag = form.contentreplace.value;";
        if (version_compare(JVERSION, '1.6.0', '<')) {
            //1.5
            $js .= " if(window.top.insertTag(tag)){window.top.document.getElementById('sbox-window').close();}";
        } else {
            if (version_compare(JVERSION, '3.0.0', '<')) {
                $js .= ' if(window.top.insertTag(tag)) {window.parent.SqueezeBox.close();}';
            } else {
                $js .= 'if(window.top.insertTag(tag))
                                        {
                                            var need_click = jQuery(window.top.document).find("div.modal-backdrop");
                                            if(need_click.length == 0) window.parent.SqueezeBox.close();
                                            else    jQuery(window.top.document).find("div.modal-backdrop").click();}';
            }
        }
        $js .= "}\n                      }";
    } else {
        $js .= "\n                                if(changeType==null)\n                                        form.botID.value= id;\n\n                                var tag = '{contentitem:' + form.botID.value + '|' + content_type +'|'+hide_title+ '}';\n\n                                form.contenttag.value = tag;\n                    }\n                    //if id -- null\n                    else\n                    {\n\n                                var tag = form.contenttag.value;";
        if (version_compare(JVERSION, '1.6.0', '<')) {
            //1.5
            $js .= " if(window.top.insertTag(tag)){window.top.document.getElementById('sbox-window').close();}";
        } else {
            if (version_compare(JVERSION, '3.0.0', '<')) {
                $js .= ' if(window.top.insertTag(tag)) {window.parent.SqueezeBox.close();}';
            } else {
                $js .= ' if(window.top.insertTag(tag)) {
                                                var need_click = jQuery(window.top.document).find("div.modal-backdrop");
                                                if(need_click.length == 0) window.parent.SqueezeBox.close();
                                                else    jQuery(window.top.document).find("div.modal-backdrop").click();}';
            }
        }
        $js .= "}\n                            }";
    }
    //end function
    if (version_compare(JVERSION, '1.6.0', '<')) {
        //1.5
        $js .= "\n\n \t\t\tfunction getContent(id, content_type, url, templateid){\n\n \t\t\t\tvar ajax = new Ajax(url,\n \t\t\t\t\t{data: 'artId='+id+'&content_type='+content_type+'&templateid='+templateid,\n \t\t\t\t\tmethod: 'POST',\n \t\t\t\t\tonComplete : function(result){insertContent(result, id); }\n \t\t\t\t\t}\n \t\t\t\t);\n \t\t\t\tajax.request();\n \t\t\t}";
    } else {
        $js .= "\n \t\t\tfunction getContent(id, content_type, url,templateid){\n\n\t\t\t\tvar ajax = new Request({\n\t\t\t\turl : url,\n\t\t\t\tdata: 'artId='+id+'&content_type='+content_type+'&templateid='+templateid,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tonComplete : function(result){insertContent(result, id); }\n\t\t\t\t});\n\t\t\t\tajax.send();\n \t\t\t}";
    }
    $js .= "\n \t\t\tfunction insertContent(html, id){\n\t\t\t\tvar form = document.adminForm;\n\t\t\t\tif(!form){\n\t\t\t\t\tform = document.mosForm;\n\t\t\t\t}\n\n\t\t\t\tvar root = document.createElement('div');\n\n\t\t\t\troot.innerHTML = html;\n\t\t\t\tvar body = document.getElementsByTagName('body')[0].appendChild(root);\n\n\t\t\t\troot.setAttribute(\"style\", \"width:150px; display:none\");\n\t\t\t\tvar element = document.getElementById('artcontent_'+id);\n\n\t\t\t\tform.contentreplace.value = element.innerHTML;\n\n\t\t\t\tdocument.getElementsByTagName('body')[0].removeChild(root);\n\t\t\t}\n\t\t\t";
    $url = jNews_Tools::completeLink('option=' . JNEWS_OPTION . '&act=mailing&task=articleContent', false, false, true);
    $doc = JFactory::getDocument();
    $doc->addScriptDeclaration($js);
    ?>

    <style type="text/css">
        table.smartcontent {
            border: 1px solid #D5D5D5;
            background-color: #F6F6F6;
            width: 100%;
            margin-bottom: 10px;
            -moz-border-radius:3px;
            -webkit-border-radius:3px;
            padding: 5px;
        }
        table.smartcontent td.key {
            background-color: #f6f6f6;
            text-align: left;
            width: 140px;
            color: #666;
            font-weight: bold;
            border-bottom: 1px solid #e9e9e9;
            border-right: 1px solid #e9e9e9;
        }
    </style>
    <div id="element-box">
        <div class="t">
            <div class="t">
                <div class="t"></div>
            </div>
        </div>
        <div class="m">




    <!--<form name="adminForm" method="post" action="index.php?option=<?php 
    echo JNEWS_OPTION;
    ?>
&tmpl=component">-->
            <table class="smartcontent" width="100%"">
                   <tr>
                    <td width="185" class="key">
                        <span class="editlinktip">
                            <?php 
    $tip = _JNEWS_AUTONEWS_TYPE_TIPS;
    $title = _JNEWS_AUTONEWS_TYPE;
    echo jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0);
    ?>
                        </span>
                    </td>
                    <td style="vertical-align: top;">
                        <span class="editlinktip">
    <?php 
    $tip = _JNEWS_TITLE_ONLY_TIPS;
    $title = _JNEWS_TITLE_ONLY;
    $title_only = "<span class=\"editlinktip\">" . jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0) . "</span>";
    $tip = _JNEWS_INTRO_ONLY_TIPS;
    $title = _JNEWS_INTRO_ONLY;
    $intro_only = "<span class=\"editlinktip\">" . jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0) . "</span>";
    $tip = _JNEWS_FULL_ARTICLE_TIPS;
    $title = _JNEWS_FULL_ARTICLE;
    $full_article = "<span class=\"editlinktip\">" . jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0) . "</span>";
    //                                $tip =  _JNEWS_HIDE_TITTLE_ARTICLE_TIPS;
    //				$title =  _JNEWS_HIDE_TITLE ;
    //				$hide_title = "<span class=\"editlinktip\">" . jNews_Tools::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 ) . "</span>";
    ?>
                        </span>
                        <span class="editlinktip">
                            <input id="content_type" type="radio" name="content_type" value="0" checked="checked" onclick="setContentTag(1,'<?php 
    echo $url;
    ?>
', 0);"/><?php 
    echo $full_article;
    ?>
                            <input id="content_type" type="radio" name="content_type" value="1" onclick="setContentTag(1, '<?php 
    echo $url;
    ?>
', 1);"/><?php 
    echo $intro_only;
    ?>
                            <input id="content_type" type="radio" name="content_type" value="2" onclick="setContentTag(1, '<?php 
    echo $url;
    ?>
', 2);"/><?php 
    echo $title_only;
    ?>
                            <!--<input id="content_type" type="radio" name="content_type" value="3" onclick="setContentTag(1, '<?php 
    //echo $url
    ?>
', 3);"/><?php 
    //echo $hide_title;
    ?>
-->
                        </span>

                    </td>
                    <td rowspan="2">
                        <input onclick="setContentTag(null,'<?php 
    echo $url;
    ?>
')" class="inserttag" type="button" label="Insert Content" name="Insert Content" value="Insert Content"/>
                    </td>
                </tr>

                <tr>
                    <td width="185" class="key">
                        <span class="editlinktip">
    <?php 
    $tip = _JNEWS_CONTENT_TIP;
    $title = _JNEWS_CONTENT_ID;
    echo jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0);
    ?>
                        </span>
                    </td>
                    <td style="vertical-align: top;">
                                    <!--  <input type="text" onchange="setCaptionTags();" size="60px" name="jnewstagcaption"> -->
                        <input id="insertbot" type="text" size="20px" name="contenttag" value="0"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input id="insertbot" type="hidden" size="60px" name="contentreplace" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input id="botID" size="10px" name="botID" value="0" type="hidden"/>
                    </td>
                </tr>


                <tr>
                    <td width="185" class="key">
                        <span class="editlinktip">
                    <?php 
    $tip = _JNEWS_HIDE_TITTLE_ARTICLE_TIPS;
    $title = _JNEWS_HIDE_TITLE;
    echo jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0);
    ?>
                        </span>
                    </td>
                    <td style="vertical-align: top;">
                        <input id="hide_title_no" onclick="setContentTag(1, '<?php 
    echo $url;
    ?>
', 2, 0);" type="radio" name="hide_title" value="0" checked="checked" /><?php 
    echo 'No';
    ?>
                        <input id="hide_title_yes" onclick="setContentTag(1, '<?php 
    echo $url;
    ?>
', 2, 1);" type="radio" name="hide_title" value="1" /><?php 
    echo 'Yes';
    ?>

                    </td>
                </tr>
            </table>
            <div id="element-box">
                <div class="t">
                    <div class="t">
                        <div class="t"></div>
                    </div>
                </div>
                <div class="m" style="position:relative;">
                                    <?php 
    echo jnews::setTop($toSearch, null);
    $select_cat = version_compare(JVERSION, '1.6.0', '<') ? 'SELECT CATEGORY' : 'JOPTION_SELECT_CATEGORY';
    ?>
                    <div style="position:absolute;top:5px; left:55%;">
                    <?php 
    $sort_select = JRequest::getVar('filter_category_id', '', 'POST', 'int');
    ?>
                        <select name="filter_category_id" class="inputbox" onchange="this.form.submit()">
                            <option value=""><?php 
    echo JText::_($select_cat);
    ?>
</option>
                            <?php 
    if (version_compare(JVERSION, '1.6.0', '<')) {
        echo getCatListFromJoomla15($sort_select);
    } else {
        echo JHtml::_('select.options', JHtml::_('category.options', 'com_content'), 'value', 'text', $sort_select);
    }
    ?>
                        </select>
                    </div>
<!--                          border: 1px solid #CCCCCC;-->
                    <table class="joobilist" cellpadding="0" cellspacing="0">
                        <tbody>
                        <thead>
                            <tr>
                                <th class="title">
                                      <?php 
    if ($setSort->orderDir == 'asc') {
        $new_sort = "desc";
    } else {
        $new_sort = "asc";
    }
    ?>
                                                <a class="hasTip" title="" onclick="Joomla.tableOrdering('a.title','<?php 
    echo $new_sort;
    ?>
', 'content');" href="#">
                                                    <?php 
    echo JText::_(_JNEWS_TAGPICKLIST_TITLE);
    ?>
                                                    <?php 
    if ($setSort->orderValue == 'a.title') {
        ?>
<i class="icon-arrow-<?php 
        echo $new_sort == "asc" ? "up" : "down";
        ?>
"></i><?php 
    }
    ?>
                                                </a>
    <?php 
    //echo _JNEWS_TAGPICKLIST_TITLE;
    // echo jnews::HTML_GridSort(_JNEWS_TAGPICKLIST_TITLE, 'a.title', $setSort->orderDir, $setSort->orderValue);
    ?>
                                </th>
                                <th width="80px" class="title">
                        <?php 
    //echo _JNEWS_TAG_ARTICLESECTION;
    if (version_compare(JVERSION, '1.6.0', '<')) {
        //j15
        echo jnews::HTML_GridSort(_JNEWS_TAG_ARTICLESECTION, 'b.title', $setSort->orderDir, $setSort->orderValue);
    } else {
        ?>

                              <?php 
        if ($setSort->orderDir == 'asc') {
            $new_sort = "desc";
        } else {
            $new_sort = "asc";
        }
        ?>
                                    <a class="hasTip" title="" onclick="Joomla.tableOrdering('c.title_2','<?php 
        echo $new_sort;
        ?>
', 'content');" href="#">
                                        <?php 
        echo JText::_(_JNEWS_TAG_ARTICLESECTION);
        ?>
                                         <?php 
        if ($setSort->orderValue == 'c.title_2') {
            ?>
<i class="icon-arrow-<?php 
            echo $new_sort == "asc" ? "up" : "down";
            ?>
"></i><?php 
        }
        ?>
                                    </a>

<!--                            echo jnews::HTML_GridSort(_JNEWS_TAG_ARTICLESECTION, 'b.title', $setSort->orderDir, $setSort->orderValue);-->
                        <?php 
    }
    ?>
                                </th>
                                <th width="80px" class="title">
                                <?php 
    if ($setSort->orderDir == 'asc') {
        $new_sort = "desc";
    } else {
        $new_sort = "asc";
    }
    ?>
                                    <a class="hasTip" title="" onclick="Joomla.tableOrdering('c.title','<?php 
    echo $new_sort;
    ?>
', 'content');" href="#">
                                        <?php 
    echo JText::_(_JNEWS_TAG_ARTICLECATEGORY);
    ?>
                                         <?php 
    if ($setSort->orderValue == 'c.title') {
        ?>
<i class="icon-arrow-<?php 
        echo $new_sort == "asc" ? "up" : "down";
        ?>
"></i><?php 
    }
    ?>
                                    </a>
                    <?php 
    //echo _JNEWS_TAG_ARTICLECATEGORY;
    // echo jnews::HTML_GridSort(_JNEWS_TAG_ARTICLECATEGORY, 'c.title', $setSort->orderDir, $setSort->orderValue);
    ?>
                                </th>
                                <th width="30px" class="title">
                                    <?php 
    if ($setSort->orderDir == 'asc') {
        $new_sort = "desc";
    } else {
        $new_sort = "asc";
    }
    ?>
                                        <a class="hasTip" title="" onclick="Joomla.tableOrdering('a.id','<?php 
    echo $new_sort;
    ?>
', 'content');" href="#">
                                            ID
                                             <?php 
    if ($setSort->orderValue == 'a.id') {
        ?>
<i class="icon-arrow-<?php 
        echo $new_sort == "asc" ? "up" : "down";
        ?>
"></i><?php 
    }
    ?>
                                        </a>
                                        <?php 
    //echo jnews::HTML_GridSort('ID', 'a.id', $setSort->orderDir, $setSort->orderValue, 'task');
    ?>
                                </th>
                            </tr>
                        </thead>
    <?php 
    if (sizeof($contentItems) > 0) {
        $k = 0;
        foreach ($contentItems as $contentItem) {
            if (empty($contentItem->section)) {
                $contentItem->section = JText::_('Uncategorised');
            }
            if (empty($contentItem->category)) {
                $contentItem->category = JText::_('Uncategorised');
            }
            echo '<tr style="cursor:pointer" class="row' . $k . '" onclick="setContentTag(\'' . $contentItem->id . '\',\'' . $url . '\');" ><td>' . $contentItem->title . '</td><td nowrap="nowrap" align="center">' . $contentItem->section . '</td><td nowrap="nowrap" align="center">' . $contentItem->category . '</td><td nowrap="nowrap" align="center">' . $contentItem->id . '</td></tr>';
            //echo '<tr style="cursor:pointer" class="row'.$k.'" onclick="setContentTag(\''.$contentItem->id.'\',\''.$url.'\');" ><td>'.$contentItem->title.'</td><td nowrap="nowrap" align="center">'.$contentItem->section.'</td><td nowrap="nowrap" align="center">'.$contentItem->category.'</td><td nowrap="nowrap" align="center">'.$contentItem->id.'</td></tr>';
            $k = 1 - $k;
        }
    }
    ?>
                        </tbody>
                    </table>
    <?php 
    echo jnews::setPaginationBot($setLimit, 'margin:auto;');
    ?>
                    <input type="hidden" value="<?php 
    echo JNEWS_OPTION;
    ?>
" name="option"/>
                    <input type="hidden" value="<?php 
    echo $action;
    ?>
" name="act"/>
                    <input type="hidden" value="<?php 
    echo $task;
    ?>
" name="task"/>
                    <input type="hidden" value="<?php 
    echo $setSort->orderValue;
    ?>
" name="c_filter_order"/>
                    <input type="hidden" value="<?php 
    echo $setSort->orderValue;
    ?>
" name="filter_order"/>
                    <input type="hidden" value="<?php 
    echo $setSort->orderDir;
    ?>
" name="filter_order_Dir"/>
                    </form>
                </div>
                <div class="b">
                    <div class="b">
                        <div class="b"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="b">
            <div class="b">
                <div class="b"></div>
            </div>
        </div>
    </div>
    <?php 
    $return = ob_get_contents();
    ob_end_clean();
    return array(_JNEWS_CONTENT_ITEM, $return);
}
Пример #5
0
    public static function displayTemplateList($templates, $forms, $start, $limit, $templatesearch, $action, $setLimit = null, $setSort = null)
    {
        $hidden = '<input type="hidden" name="option" value="' . JNEWS_OPTION . '" />';
        $hidden .= '<input type="hidden" name="limit" value="' . $limit . '" />';
        echo $forms['main'];
        // for search
        $toSearch = new stdClass();
        $toSearch->forms = $forms['filter'];
        $toSearch->hidden = $hidden;
        $toSearch->listsearch = $templatesearch;
        $toSearch->id = 'templatesearch';
        echo jnews::setTop($toSearch, null, $setLimit);
        ?>
         
                <?php 
        //echo $forms['main'];
        ?>
		<script language="javascript" type="text/javascript">
		//<!--
		function jnewsletterselectall(){
			var i = 0;
			allcheck = document.getElementById("selectallcheck");
			if(allcheck.checked) checkedvalue = 1;
			else checkedvalue = 0;
	
			while(myelement = document.getElementById("cid["+i+"]")){
				myelement.checked = checkedvalue;
				i++;
			}
	
			if(checkedvalue){
				document.getElementById("boxcount").value = i;
			}else{
				document.getElementById("boxcount").value = 0;
			}
		}
		//-->
		</script>		
		
		<table class="<?php 
        echo jnews::myTheme();
        ?>
">
			<thead>
				<tr>
					<th width="2%" class="title">#</th>
					<th class="title"><input type="checkbox" id="selectallcheck" name="allchecked" onclick="jnewsletterselectall();"/></th>
					<th width="12%" class="title">
					<?php 
        echo _JNEWS_TEMPLATE_IMG;
        ?>
					</th>
					<th width="65%" class="title"><?php 
        echo jnews::HTML_GridSort(_JNEWS_TEMPLATE_DESC, 'description', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
					<th width="65%" class="title"><?php 
        echo jnews::HTML_GridSort(_JNEWS_TEMPLATE_AVLB, 'availability', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
					<th width="3%" class="title"><?php 
        echo jnews::HTML_GridSort(_JNEWS_TEMPLATE_DEFAULT, 'premium', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
					<th width="3%" class="title"><?php 
        echo jnews::HTML_GridSort(_JNEWS_TEMPLATE_PUBLISH, 'published', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
					<th width="2%" class="title"><?php 
        echo jnews::HTML_GridSort('ID', 'template_id', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				</tr>
			</thead>
<!--			</form>-->
			<?php 
        $i = $start;
        if (!empty($templates)) {
            if (version_compare(JVERSION, '3.0.0', '<')) {
                $onClickFct = '';
            } else {
                $onClickFct = 'Joomla.';
            }
            foreach ($templates as $template) {
                ?>
				<tr class="row<?php 
                echo ($i + 1) % 2;
                ?>
">
					<td><center><?php 
                echo $i + 1;
                ?>
</center></td>

					<td align="center"><center><input type="checkbox" id="cid[<?php 
                echo $i;
                ?>
]" name="cid[<?php 
                echo $i;
                ?>
]" value="<?php 
                echo $template->template_id;
                ?>
" onclick="<?php 
                echo $onClickFct;
                ?>
isChecked(this.checked);" /></center></td>					
					<td align="center">
						<span class="editlinktip">
							<?php 
                if (empty($template->thumbnail)) {
                    $path = JNEWS_PATH_ADMIN_THUMBNAIL_SHOW . 'sample-image.png';
                    echo '<a class="modal" href="' . $path . '">' . jnews::imageResize($path, '100', '100', $template->name) . '</a>';
                }
                $tmblfile = substr($template->thumbnail, 59);
                $popmainpath = substr($template->thumbnail, 0, -25);
                $filename = explode('_', $tmblfile);
                if (strpos($filename[0], 'entwine') !== false) {
                    $filenamecolor = explode('.', $filename[1]);
                    $popimgpath = 'http://www.joobi.co/images/newsletter_templates/' . $filename[0] . '/' . $filenamecolor[0] . '/' . $tmblfile;
                } else {
                    $popimgpath = 'http://www.joobi.co/images/newsletter_templates/' . $filename[0] . '/' . $tmblfile;
                }
                $findposhttp = strpos($template->thumbnail, 'http://');
                $findposwww = strpos($template->thumbnail, 'www.');
                if ($findposhttp === false || $findposwww === false) {
                    //$link = JNEWS_PATH_ADMIN_THUMBNAIL_SHOW. $template->thumbnail;
                    $link = $template->thumbnail;
                    echo '<a class="modal" href="' . $link . '">' . jnews::imageResize($link, '100', '100', $template->name) . '</a>';
                } else {
                    $link = $template->thumbnail;
                    echo '<a class="modal" href="' . $popimgpath . '"><img src="' . $template->thumbnail . '" alt="' . $template->name . '"></a>';
                }
                ?>
						</span>
					</td>
					<td><?php 
                $link = JNEWS_JPATH_LIVE . '/administrator/index.php?option=' . JNEWS_OPTION . '&act=templates&task=edit&template_id=' . $template->template_id;
                echo '<div style="color:#4f7e11;"><a href="' . $link . '">' . $template->name . '</a></div><br><div style="text-indent:20px"> ' . $template->description . '</div>';
                ?>
</td>
					<td align="center"><?php 
                if ($template->availability == 1) {
                    echo _JNEWS_TEMPLATE_INS;
                }
                if ($template->availability == 0) {
                    $namekey = explode('_', $template->namekey);
                    $link = 'http://www.joobi.co/index.php?option=com_jlinks&controller=redirect&link=newsletter_template_' . $namekey[0];
                    echo '<a href="' . $link . '">' . _JNEWS_TEMPLATE_DWN . '</a>';
                }
                if ($template->availability == -1) {
                    $link = 'http://www.joobi.co/index.php?option=com_jlinks&controller=redirect&link=newsletter_template_' . $template->namekey;
                    echo '<a href="' . $link . '">' . _JNEWS_TEMPLATE_FDWN . '</a>';
                }
                ?>
</td>
					<td align="center">
						<?php 
                if ($template->premium) {
                    echo '<img src="' . JNEWS_PATH_ADMIN_IMAGES2 . '16/default.png" title="Default" alt="Default">';
                    jnews::getLegend('default.png', _JNEWS_TEMPLATE_DEFAULT);
                } else {
                    $status = !empty($template->premium) && $template->premium == 1 ? '' : 'default';
                    $link = jnews::createToggleLink('templates', $status, 'template_id', $template->template_id, 'togle');
                    echo '<a href="' . $link . '"> <b>-</b> </a>';
                }
                ?>
					</td>
					<td align="center">
						 <?php 
                //for publish/unpublish
                if ($template->published == 1) {
                    $img = '16/status_g.png';
                    $alt = 'Published';
                    jnews::getLegend('status_g.png', _JNEWS_TEMPLATE_PUBLISH);
                } else {
                    $img = '16/status_r.png';
                    $alt = 'Unpublished';
                    jnews::getLegend('status_r.png', _JNEWS_UNPUBLISHED);
                }
                if ($template->premium) {
                    echo '<img src="' . JNEWS_PATH_ADMIN_IMAGES2 . $img . '" alt="' . $alt . '" title="' . $alt . '">';
                } else {
                    $status = !empty($template->published) && $template->published == 1 ? 'unpublish' : 'publish';
                    $link = jnews::createToggleLink('templates', $status, 'template_id', $template->template_id, 'togle');
                    echo '<a href="' . $link . '"> <img src="' . JNEWS_PATH_ADMIN_IMAGES2 . $img . '" alt="' . $alt . '" title="' . $alt . '"> </a>';
                }
                ?>
					</td>
					<td align="center"><?php 
                echo $template->template_id;
                ?>
</td>
				</tr>
			<?php 
                $i = $i + 1;
            }
        }
        ?>
		</table>
<!--                </form>-->
		<?php 
        echo '<br />';
        echo jnews::setLegend();
    }
Пример #6
0
    public static function showMailingQueue($mailingq = null, $lists = null, $form, $start, $limit, $mailingsearch, $setLimit = null, $setSort = null)
    {
        $listId = null;
        ?>

		<script language="javascript" type="text/javascript">
		<!--
			function jnewsselectall(){
				var i = 0;
				allcheck = document.getElementById("selectallcheck");
				if(allcheck.checked) checkedvalue = 1;
				else checkedvalue = 0;

				while(myelement = document.getElementById("cid["+i+"]")){
					myelement.checked = checkedvalue;
					i++;
				}

				if(checkedvalue){
					document.getElementById("boxcount").value = i;
				}else{
					document.getElementById("boxcount").value = 0;
				}
			}

		 //-->
		</script>
		<?php 
        if (empty($mailingq)) {
            echo '<center>' . jnews::printYN(true, _JNEWS_Q_M1, _JNEWS_ERROR) . '</center>';
        }
        if ($listId == 0) {
            $message = _JNEWS_MESSAGE_QUEUE;
        } else {
            $lt_name = jNews_Lists::getLists($listId, 0, null, '', false, false, true, false, false, '');
            $message = _JNEWS_SUSCRIB_LIST_UNIQUE . "<span style='color: rgb(51, 51, 51);'>" . @$lt_name[0]->list_name . "</span>";
        }
        if (!isset($action)) {
            $action = JRequest::getVar('act', '', '', 'WORD');
        }
        $mySepList = array();
        $mySepList[0] = new stdClass();
        $mySepList[0]->subject = 'All Mailings';
        $mySepList[0]->id = 0;
        $myMailingQueA = jNews_Mailing::getMailingsForQueue();
        if (empty($myMailingQueA) || !is_array($myMailingQueA)) {
            $myMailingQueA = array();
        }
        $lt = array_merge($mySepList, $myMailingQueA);
        $mailingId = JREquest::getVar('mailingid', '');
        $dropDown = jnews::HTML_GenericList($lt, 'mailingid', '' . 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'id', 'subject', $mailingId);
        $filter = _JNEWS_FILTER_MAILING . $dropDown;
        $hidden = '<input type="hidden" name="option" value="' . JNEWS_OPTION . '" />';
        $hidden .= '<input type="hidden" name="act" value="' . $action . '" />';
        $hidden .= '<input type="hidden" name="limit" value="' . $limit . '" />';
        ?>

	<?php 
        echo $form['main'];
        if ($form['main'] !== "") {
            $form['select'] = "";
        }
        // top portion before the table list
        // for search
        $toSearch = new stdClass();
        $toSearch->forms = $form['select'];
        $toSearch->hidden = $hidden;
        $toSearch->listsearch = $mailingsearch;
        $toSearch->id = 'mailingsearch';
        echo jnews::setTop($toSearch, $message, $setLimit, $filter);
        ?>
		<table class="<?php 
        echo jnews::myTheme();
        ?>
">
			<thead><tr>
				<th width="2%" class="title">#</th>
				<th width="2%" class="title"><input type="checkbox" id="selectallcheck" name="allchecked" onclick="jnewsselectall();"></th>
				<th width="22%" class="title"><?php 
        echo jnews::HTML_GridSort(_JNEWS_QUEUE_SUBJECT, 'm.subject', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				<th width="22%" class="title"><?php 
        echo jnews::HTML_GridSort(_JNEWS_QUEUE_EMAIL, 's.email', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				<th width="22%" class="title"><?php 
        echo jnews::HTML_GridSort(_JNEWS_SENDDATE, 'q.send_date', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				<th width="3%" class="title"><center><?php 
        echo jnews::HTML_GridSort(_JNEWS_QUEUE_PRIOR, 'q.priority', $setSort->orderDir, $setSort->orderValue);
        ?>
</center></th>
				<th width="2%" class="title"><center><?php 
        echo jnews::HTML_GridSort(_JNEWS_QUEUE_ATT, 'q.attempt', $setSort->orderDir, $setSort->orderValue);
        ?>
</center></th>
				<th width="3%" class="title"><?php 
        echo jnews::HTML_GridSort('Suspend', 'q.suspend', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				<th width="3%" class="title"><?php 
        echo jnews::HTML_GridSort('Blocked', 'q.block', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				<th width="3%" class="title"><?php 
        echo jnews::HTML_GridSort('ID', 'q.qid', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
			</thead></tr>
			<?php 
        $i = $start;
        jNews_QueueHTML::_displayQueue($mailingq, $i);
        ?>
		</table>
		<?php 
        echo '<br />';
        echo jnews::setLegend();
    }