Пример #1
0
    public static function lists($mailingEdit, $list, $show, $lType, $arId, $indicate = false, $isEdit = false)
    {
        $mainframe = JFactory::getApplication();
        if (!isset($mailingEdit)) {
            $mailingEdit = new stdClass();
        }
        $listType = JRequest::getVar('listype');
        if (!isset($mailingEdit->list_type)) {
            $mySess = JFactory::getSession();
            if (!empty($mySess)) {
                $mailingEdit->list_type = $mySess->get('listype', '', 'LType');
            }
        }
        $listType = !empty($listType) ? $listType : $mailingEdit->list_type;
        $typeList = !empty($listType) && $listType == 2 ? 2 : 1;
        ?>
	<div style="padding: 2px;"><span style="font-size: 12px;"><?php 
        if ($lType != 2) {
            //echo _JNEWS_SUBS_LIST;
            //}else{
            if ($typeList == 2) {
                echo _JNEWS_SUBS_LIST_CAMPAIGN;
            } else {
                echo _JNEWS_SUBS_LIST_LABEL;
            }
            //edif
        }
        ?>
</span></div>
	<table class="<?php 
        echo jnews::myTheme();
        ?>
">
		<thead>
				<tr>
					<th class="title">
						#
					</th>
					<th class="title">
						<?php 
        echo _JNEWS_LIST_NAME;
        ?>
					</th>
					<th class="title" style="min-width:200px;">
						<?php 
        echo _JNEWS_SUBS_LIST_RECEIVE;
        ?>
					</th>
				</tr>
		</thead>
		<tbody>

		<?php 
        $my = JFactory::getUser();
        $ownedlists = 0;
        if ($GLOBALS[JNEWS . 'enable_jsub']) {
            $ownedlists = jNews_Lists::getOwnedlists($my->id);
        }
        if (jnews::checkPermissions('admin')) {
            if ($lType == 2) {
                $lists = jNews_Lists::getLists('', 1, '', '', false, true, true, false, false);
            } else {
                $lists = jNews_Lists::getLists('', $typeList, '', '', false, true, true, false, false);
            }
        } else {
            if ($lType == 2) {
                $lists = jNews_Lists::getLists('', 1, '', '', false, true, true, false, false, '', '', $ownedlists, $my->id);
            } else {
                $lists = jNews_Lists::getLists('', $typeList, '', '', false, true, true, false, false, '', '', $ownedlists, $my->id);
            }
        }
        $k = 0;
        $i = 0;
        //$listId=JRequest::getVar('listId');
        if (empty($listId)) {
            $listId = JRequest::getVar('listid');
        }
        $ls = array();
        $myKey = null;
        foreach ($lists as $key => $list) {
            if ($list->id == $listId) {
                $myKey = $key;
                break;
            }
        }
        if (isset($myKey)) {
            $ls[] = $lists[$myKey];
            unset($lists[$myKey]);
            $lists = array_merge($ls, $lists);
        }
        $listsA = array();
        if (!$mainframe->isAdmin()) {
            foreach ($lists as $list) {
                if (empty($list->params)) {
                    $listsA[] = $list;
                }
            }
        } else {
            $listsA = $lists;
        }
        foreach ($listsA as $list) {
            ?>
				<tr class="<?php 
            echo "row{$k}";
            ?>
">
					<td width="5%">
						<center>
							<?php 
            echo $i + 1;
            ?>
					 	</center>
					</td>
					<td>
						<?php 
            $getMailingId = !empty($mailingEdit->id) ? $mailingEdit->id : JRequest::getVar('mailingid');
            $result = jNews_Mailing::mailingListFound($getMailingId, $list->id);
            $result = $result ? 1 : 0;
            if ($result == 0) {
                $lstID = JRequest::getVar('listid');
                $result = $lstID == $list->id ? 1 : 0;
            }
            //check if this view will be displayed upon the creation of new list
            if ($lType == 2) {
                $result = jNews_Lists::followupListFound($arId, $list->id);
            }
            //public static function booleanlist( $name, $attribs = null, $selected = null, $yes='yes', $no='no', $id=false )
            $text = '<b>List ID: </b>' . $list->id;
            $text .= '<br/>' . str_replace(array("'", '"'), array("&#039;", '&quot;'), $list->list_desc);
            $title = str_replace(array("'", '"'), array("&#039;", '&quot;'), $list->list_name);
            //echo jNews_Tools::toolTip( $tip, '', 280, 'tooltip.png',  $title, '', 0 );
            echo JHTML::_('tooltip', $text, $title, 'tooltip.png', $title);
            ?>
					</td>
					<td  width="100px" nowrap="nowrap">
						<center>
							<?php 
            //if the listid in the request is equal to this listid the default value of the radio button should be yes
            if ($listId == $list->id) {
                echo jnews::HTML_BooleanList("aca_mailing_addto[" . $list->id . "]", 'class="inputbox"', 1, 'Yes', 'No');
            } else {
                echo jnews::HTML_BooleanList("aca_mailing_addto[" . $list->id . "]", 'class="inputbox"', $result, 'Yes', 'No');
            }
            ?>
						</center>
					</td>
				</tr>
			<?php 
            $k = 1 - $k;
            $i++;
        }
        if (count($lists > 3)) {
            ?>
				<tr>
					<td colspan="3" align="center" nowrap="nowrap">
						<script language="javascript" type="text/javascript">
							function updateStatus(statusval){
								<?php 
            foreach ($lists as $row) {
                ?>
								window.document.getElementById('aca_mailing_addto[<?php 
                echo $row->id;
                ?>
]'+statusval).checked = true;
								<?php 
            }
            ?>
							}
						</script>
						<div style="float:right; font-size: 12px;"><a title="Click to select all list" href="#" onclick="updateStatus(1);"><?php 
            echo _JNEWS_SUBS_LIST_TOALL;
            ?>
</a> | <a href="#" onclick="updateStatus(0);"><?php 
            echo _JNEWS_SUBS_LIST_TONONE;
            ?>
</a></div>
					</td>
				</tr>
			<?php 
        }
        ?>
		</tbody>
	</table>
		<?php 
    }
Пример #2
0
function jnewsbot_k2_editab()
{
    $limit = 5;
    $limittotal = countK2Items();
    $setLimitk2 = jnews::setLimitPagination($limittotal);
    $task = JRequest::getVar('task');
    //filter
    if (isset($_POST['contentsearchk2'])) {
        $contentsearch = JRequest::getVar('contentsearchk2', 'post', '', 'string');
    } else {
        $contentsearch = "";
    }
    $toSearch = new stdClass();
    $toSearch->forms = '';
    //$toSearch->hidden = $hidden;
    $toSearch->listsearch = $contentsearch;
    $toSearch->id = 'contentsearchk2';
    $app = JFactory::getApplication();
    $setSortk2 = new stdClass();
    if (!isset($_POST['k2_filter_order'])) {
        $setSortk2->orderValue = "a.id";
    } else {
        $setSortk2->orderValue = $_POST['filter_order'];
    }
    $setSortk2->orderDir = $app->getUserStateFromRequest(JNEWS_OPTION . '.k2content.filter_order_Dir', 'filter_order_Dir', 'desc', 'word');
    $sort_select = JRequest::getVar('filter_category_id_k2', '', 'POST', 'int');
    $k2contentitems = jnewsbot_k2_getitems($contentsearch, $setLimitk2, $setSortk2, $sort_select);
    ob_start();
    $js = "var id_global, content_type, hide_title_global;\n            function setContentTag(id, hide_title_or_rendering)\n            {\n                if(id != null) {\n\n                    if(document.getElementById('for_disabled').checked === false)\n                    {\n                         document.getElementById('hide_title_yes').disabled=false;\n                    }\n\n                    if(hide_title_or_rendering ==undefined && hide_title_global == undefined)\n                    {\n                         hide_title_global = 0;\n                    }\n                    if(hide_title_or_rendering ==undefined && content_type == undefined)\n                    {\n                        content_type = 0;\n                    }\n                    if(id ==='rendering')\n                    {\n                        content_type = hide_title_or_rendering;\n                        if(id_global == undefined)  id_global = 0;\n                        if(hide_title_global == undefined) hide_title_global = 0;\n                        if(hide_title_or_rendering == 2)\n                        {\n                           // hide_title_global = 0;\n                            document.getElementById('hide_title_no').click();\n                            document.getElementById('hide_title_yes').disabled=true;\n\n                        }\n                    }\n                    if(id == 'hide_title')\n                    {\n                        hide_title_global = hide_title_or_rendering;\n                        if(id_global == undefined) id_global = 0;\n                        if(content_type == undefined) content_type = 0;\n                    }\n                    if( id % 1 === 0)\n                    {\n                        id_global = id;\n                        if(content_type == undefined) content_type = 0;\n                        if(hide_title_global == undefined) hide_title_global = 0;\n                    }\n\n                    var form = document.adminForm;\n                    if(!form){\n                            form = document.mosForm;\n                    }\n                    var tag = '{k2item:' + id_global + '|' + content_type +'|'+hide_title_global+ '}';\n                    form.k2tag.value = tag;\n\n                }\n                else\n                {           var form = document.adminForm;\n                            if(!form){\n                                    form = document.mosForm;\n                            }\n                            var tag = form.k2tag.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\t}";
    //if(window.top.insertTag(tag)){window.top.document.getElementById('sbox-window').close();}
    $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 id="adminForm" name="adminForm" method="post" action="index.php?option=<?php 
    echo JNEWS_OPTION;
    ?>
&tmpl=component&act=tags&task=k2content">



<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>";
    ?>
</span>
<span class="editlinktip">
    <input type="radio" onclick="setContentTag('rendering', 0)" name="content_type" value="0" checked="checked" /><?php 
    echo $full_article;
    ?>
    <input type="radio"  onclick="setContentTag('rendering', 1)" name="content_type" value="1" /><?php 
    echo $intro_only;
    ?>
    <input id="for_disabled" type="radio" onclick="setContentTag('rendering', 2)" name="content_type" value="2" /><?php 
    echo $title_only;
    ?>
</span>

</td>
<td rowspan="2">
        <input onclick="setContentTag(null)" class="inserttag" type="button" label="Insert Tag" name="Insert Tag" value="<?php 
    echo _JNEWS_TAG_INSERT_TAG;
    ?>
"/>
</td>
</tr>

<tr>
	<td width="185" class="key">
		<span class="editlinktip">
			Tag
		</span>
	</td>
	<td style="vertical-align: top;">
		<!-- 	<input type="text" onchange="setCaptionTags();" size="60px" name="jnewstagcaption"> -->
			<input type="text" size="60px" name="k2tag">
	</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;">
            <span class="hide_title" >
                <input id="hide_title_no" onclick="setContentTag('hide_title', 0);" type="radio" name="hide_title" value="0" checked="checked" /><?php 
    echo 'No';
    ?>
                <input id="hide_title_yes" onclick="setContentTag('hide_title', 1);" type="radio" name="hide_title" value="1" /><?php 
    echo 'Yes';
    ?>
            </span>
        </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;">


    <input type="hidden" name="option" value="<?php 
    echo JNEWS_OPTION;
    ?>
" />
    <input type="hidden" name="limit" value="<?php 
    echo $limit;
    ?>
" />
<!--////////////////////////////////////////////////////-->
        <?php 
    echo jnews::setTop($toSearch, null);
    $category_list_k2 = getAllCategoriesK2();
    ?>
        <div style="position:absolute;top:5px; left:55%;">
            <select name="filter_category_id_k2" class="inputbox" onchange="this.form.submit()">
                <option value=""><?php 
    echo JText::_('JOPTION_SELECT_CATEGORY');
    ?>
</option>
                <?php 
    for ($i = 0; $i < count($category_list_k2); $i++) {
        ?>
                <option value="<?php 
        echo $category_list_k2[$i]->id;
        ?>
"  <?php 
        if ($sort_select == $category_list_k2[$i]->id) {
            echo "selected";
        }
        ?>
>
                    <?php 
        echo $category_list_k2[$i]->name;
        ?>
                </option>
               <?php 
    }
    ?>
            </select>
        </div>
        <table class="<?php 
    echo jnews::myTheme();
    ?>
" cellpadding="0" cellspacing="0">
            <tbody>
                <thead>
                    <tr>
                        <th width="80px" class="title">
                                <?php 
    if ($setSortk2->orderDir == 'asc') {
        $new_sort = "desc";
    } else {
        $new_sort = "asc";
    }
    ?>
                                    <a class="hasTip" title="" onclick="Joomla.tableOrdering('a.title','<?php 
    echo $new_sort;
    ?>
', 'k2content');" href="#">
                                       <?php 
    echo _JNEWS_TAGPICKLIST_TITLE;
    ?>
                                         <?php 
    if ($setSortk2->orderValue == 'a.title') {
        ?>
<i class="icon-arrow-<?php 
        echo $new_sort == "asc" ? "up" : "down";
        ?>
"></i><?php 
    }
    ?>
                                    </a>

                        </th>
                           <th width="80px" class="title">
                                <?php 
    if ($setSortk2->orderDir == 'asc') {
        $new_sort = "desc";
    } else {
        $new_sort = "asc";
    }
    ?>
                                    <a class="hasTip" title="" onclick="Joomla.tableOrdering('a.title_2','<?php 
    echo $new_sort;
    ?>
', 'k2content');" href="#">
                                        <?php 
    echo _JNEWS_TAG_ARTICLESECTION;
    ?>
                                         <?php 
    if ($setSortk2->orderValue == 'a.title_2') {
        ?>
<i class="icon-arrow-<?php 
        echo $new_sort == "asc" ? "up" : "down";
        ?>
"></i><?php 
    }
    ?>
                                    </a>

                        </th>
                        <th width="80px" class="title">
                                <?php 
    if ($setSortk2->orderDir == 'asc') {
        $new_sort = "desc";
    } else {
        $new_sort = "asc";
    }
    ?>
                                    <a class="hasTip" title="" onclick="Joomla.tableOrdering('a.catid','<?php 
    echo $new_sort;
    ?>
', 'k2content');" href="#">
                                        <?php 
    echo _JNEWS_TAG_ARTICLECATEGORY;
    ?>
                                         <?php 
    if ($setSortk2->orderValue == 'a.catid') {
        ?>
<i class="icon-arrow-<?php 
        echo $new_sort == "asc" ? "up" : "down";
        ?>
"></i><?php 
    }
    ?>
                                    </a>

                        </th>
                        <th width="80px" class="title">
                                <?php 
    if ($setSortk2->orderDir == 'asc') {
        $new_sort = "desc";
    } else {
        $new_sort = "asc";
    }
    ?>
                                    <a class="hasTip" title="" onclick="Joomla.tableOrdering('a.id','<?php 
    echo $new_sort;
    ?>
', 'k2content');" href="#">
                                       <?php 
    echo "  ID";
    ?>
                                         <?php 
    if ($setSortk2->orderValue == 'a.id') {
        ?>
<i class="icon-arrow-<?php 
        echo $new_sort == "asc" ? "up" : "down";
        ?>
"></i><?php 
    }
    ?>
                                    </a>

                        </th>

                    </tr>
                </thead>
                <?php 
    if (sizeof($k2contentitems) > 0) {
        $k = 0;
        foreach ($k2contentitems as $k2contentitem) {
            if (empty($k2contentitem->section)) {
                $k2contentitem->section = JText::_('Uncategorised');
            }
            if (empty($k2contentitem->category)) {
                $k2contentitem->category = JText::_('Uncategorised');
            }
            echo '<tr style="cursor:pointer" class="row' . $k . '" onclick="setContentTag(\'' . $k2contentitem->id . '\');" ><td>' . $k2contentitem->title . '</td><td nowrap="nowrap" align="center">' . $k2contentitem->section . '</td><td nowrap="nowrap" align="center">' . $k2contentitem->category . '</td><td nowrap="nowrap" align="center">' . $k2contentitem->id . '</td></tr>';
            $k = 1 - $k;
        }
    }
    ?>
            </tbody>
        </table>
   <?php 
    echo jnews::setPaginationBot($setLimitk2, 'margin:auto;');
    ?>

</div>
<div class="b">
<div class="b">
<div class="b"></div>
</div>
</div>
</div>
                <input type="hidden" value="<?php 
    echo $task;
    ?>
" name="task"/>
                <input type="hidden" value="<?php 
    echo $setSortk2->orderValue;
    ?>
" name="k2_filter_order"/>
                  <input type="hidden" value="<?php 
    echo $setSortk2->orderValue;
    ?>
" name="filter_order"/>
                <input type="hidden" value="<?php 
    echo $setSortk2->orderDir;
    ?>
" name="filter_order_Dir"/>
</form>
</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);
}
Пример #3
0
/**
 * <p>Function to insert a date tag<p>
 */
function tagdatetime()
{
    $js = 'function insertjnewstag(tag){ ';
    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 .= '}';
    $doc = JFactory::getDocument();
    $doc->addScriptDeclaration($js);
    echo '<style type="text/css">table.' . jnews::myTheme() . 'tr:hover {cursor: pointer;}</style>';
    ?>

<div id="element-box">
	<div class="t">
		<div class="t">
			<div class="t"></div>
		</div>
	</div>
	<div class="m">
	<table class="<?php 
    echo jnews::myTheme();
    ?>
">
			<tbody>
				<thead>
					<tr>
						<th class="title"><center><?php 
    echo _JNEWS_MAILING_TAG;
    ?>
</center></th>
						<th class="title"><center><?php 
    echo _JNEWS_TEMPLATE_DESC;
    ?>
</center></th>
					</tr>
				</thead>
				<tr class="row0" onclick="insertjnewstag('{tag:date}')">
					<td>
						<strong><?php 
    echo '{tag:date}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    if (version_compare(JVERSION, '3.0.0', '<')) {
        $date = JHTML::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC'), JNEWS_TIME_OFFSET);
    } else {
        $date = JHtml::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC'), JNEWS_TIME_OFFSET);
    }
    echo $date;
    ?>
					</td>
				</tr>
				<tr class="row0" onclick="insertjnewstag('{tag:date format=1}')">
					<td>
						<strong><?php 
    echo '{tag:date format=1}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    if (version_compare(JVERSION, '3.0.0', '<')) {
        $date = JHTML::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC1'), JNEWS_TIME_OFFSET);
    } else {
        $date = JHtml::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC1'), JNEWS_TIME_OFFSET);
    }
    echo $date;
    ?>
					</td>
				</tr>
				<tr class="row0" onclick="insertjnewstag('{tag:date format=2}')">
					<td>
						<strong><?php 
    echo '{tag:date format=2}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    if (version_compare(JVERSION, '3.0.0', '<')) {
        $date = JHTML::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC2'), JNEWS_TIME_OFFSET);
    } else {
        $date = JHtml::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC2'), JNEWS_TIME_OFFSET);
    }
    echo $date;
    ?>
					</td>
				</tr>
				<tr class="row0" onclick="insertjnewstag('{tag:date format=3}')">
					<td>
						<strong><?php 
    echo '{tag:date format=3}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    if (version_compare(JVERSION, '3.0.0', '<')) {
        $date = JHTML::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC3'), JNEWS_TIME_OFFSET);
    } else {
        $date = JHtml::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC3'), JNEWS_TIME_OFFSET);
    }
    echo $date;
    ?>
					</td>
				</tr>
				<tr class="row0" onclick="insertjnewstag('{tag:date format=4}')">
					<td>
						<strong><?php 
    echo '{tag:date format=4}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    if (version_compare(JVERSION, '3.0.0', '<')) {
        $date = JHTML::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC4'), JNEWS_TIME_OFFSET);
    } else {
        $date = JHtml::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC4'), JNEWS_TIME_OFFSET);
    }
    echo $date;
    ?>
					</td>
				</tr>
			</tbody>
		</table>

	</div>
	<div class="b">
		<div class="b">
			<div class="b"></div>
		</div>
	</div>
</div>
<?php 
}
Пример #4
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();
    }
Пример #5
0
 /**
  * This public static function creates the listing view of the stats and reports.
  *
  * @param array $columnHeaders column headers of the listing table
  * @param array $colNames column names of the results rows
  * @param object $results query results
  * @param array $styles styles for the column data
  * @param array $links links for the column data
  * @param array $popupCol name of the popup column index
  *
  */
 public static function htmlListingOutput($columnHeaders, $colNames, $results = null, $styles = null, $links = null, $startDate = 0, $endDate = 0)
 {
     //no table to make
     if (empty($columnHeaders)) {
         return true;
     }
     $table = '<table class="' . jnews::myTheme() . '"> <tbody><thead>';
     $tableHeader = '<tr>';
     foreach ($columnHeaders as $colHeader) {
         $tableHeader .= '<th class="title" style="text-align: center;">';
         $tableHeader .= $colHeader;
         $tableHeader .= '</th>';
     }
     //end4each
     $tableHeader .= '</tr></thead>';
     $tableRows = '';
     if (!empty($results)) {
         $rownum = 1;
         foreach ($results as $rowdata) {
             $i = ($rownum + 2) % 2;
             $trclass = 'class="row' . $i . '"';
             $tableRows .= '<tr ' . $trclass . '>';
             $tableRows .= "<td style=\"width:30px;text-align: center;\"> {$rownum} </td>";
             $colnum = 0;
             foreach ($colNames as $colname) {
                 if (isset($styles[$colname])) {
                     $tableRows .= '<td ' . outputReportGraph::addStyle($styles[$colname]) . '> ';
                 } else {
                     $tableRows .= "<td>";
                 }
                 $coldata = !empty($rowdata->{$colname}) ? $rowdata->{$colname} : 0;
                 if (isset($links[$colname])) {
                     $coldata = outputReportGraph::addPopupLink($links[$colname], $rowdata, $colNames, $coldata, $startDate, $endDate);
                 }
                 $tableRows .= "{$coldata}</td>";
                 $colnum++;
             }
             $tableRows .= "</tr>";
             $rownum++;
         }
     }
     $table .= $tableHeader . $tableRows;
     $table .= '</tbody></table>';
     echo $table;
 }
Пример #6
0
    public static function import($action, $lists, $listId)
    {
        ?>
		<script language="javascript" type="text/javascript">
			function submitbutton(pressbutton) {
				var form = document.adminForm;


				if (form.importfile.value == "") {
					alert( "<?php 
        echo addslashes(_JNEWS_SELECT_FILE) . ' ' . addslashes(_JNEWS_MENU_IMPORT) . '!';
        ?>
" );
				} else {
					submitform(pressbutton);
				}
			}
		</script>
		<form action="index.php?option=<?php 
        echo JNEWS_OPTION;
        ?>
&act=<?php 
        echo $action;
        ?>
&listid=<?php 
        echo $listId;
        ?>
" method="post" name="adminForm" enctype="multipart/form-data" id="adminForm">
			<input type="hidden" name="task" value="<?php 
        $task = JRequest::getVar('task', 'import');
        echo $task;
        ?>
" />
			<input type="hidden" name="action" value="<?php 
        echo $action;
        ?>
" />
		<table border="0" width="100%" cellpadding="1" cellspacing="1" class="<?php 
        echo jnews::myTheme();
        ?>
">
			<tbody>
		<?php 
        if (!$GLOBALS[JNEWS . 'disabletooltip']) {
            if (version_compare(JVERSION, '3.0.0', '<')) {
                JHTML::_('behavior.tooltip');
            } else {
                JHtml::_('behavior.tooltip');
            }
        }
        echo _JNEWS_LIST_IMPORT;
        $i = 0;
        $k = 0;
        foreach ($lists as $list) {
            $i++;
            echo '<tr class=row' . $k . '><td width="40px">';
            echo "\n" . '<input type="checkbox" class="inputbox" value="1" name="subscribed[' . $i . ']" />';
            echo "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
            echo '</td><td>';
            echo "\n" . '<span class="aca_list_name  onclick=\'return false;\'">' . jNews_Tools::toolTip($list->list_desc, $list->list_name, '', '', $list->list_name, '#', 1) . '</span>';
            echo "\n" . '<input type="hidden" name="acc_level[' . $i . ']" value="0" />';
            echo '</td></tr>';
            $k = 1 - $k;
        }
        ?>
		<tr>
			<td colspan="2">
				<br/>
				<?php 
        echo _JNEWS_IMPORTSUB_TIPS;
        ?>
				<div style="border: 1px solid #D5D5D5; padding: 5px; margin: 2px; background-color: #F9F9F9">
					<?php 
        echo _JNEWS_SELECT_IMPORT_FILE . ' :';
        ?>
					<input type="file" name="importfile" size="57" class="inputbox" />
					<input type="button" value="Import" class="button" onclick="submitbutton('doImport')" />
				</div>
			</td>
		</tr>
	</table>
<?php 
        if (version_compare(JVERSION, '3.0.0', '<')) {
            echo JHTML::_('form.token');
        } else {
            echo JHtml::_('form.token');
        }
        ?>
	</form><?php 
    }
Пример #7
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();
    }
Пример #8
0
    public static function showStatistics($listStats, $mailing, $globalStats, $html_read, $html_unread, $text, $listId)
    {
        ?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<table class="<?php 
        echo jnews::myTheme();
        ?>
">
	<tr>
		<th colspan="2" class="title"><?php 
        echo _JNEWS_MAILING_LIST_DETAILS;
        ?>
:</th>
	</tr>
	<tr>
		<td width="200" align="left"><?php 
        echo @constant($GLOBALS[JNEWS . 'listname' . $listStats->list_type]);
        ?>
:</td>
		<td align="left"><?php 
        echo $listStats->list_name;
        ?>
</td>
	</tr>
	<tr>
		<td width="200" align="left"><?php 
        echo _JNEWS_DESCRIPTION;
        ?>
:</td>
		<td align="left"><?php 
        echo $listStats->list_desc;
        ?>
</td>
	</tr>
	<tr>
		<td width="200" align="left"><?php 
        echo _JNEWS_LIST_ISSUE;
        ?>
:</td>
		<td align="left"><?php 
        echo $mailing->issue_nb;
        ?>
</td>
	</tr>
	<tr>
		<td width="200" align="left"><?php 
        echo _JNEWS_SUBJECT;
        ?>
:</td>
		<td align="left"><?php 
        echo $mailing->subject;
        ?>
</td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
</table>
<?php 
        $stat_tabs = new MosTabsjNews(0);
        $stat_tabs->startPane('acaStats');
        $stat_tabs->startTab(_JNEWS_GLOBALSTATS, 'acaStats');
        ?>
	<table width="100%" cellpadding="4" cellspacing="0" border="0" align="center" class="<?php 
        echo jnews::myTheme();
        ?>
">
<?php 
        if ($listStats->html == 1) {
            ?>
		<tr>
			<td width="200" align="left"><?php 
            echo _JNEWS_SEND_IN_HTML_FORMAT;
            ?>
:</td>
			<td align="left"><?php 
            echo $globalStats->html_sent;
            ?>
</td>
		</tr>
		<tr>
			<td width="200" align="left"><?php 
            echo _JNEWS_VIEWS_FROM_HTML;
            ?>
:</td>
			<td align="left"><?php 
            echo $globalStats->html_read;
            ?>
</td>
		</tr>
<?php 
        }
        ?>
		<tr>
			<td width="200" align="left"><?php 
        echo _JNEWS_SEND_IN_TEXT_FORMAT;
        ?>
:</td>
			<td align="left"><?php 
        echo $globalStats->text_sent;
        ?>
</td>
		</tr>
	</table>
<?php 
        $stat_tabs->endTab();
        $stat_tabs->startTab(_JNEWS_DETAILED_STATS, 'acaStats.detail');
        ?>

			<table width="100%" cellpadding="4" cellspacing="0" border="1" align="center" class="<?php 
        echo jnews::myTheme();
        ?>
">
				<thead>
					<tr>
						<th class="title"><?php 
        echo _JNEWS_HTML_READ;
        ?>
</th>
						<th class="title"><?php 
        echo _JNEWS_HTML_UNREAD;
        ?>
</th>
						<th class="title"><?php 
        echo _JNEWS_TEXT_ONLY_SENT;
        ?>
</th>
					</tr>
				</thead>
					<tr>
						<td valign="top" align="left" width="33%">
<?php 
        if (sizeof($html_read) > 0) {
            foreach ($html_read as $htmlread) {
                echo $htmlread->name . ' (' . $htmlread->email . ')<br />';
            }
        }
        ?>
						</td>
						<td valign="top" align="left" width="33%">
<?php 
        if (sizeof($html_unread) > 0) {
            foreach ($html_unread as $htmlunread) {
                echo $htmlunread->name . ' (' . $htmlunread->email . ')<br />';
            }
        }
        ?>
						</td>
						<td valign="top" align="left" width="33%">
<?php 
        if (sizeof($text) > 0) {
            foreach ($text as $atext) {
                echo $atext->name . ' (' . $atext->email . ')<br />';
            }
        }
        ?>
						</td>
					</tr>
				</table>

<?php 
        $stat_tabs->endTab();
        $stat_tabs->endpane();
        ?>
   	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="option" value="<?php 
        echo JNEWS_OPTION;
        ?>
" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="act" value="statistics" />
	<input type="hidden" name="listid" value="<?php 
        echo $listId;
        ?>
" />
	<input type="hidden" name="mailingid" value="<?php 
        echo $mailing->mailing_id;
        ?>
" />
	<input type="hidden" name="tab" value="<?php 
        echo $tab;
        ?>
" />
</form>
<?php 
    }
Пример #9
0
function virtuemartproduct($forms, $params = null)
{
    $vmproducts = new virtuemartProducts();
    $limit = -1;
    $limittotal = $vmproducts->_countVMProducts();
    $setLimit = jnews::setLimitPagination($limittotal);
    $action = JRequest::getVar('act', '', '', 'WORD');
    $task = JRequest::getVar('task');
    $vmproductsearch = JRequest::getVar('vmproductsearch', '');
    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 = $vmproductsearch;
    $toSearch->id = 'vmproductsearch';
    ?>

<div id="element-box">
	<div class="t">
		<div class="t">
			<div class="t"></div>
		</div>
	</div>
	<div class="m">
<?php 
    echo jnews::setTop($toSearch, null);
    $js = 'function insertjnewstag(tag){';
    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 .= '}';
    $doc = JFactory::getDocument();
    $doc->addScriptDeclaration($js);
    ?>
	<table class="<?php 
    echo jnews::myTheme();
    ?>
" cellpadding="0" cellspacing="0">
		<tbody>
			<thead>
				<tr>
					<th class="title"> Tag
					</th>
					<th class="title">
						<?php 
    echo 'Product Name';
    ?>
					</th>
					<th width="80px" class="title">
						<?php 
    echo 'Product Description';
    ?>
					</th>
					<th  width="60px" class="title">
						<?php 
    echo 'Product ID';
    ?>
					</th>
				</tr>
			</thead>
<?php 
    $products = $vmproducts->_getVMProducts($vmproductsearch, $setLimit);
    $k = 0;
    $html = '';
    foreach ($products as $product) {
        if (empty($product->product_s_desc) && !empty($product->product_desc)) {
            $product->product_s_desc = substr(strip_tags($product->product_desc), 0, 100);
        } else {
            $product->product_s_desc = '';
        }
        $insertTag = '{vmprod=' . $product->virtuemart_product_id . '}';
        $html .= '<tr style="cursor:pointer" class="row' . $k . '" onclick="insertjnewstag(\'' . $insertTag . '\')" ><td><strong>{vmprod=' . $product->virtuemart_product_id . '}</strong></td><td>' . $product->product_name . '</td><td nowrap="nowrap" align="left">' . $product->product_s_desc . '</td><td align="center" nowrap="nowrap">' . $product->virtuemart_product_id . '</td></tr>';
        $k = 1 - $k;
    }
    echo $html;
    ?>
		</tbody>
	</table>
<?php 
    $css = 'margin:auto;';
    echo jnews::setPaginationBot($setLimit, $css);
    ?>
	</div>
	<div class="b">
		<div class="b">
			<div class="b"></div>
		</div>
	</div>
</div>
	<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"/>
  	</form>
<?php 
}
Пример #10
0
    public static function showConfigEdit()
    {
        $mailOpt = array();
        $mailOpt[] = jnews::HTML_SelectOption('mail', 'PHP mail function');
        $mailOpt[] = jnews::HTML_SelectOption('sendmail', 'Sendmail');
        $mailOpt[] = jnews::HTML_SelectOption('smtp', 'SMTP Server');
        $logFormat = array();
        $logFormat[] = jnews::HTML_SelectOption('0', _JNEWS_DETAILED);
        $logFormat[] = jnews::HTML_SelectOption('1', _JNEWS_SIMPLE);
        $themeOption = array();
        $themeOption[] = jnews::HTML_SelectOption('joobilist', 'jNews Look');
        $themeOption[] = jnews::HTML_SelectOption('adminlist', 'Joomla look');
        $lists = array();
        $lists['component_theme'] = jnews::HTML_GenericList($themeOption, "config['component_theme']", 'class="inputbox" size="1"', 'value', 'text', jnews::myTheme());
        $lists['mailermethod'] = jnews::HTML_GenericList($mailOpt, "config['emailmethod']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'emailmethod']);
        $lists['send_log_simple'] = jnews::HTML_GenericList($logFormat, "config['send_log_simple']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'send_log_simple']);
        $lists['save_log_simple'] = jnews::HTML_GenericList($logFormat, "config['save_log_simple']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'save_log_simple']);
        $mailSecure[] = jnews::HTML_SelectOption('', '---');
        $mailSecure[] = jnews::HTML_SelectOption('ssl', 'SSL');
        $mailSecure[] = jnews::HTML_SelectOption('tls', 'TLS');
        $lists['smtp_secure'] = jnews::HTML_GenericList($mailSecure, "config['smtp_secure']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'smtp_secure']);
        $lists['auth_required'] = jnews::HTML_BooleanList("config['smtp_auth_required']", 'class="inputbox"', $GLOBALS[JNEWS . 'smtp_auth_required']);
        $lists['allow_unregistered'] = jnews::HTML_BooleanList("config['allow_unregistered']", 'class="inputbox"', $GLOBALS[JNEWS . 'allow_unregistered']);
        $lists['require_confirmation'] = jnews::HTML_BooleanList("config['require_confirmation']", 'class="inputbox"', $GLOBALS[JNEWS . 'require_confirmation']);
        // DKIM code addition by Amod begins
        $GLOBALS[JNEWS . 'dkim_activated'] = !empty($GLOBALS[JNEWS . 'dkim_activated']) ? $GLOBALS[JNEWS . 'dkim_activated'] : null;
        $lists['dkim_activated'] = jnews::HTML_BooleanList("config['dkim_activated']", 'class="inputbox"', $GLOBALS[JNEWS . 'dkim_activated']);
        // DKIM code addition by Amod ends
        //These options are transfered from lists to configuration
        $lists['show_unsubscribelink'] = jnews::HTML_BooleanList("config['show_unsubscribelink']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_unsubscribelink']);
        $lists['show_subscriptionlink'] = jnews::HTML_BooleanList("config['show_subscriptionlink']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_subscriptionlink']);
        //Queue Settings for queue status
        $queuestatus = array();
        $queuestatus[] = jnews::HTML_SelectOption('1', _JNEWS_QUEUESTATS_ON);
        $queuestatus[] = jnews::HTML_SelectOption('0', _JNEWS_QUEUESTATS_OF);
        $lists['queue_status'] = jnews::HTML_RadioList($queuestatus, "config['queue_status']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'queue_status']);
        $archiveLink = array();
        $archiveLink[] = jnews::HTML_SelectOption('standard', _JNEWS_ARCHIVELINK_STANDARD);
        $archiveLink[] = jnews::HTML_SelectOption('popup', _JNEWS_ARCHIVELINK_POPUP);
        $archiveLink[] = jnews::HTML_SelectOption('newpage', _JNEWS_ARCHIVELINK_PAGE);
        $lists['archive_link'] = jnews::HTML_RadioList($archiveLink, "config['archive_link']", 'class="inputbox" size="1"', 'value', 'text', @$GLOBALS[JNEWS . 'archive_link']);
        $joobicron = array();
        $joobicron[] = jnews::HTML_SelectOption('1', _JNEWS_JOOBICRON_NO);
        $joobicron[] = jnews::HTML_SelectOption('2', _JNEWS_JOOBICRON_YES);
        if ($GLOBALS[JNEWS . 'j_cron'] != 2) {
            $GLOBALS[JNEWS . 'j_cron'] = 1;
        }
        //set to no
        $lists['j_cron'] = jnews::HTML_RadioList($joobicron, "config['j_cron']", 'class="inputbox" size="1"', 'value', 'text', @$GLOBALS[JNEWS . 'j_cron']);
        //Queue Settings for Queue Process
        //$queueprocess=array();
        //$queueprocess[]=jnews::HTML_SelectOption('1', _JNEWS_QUEUESTATS_ON);
        //$queueprocess[]=jnews::HTML_SelectOption('0', _JNEWS_QUEUESTATS_OF);
        //$lists['queue_process'] = jnews::HTML_RadioList( $queueprocess, "config['queue_process']" , 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS.'queue_process'] );
        //Queue Settings for Smart Queue
        $smartqueue = array();
        $smartqueue[] = jnews::HTML_SelectOption('1', _JNEWS_SMARTQ_ON);
        $smartqueue[] = jnews::HTML_SelectOption('0', _JNEWS_SMARTQ_OF);
        $lists['smart_queue'] = jnews::HTML_RadioList($smartqueue, "config['smart_queue']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'smart_queue']);
        $lists['show_login'] = jnews::HTML_BooleanList("config['show_login']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_login']);
        $lists['show_logout'] = jnews::HTML_BooleanList("config['show_logout']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_logout']);
        $lists['confirm_html'] = jnews::HTML_BooleanList("config['confirm_html']", 'class="inputbox"', $GLOBALS[JNEWS . 'confirm_html']);
        $lists['time_zone'] = jnews::HTML_BooleanList("config['time_zone']", 'class="inputbox"', $GLOBALS[JNEWS . 'time_zone']);
        $lists['sub_info_fields'] = jnews::HTML_BooleanList("config['sub_info_fields']", 'class="inputbox"', $GLOBALS[JNEWS . 'sub_info_fields']);
        $lists['show_archive'] = jnews::HTML_BooleanList("config['show_archive']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_archive']);
        $lists['enable_statistics'] = jnews::HTML_BooleanList("config['enable_statistics']", 'class="inputbox"', $GLOBALS[JNEWS . 'enable_statistics']);
        $lists['statistics_per_subscriber'] = jnews::HTML_BooleanList("config['statistics_per_subscriber']", 'class="inputbox"', $GLOBALS[JNEWS . 'statistics_per_subscriber']);
        //Send only HTML Mailin
        $lists['forced_html'] = jnews::HTML_BooleanList("config['forced_html']", 'class="inputbox"', $GLOBALS[JNEWS . 'forced_html']);
        $lists['wait_for_user'] = jnews::HTML_BooleanList("config['wait_for_user']", 'class="inputbox"', $GLOBALS[JNEWS . 'wait_for_user']);
        $lists['display_trace'] = jnews::HTML_BooleanList("config['display_trace']", 'class="inputbox"', $GLOBALS[JNEWS . 'display_trace']);
        $lists['send_data'] = jnews::HTML_BooleanList("config['send_data']", 'class="inputbox"', $GLOBALS[JNEWS . 'send_data']);
        $lists['send_auto_log'] = jnews::HTML_BooleanList("config['send_auto_log']", 'class="inputbox"', $GLOBALS[JNEWS . 'send_auto_log']);
        $lists['send_log'] = jnews::HTML_BooleanList("config['send_log']", 'class="inputbox"', $GLOBALS[JNEWS . 'send_log']);
        $lists['save_log'] = jnews::HTML_BooleanList("config['save_log']", 'class="inputbox"', $GLOBALS[JNEWS . 'save_log']);
        $lists['send_log_closed'] = jnews::HTML_BooleanList("config['send_log_closed']", 'class="inputbox"', $GLOBALS[JNEWS . 'send_log_closed']);
        $lists['clear_log'] = jnews::HTML_BooleanList("clear_log", 'class="inputbox"', 0);
        $lists['show_footer'] = jnews::HTML_BooleanList("config['show_footer']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_footer']);
        $lists['show_jcalpro'] = jnews::HTML_BooleanList("config['show_jcalpro']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_jcalpro']);
        $lists['show_jlinks'] = jnews::HTML_BooleanList("config['show_jlinks']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_jlinks']);
        // $lists['enable_jsub'] = jnews::HTML_BooleanList( "config['enable_jsub']" , 'class="inputbox"', $GLOBALS[JNEWS.'enable_jsub'] );
        $lists['allow_sn'] = jnews::HTML_BooleanList("config['allow_sn']", 'class="inputbox"', $GLOBALS[JNEWS . 'allow_sn']);
        $lists['sntag_norequired'] = jnews::HTML_BooleanList("config['sntag_norequired']", 'class="inputbox"', $GLOBALS[JNEWS . 'sntag_norequired']);
        $lists['show_unsubscribe_all'] = jnews::HTML_BooleanList("config['show_unsubscribe_all']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_unsubscribe_all']);
        $lists['show_terms'] = jnews::HTML_BooleanList("config['show_terms']", 'class="inputbox"', @$GLOBALS[JNEWS . 'show_terms']);
        $lists['check_terms'] = jnews::HTML_BooleanList("config['check_terms']", 'class="inputbox"', @$GLOBALS[JNEWS . 'check_terms']);
        //column1
        $lists['show_column1'] = jnews::HTML_BooleanList("config['show_column1']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_column1']);
        $lists['show_column2'] = jnews::HTML_BooleanList("config['show_column2']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_column2']);
        $lists['show_column3'] = jnews::HTML_BooleanList("config['show_column3']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_column3']);
        $lists['show_column4'] = jnews::HTML_BooleanList("config['show_column4']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_column4']);
        $lists['show_column5'] = jnews::HTML_BooleanList("config['show_column5']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_column5']);
        //end of columns
        //captcha
        //			 $lists['enable_captcha'] = jnews::HTML_BooleanList( "config['enable_captcha']" , 'class="inputbox"', $GLOBALS[JNEWS.'enable_captcha'] );
        //$lists['use_cron_pass'] = jnews::HTML_BooleanList( "config['use_cron_pass']" , 'class="inputbox"', $GLOBALS[JNEWS.'use_cron_pass'] );
        $lists['show_signature'] = jnews::HTML_BooleanList("config['show_signature']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_signature']);
        $lists['show_lists'] = jnews::HTML_BooleanList("config['show_lists']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_lists']);
        $lists['embed_images'] = jnews::HTML_BooleanList("config['embed_images']", 'class="inputbox"', $GLOBALS[JNEWS . 'embed_images']);
        $lists['use_tags'] = jnews::HTML_BooleanList("config['use_tags']", 'class="inputbox"', $GLOBALS[JNEWS . 'use_tags']);
        $lists['show_guide'] = jnews::HTML_BooleanList("config['show_guide']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_guide']);
        $lists['show_author'] = jnews::HTML_BooleanList("config['show_author']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_author']);
        $lists['show_tips'] = jnews::HTML_BooleanList("config['show_tips']", 'class="inputbox"', $GLOBALS[JNEWS . 'show_tips']);
        //$lists['update_notification'] = jnews::HTML_BooleanList( "config['update_notification']" , 'class="inputbox"', $GLOBALS[JNEWS.'update_notification'] );
        $lists['use_sef'] = jnews::HTML_BooleanList("config['use_sef']", 'class="inputbox"', $GLOBALS[JNEWS . 'use_sef']);
        $lists['listype1'] = jnews::HTML_BooleanList("config['listype1']", 'class="inputbox"', $GLOBALS[JNEWS . 'listype1']);
        $lists['listype2'] = jnews::HTML_BooleanList("config['listype2']", 'class="inputbox"', $GLOBALS[JNEWS . 'listype2']);
        $lists['listHTMLeditor'] = jnews::HTML_BooleanList("config['listHTMLeditor']", 'class="inputbox"', $GLOBALS[JNEWS . 'listHTMLeditor']);
        //for social version
        if ($GLOBALS[JNEWS . 'level'] > 2) {
            if (@(include_once JNEWSPATH_ADMIN . 'social' . DS . 'class.social.php')) {
                if (class_exists('jNews_Social')) {
                    $lists['use_masterlists'] = jnews::HTML_BooleanList("config['use_masterlists']", 'class="inputbox"', $GLOBALS[JNEWS . 'use_masterlists']);
                    $lists['allow_fe_autoresponder'] = jnews::HTML_BooleanList("config['allow_fe_autoresponder']", 'class="inputbox"', $GLOBALS[JNEWS . 'allow_fe_autoresponder']);
                }
            }
        }
        if (empty($lists['allow_fe_autoresponder'])) {
            $lists['allow_fe_autoresponder'] = 'jNews Social Only';
        }
        $lists['send_error'] = jnews::HTML_BooleanList("config['send_error']", 'class="inputbox"', $GLOBALS[JNEWS . 'send_error']);
        $lists['report_error'] = jnews::HTML_BooleanList("config['report_error']", 'class="inputbox"', $GLOBALS[JNEWS . 'report_error']);
        $lists['fullcheck'] = jnews::HTML_BooleanList("config['fullcheck']", 'class="inputbox"', $GLOBALS[JNEWS . 'fullcheck']);
        $lists['addEmailRedLink'] = jnews::HTML_BooleanList("config['addEmailRedLink']", 'class="inputbox"', $GLOBALS[JNEWS . 'addEmailRedLink']);
        $lists['disabletooltip'] = jnews::HTML_BooleanList("config['disabletooltip']", 'class="inputbox"', $GLOBALS[JNEWS . 'disabletooltip']);
        $lists['minisendmail'] = jnews::HTML_BooleanList("config['minisendmail']", 'class="inputbox"', $GLOBALS[JNEWS . 'minisendmail']);
        //<!-- content ordering -->
        $sortContent[] = jnews::HTML_SelectOption('0', _JNEWS_SORT_DATE);
        $sortContent[] = jnews::HTML_SelectOption('1', _JNEWS_SORT_SECTION);
        $sortContent[] = jnews::HTML_SelectOption('2', _JNEWS_SORT_CATEGORY);
        //$lists['content_order'] = jnews::HTML_GenericList( $sortContent, "config['content_order']" , 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS.'content_order'] );
        $schedPrior = array();
        $schedPrior[] = jnews::HTML_SelectOption('1', '1');
        $schedPrior[] = jnews::HTML_SelectOption('2', '2');
        $schedPrior[] = jnews::HTML_SelectOption('3', '3');
        $enable_jsub = array();
        $enable_jsub[] = jnews::HTML_SelectOption('0', _JNEWS_LIST_ACESS);
        $enable_jsub[] = jnews::HTML_SelectOption('1', _JNEWS_BYOWNER);
        $lists['enable_jsub'] = jnews::HTML_RadioList($enable_jsub, "config['enable_jsub']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'enable_jsub']);
        $GLOBALS[JNEWS . 'sched_prior'] = isset($GLOBALS[JNEWS . 'sched_prior']) ? $GLOBALS[JNEWS . 'sched_prior'] : 3;
        $lists['sched_prior'] = jnews::HTML_RadioList($schedPrior, "config['sched_prior']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'sched_prior']);
        $arPrior = array();
        $arPrior[] = jnews::HTML_SelectOption('1', '1');
        $arPrior[] = jnews::HTML_SelectOption('2', '2');
        $arPrior[] = jnews::HTML_SelectOption('3', '3');
        $GLOBALS[JNEWS . 'ar_prior'] = isset($GLOBALS[JNEWS . 'ar_prior']) ? $GLOBALS[JNEWS . 'ar_prior'] : '';
        $lists['ar_prior'] = jnews::HTML_RadioList($arPrior, "config['ar_prior']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'ar_prior']);
        $smPrior = array();
        $smPrior[] = jnews::HTML_SelectOption('1', '1');
        $smPrior[] = jnews::HTML_SelectOption('2', '2');
        $smPrior[] = jnews::HTML_SelectOption('3', '3');
        $GLOBALS[JNEWS . 'sm_prior'] = isset($GLOBALS[JNEWS . 'sm_prior']) ? $GLOBALS[JNEWS . 'sm_prior'] : '';
        $lists['sm_prior'] = jnews::HTML_RadioList($arPrior, "config['sm_prior']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'sm_prior']);
        $priord_list = array();
        $priord_list[] = jnews::HTML_SelectOption('0', _JNEWS_AUTORESP);
        $priord_list[] = jnews::HTML_SelectOption('1', _JNEWS_LIST);
        $GLOBALS[JNEWS . 'priord_list'] = isset($GLOBALS[JNEWS . 'priord_list']) ? $GLOBALS[JNEWS . 'priord_list'] : '';
        $lists['priord_list'] = jnews::HTML_RadioList($priord_list, "config['priord_list']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'priord_list']);
        $priord_subs = array();
        $priord_subs[] = jnews::HTML_SelectOption('0', _JNEWS_REMAIN_SUBS);
        $priord_subs[] = jnews::HTML_SelectOption('1', _JNEWS_LIST_T_SUBSCRIPTION);
        $priord_subs[] = jnews::HTML_SelectOption('2', _JNEWS_UNSUBS);
        $GLOBALS[JNEWS . 'priord_subs'] = isset($GLOBALS[JNEWS . 'priord_subs']) ? $GLOBALS[JNEWS . 'priord_subs'] : '';
        $lists['priord_subs'] = jnews::HTML_RadioList($priord_subs, "config['priord_subs']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'priord_subs']);
        if (class_exists('jNews_Social')) {
            $lists['list_creatorfe'] = jnews::displayAccessRoles('list_creatorfe', $GLOBALS[JNEWS . 'list_creatorfe']);
            //since 6.1.0
            $lists['use_backendview'] = jnews::HTML_BooleanList("config['use_backendview']", 'class="inputbox"', $GLOBALS[JNEWS . 'use_backendview']);
        }
        if (class_exists('aca_archive')) {
            $jour = array();
            $jour[] = jnews::HTML_SelectOption('0', _JNEWS_FREQ_OPT_0);
            $jour[] = jnews::HTML_SelectOption('1', _JNEWS_FREQ_OPT_1);
            $jour[] = jnews::HTML_SelectOption('2', _JNEWS_FREQ_OPT_2);
            $jour[] = jnews::HTML_SelectOption('3', _JNEWS_FREQ_OPT_3);
            $jour[] = jnews::HTML_SelectOption('4', _JNEWS_FREQ_OPT_4);
            $jour[] = jnews::HTML_SelectOption('5', _JNEWS_FREQ_OPT_5);
            $jour[] = jnews::HTML_SelectOption('6', _JNEWS_FREQ_OPT_6);
            $dateType = array();
            $dateType[] = jnews::HTML_SelectOption('1', _JNEWS_DATE_OPT_1);
            $dateType[] = jnews::HTML_SelectOption('2', _JNEWS_DATE_OPT_2);
            $lists['frequency'] = jnews::HTML_GenericList($jour, "config['frequency']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'frequency']);
            $lists['date_type'] = jnews::HTML_GenericList($dateType, "config['date_type']", 'class="inputbox" size="1"', 'value', 'text', $GLOBALS[JNEWS . 'date_type']);
        }
        //encoding format
        $mail_format[] = jnews::HTML_SelectOption('0', 'Text (8bit)');
        $mail_format[] = jnews::HTML_SelectOption('1', 'MIME (base64)');
        $lists['mail_format'] = jnews::HTML_RadioList($mail_format, "config['mail_format']", 'class="inputbox"', 'value', 'text', $GLOBALS[JNEWS . 'mail_format']);
        //encoding formart
        $mail_encoding[] = jnews::HTML_SelectOption('0', 'UTF-8');
        $mail_encoding[] = jnews::HTML_SelectOption('1', 'ISO-8859-2');
        $lists['mail_encoding'] = jnews::HTML_RadioList($mail_encoding, "config['mail_encoding']", 'class="inputbox"', 'value', 'text', $GLOBALS[JNEWS . 'mail_encoding']);
        backHTML::formStart('configpanel', 0, '');
        ?>
	<table style="width: 100%;" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td>
	<form action="index.php" method="post" name="adminForm" id="adminForm">
	<?php 
        $config_tabs = new MosTabsjNews(1);
        $config_tabs->startPane('acaConfig');
        $config_tabs->startTab(_JNEWS_MAIL_CONFIG, 'mail');
        jNews_ConfigHTML::mailSettings($lists);
        $config_tabs->endTab();
        $config_tabs->startTab(_JNEWS_SUBSCRIBER_CONFIG, 'subscribers');
        jNews_ConfigHTML::subcriberSettings($lists);
        $config_tabs->endTab();
        if (class_exists('jNews_Auto')) {
            $config_tabs->startTab(_JNEWS_SCHEDULER, 'scheduler');
            jNews_ConfigHTML::cronSettings($lists);
            $config_tabs->endTab();
        }
        $config_tabs->startTab(_JNEWS_LOGGING_CONFIG, 'logging');
        jNews_ConfigHTML::logsSettings($lists);
        $config_tabs->endTab();
        if ($GLOBALS[JNEWS . 'integration'] and ($GLOBALS[JNEWS . 'cb_integration'] or class_exists('aca_virtuemart') && $GLOBALS[JNEWS . 'virtuemart'])) {
            $config_tabs->startTab(_JNEWS_CONFIG_INTEGRATION, 'integration');
            if ($GLOBALS[JNEWS . 'cb_integration']) {
                jNews_ConfigHTML::cbSettings();
            }
            if (class_exists('aca_virtuemart') && isset($GLOBALS[JNEWS . 'virtuemart']) && $GLOBALS[JNEWS . 'virtuemart']) {
                aca_virtuemart::tab();
            }
            $config_tabs->endTab();
        }
        $config_tabs->startTab(_JNEWS_MISC_CONFIG, 'misc');
        jNews_ConfigHTML::miscSettings($lists);
        $config_tabs->endTab();
        if (class_exists('jNews_Auto')) {
            $config_tabs->startTab(_JNEWS_LICENSE_CONFIG, 'licence');
            jNews_Auto::licenseSettings($lists);
            $config_tabs->endTab();
        }
        $config_tabs->endPane();
        if (version_compare(JVERSION, '3.0.0', '<')) {
            echo JHTML::_('form.token');
        } else {
            echo JHtml::_('form.token');
        }
        ?>
		<input type="hidden" name="option" value="<?php 
        echo JNEWS_OPTION;
        ?>
" />
		<input type="hidden" name="act" value="configuration" />
    	<input type="hidden" name="boxchecked" value="0" />
    	<input type="hidden" name="task" value="" />
	</form>
	</td></tr></tbody></table>
	<?php 
    }
Пример #11
0
/**
 * <p>Function to insert a subscription tag<p>
 */
function tagsubscriber()
{
    $js = 'function insertjnewstag(tag){';
    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 .= '}';
    $doc = JFactory::getDocument();
    $doc->addScriptDeclaration($js);
    echo '<style type="text/css">table.' . jnews::myTheme() . 'tr:hover {cursor: pointer;}</style>';
    ?>

<div id="element-box">
	<div class="t">
		<div class="t">
			<div class="t"></div>
		</div>
	</div>
	<div class="m">
	<table class="<?php 
    echo jnews::myTheme();
    ?>
">
			<tbody>
				<thead>
					<tr>
						<th class="title"><center><?php 
    echo _JNEWS_MAILING_TAG;
    ?>
</center></th>
						<th class="title"><center><?php 
    echo _JNEWS_TEMPLATE_DESC;
    ?>
</center></th>
					</tr>
				</thead>
				<tr class="row0" onclick="insertjnewstag('{tag:name}')">
					<td>
						<strong><?php 
    echo '{tag:name}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    echo _JNEWS_TAG_NAME_DESC;
    ?>
					</td>
				</tr>
				<tr class="row1" onclick="insertjnewstag('{tag:firstname}')">
					<td>
						<strong><?php 
    echo '{tag:firstname}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    echo _JNEWS_TAG_FNAME_DESC;
    ?>
					</td>
				</tr>
				<tr class="row0" onclick="insertjnewstag('{tag:email}')">
					<td>
						<strong><?php 
    echo '{tag:email}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    echo _JNEWS_TAG_EMAIL_DESC;
    ?>
					</td>
				</tr>
				<tr class="row1" onclick="insertjnewstag('{tag:issuenb}')">
					<td>
						<strong><?php 
    echo '{tag:issuenb}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    echo _JNEWS_TAG_ISSUENB_DESC;
    ?>
					</td>
				</tr>
				<tr class="row1" onclick="insertjnewstag('{tag:title}')">
					<td>
						<strong><?php 
    echo '{tag:title}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    echo _JNEWS_TITLE;
    ?>
					</td>
				</tr>
				<?php 
    if ($GLOBALS[JNEWS . 'level'] > 2) {
        if ($GLOBALS[JNEWS . 'show_column1'] == 1) {
            ?>
				<tr class="row0" onclick="insertjnewstag('{tag:profile nb=1}')">
					<td>
						<strong><?php 
            echo '{tag:profile nb=1}';
            ?>
</strong>
					</td>
					<td>
						<?php 
            echo _JNEWS_COLUMN_DESC . '1';
            ?>
					</td>
				</tr>
				<?php 
        }
        if ($GLOBALS[JNEWS . 'show_column2'] == 1) {
            ?>
				<tr class="row1" onclick="insertjnewstag('{tag:profile nb=2}')">
					<td>
						<strong><?php 
            echo '{tag:profile nb=2}';
            ?>
</strong>
					</td>
					<td>
						<?php 
            echo _JNEWS_COLUMN_DESC . '2';
            ?>
					</td>
				</tr>
				<?php 
        }
        if ($GLOBALS[JNEWS . 'show_column3'] == 1) {
            ?>
				<tr class="row0" onclick="insertjnewstag('{tag:profile nb=3}')">
					<td>
						<strong><?php 
            echo '{tag:profile nb=3}';
            ?>
</strong>
					</td>
					<td>
						<?php 
            echo _JNEWS_COLUMN_DESC . '3';
            ?>
					</td>
				</tr>
				<?php 
        }
        if ($GLOBALS[JNEWS . 'show_column4'] == 1) {
            ?>
				<tr class="row1" onclick="insertjnewstag('{tag:profile nb=4}')">
					<td>
						<strong><?php 
            echo '{tag:profile nb=4}';
            ?>
</strong>
					</td>
					<td>
						<?php 
            echo _JNEWS_COLUMN_DESC . '4';
            ?>
					</td>
				</tr>
				<?php 
        }
        if ($GLOBALS[JNEWS . 'show_column5'] == 1) {
            ?>
				<tr class="row0" onclick="insertjnewstag('{tag:profile nb=5}')">
					<td>
						<strong><?php 
            echo '{tag:profile nb=5}';
            ?>
</strong>
					</td>
					<td>
						<?php 
            echo _JNEWS_COLUMN_DESC . '5';
            ?>
					</td>
				</tr>
			<?php 
        }
    }
    ?>
			</tbody>
		</table>

	</div>
	<div class="b">
		<div class="b">
			<div class="b"></div>
		</div>
	</div>
</div>
<?php 
}
Пример #12
0
/**
 * <p>Function to insert a subscription tag<p>
 */
function tagsubscription()
{
    $js = 'function insertjnewstag(tag){';
    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 .= '}';
    $doc = JFactory::getDocument();
    $doc->addScriptDeclaration($js);
    echo '<style type="text/css">table.' . jnews::myTheme() . 'tr:hover {cursor: pointer;}</style>';
    ?>

<div id="element-box">
	<div class="t">
	<div class="t">
	<div class="t"></div>
	</div>
	</div>
	<div class="m">
	<table class="<?php 
    echo jnews::myTheme();
    ?>
">
			<tbody>
				<thead>
					<tr>
						<th class="title"><center><?php 
    echo _JNEWS_MAILING_TAG;
    ?>
</center></th>
						<th class="title"><center><?php 
    echo _JNEWS_TEMPLATE_DESC;
    ?>
</center></th>
					</tr>
				</thead>
				<tr class="row0" onclick="insertjnewstag('{tag:subscriptions}')">
					<td>
						<strong><?php 
    echo '{tag:subscriptions}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    echo _JNEWS_TAG_SUBSCRIPTION_DESC;
    ?>
					</td>
				</tr>
				<tr class="row1" onclick="insertjnewstag('{tag:unsubscribe}')">
					<td>
						<strong><?php 
    echo '{tag:unsubscribe}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    echo _JNEWS_TAG_UNSUBSCRIBE_DESC;
    ?>
					</td>
				</tr>
				<tr class="row0" onclick="insertjnewstag('{tag:confirm}')">
					<td>
						<strong><?php 
    echo '{tag:confirm}';
    ?>
</strong>
					</td>
					<td>
						<?php 
    echo _JNEWS_TAG_CONFIRM_DESC;
    ?>
					</td>
				</tr>
			</tbody>
		</table>

	</div>
	<div class="b">
	<div class="b">
	<div class="b"></div>
	</div>
	</div>
</div>
<?php 
}
Пример #13
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();
    }