Example #1
0
/**
* Saves the content item an edit form submit
* @param database A database connector object
*/
function saveContent($sectionid, $task)
{
    global $database, $my, $mainframe, $mosConfig_offset;
    $menu = mosGetParam($_POST, 'menu', 'mainmenu');
    $menuid = mosGetParam($_POST, 'menuid', 0);
    $row = new mosContent($database);
    if (!$row->bind($_POST)) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    $isNew = $row->id < 1;
    if ($isNew) {
        //$row->created		= $row->created ? $row->created : date( "Y-m-d H:i:s" );
        $row->created = $row->created ? mosFormatDate($row->created, '%Y-%m-%d %H:%M:%S', -$mosConfig_offset * 60 * 60) : date("Y-m-d H:i:s");
        $row->created_by = $row->created_by ? $row->created_by : $my->id;
    } else {
        $row->modified = date("Y-m-d H:i:s");
        $row->modified_by = $my->id;
    }
    if (strlen(trim($row->publish_up)) <= 10) {
        $row->publish_up .= " 00:00:00";
    }
    $row->publish_up = mosFormatDate($row->publish_up, '%Y-%m-%d %H:%M:%S', -$mosConfig_offset);
    if (trim($row->publish_down) == T_("Never")) {
        $row->publish_down = "0000-00-00 00:00:00";
    }
    $row->state = mosGetParam($_REQUEST, 'published', 0);
    $params = mosGetParam($_POST, 'params', '');
    if (is_array($params)) {
        $txt = array();
        foreach ($params as $k => $v) {
            $txt[] = "{$k}={$v}";
        }
        $row->attribs = implode("\n", $txt);
    }
    // code cleaner for xhtml transitional compliance
    $row->introtext = str_replace('<br>', '<br />', $row->introtext);
    $row->fulltext = str_replace('<br>', '<br />', $row->fulltext);
    // remove <br /> take being automatically added to empty fulltext
    $length = strlen($row->fulltext) < 9;
    $search = strstr($row->fulltext, '<br />');
    if ($length && $search) {
        $row->fulltext = NULL;
    }
    if (!$row->check()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    $row->version++;
    if (!$row->store()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    // manage frontpage items
    require_once $mainframe->getPath('class', 'com_frontpage');
    $fp = new mosFrontPage($database);
    if (mosGetParam($_REQUEST, 'frontpage', 0)) {
        // toggles go to first place
        if (!$fp->load($row->id)) {
            // new entry
            $database->setQuery("INSERT INTO #__content_frontpage VALUES ('{$row->id}','1')");
            if (!$database->query()) {
                echo "<script> alert('" . $database->stderr() . "');</script>\n";
                exit;
            }
            $fp->ordering = 1;
        }
    } else {
        // no frontpage mask
        if (!$fp->delete($row->id)) {
            $msg .= $fp->stderr();
        }
        $fp->ordering = 0;
    }
    $fp->updateOrder();
    $row->checkin();
    $row->updateOrder("catid='{$row->catid}' AND state >= 0");
    $redirect = mosGetParam($_POST, 'redirect', $sectionid);
    switch ($task) {
        case 'go2menu':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu);
            break;
        case 'go2menuitem':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu . '&task=edit&hidemainmenu=1&id=' . $menuid);
            break;
        case 'menulink':
            menuLink($redirect, $row->id);
            break;
        case 'resethits':
            resethits($redirect, $row->id);
            break;
        case 'apply':
            $msg = T_('Successfully Saved changes to Item: ') . $row->title;
            mosRedirect('index2.php?option=com_content&sectionid=' . $redirect . '&task=edit&hidemainmenu=1&id=' . $row->id, $msg);
        case 'save':
        default:
            $msg = T_('Successfully Saved Item: ') . $row->title;
            mosRedirect('index2.php?option=com_content&sectionid=' . $redirect, $msg);
            break;
    }
}
Example #2
0
 function checkedOut(&$row, $overlib = 1)
 {
     $hover = '';
     if ($overlib) {
         $date = mosFormatDate($row->checked_out_time, '%A, %d %B %Y');
         $time = mosFormatDate($row->checked_out_time, '%H:%M');
         $checked_out_text = '<table>';
         $checked_out_text .= '<tr><td>' . $row->editor . '</td></tr>';
         $checked_out_text .= '<tr><td>' . $date . '</td></tr>';
         $checked_out_text .= '<tr><td>' . $time . '</td></tr>';
         $checked_out_text .= '</table>';
         $hover = 'onMouseOver="return overlib(\'' . $checked_out_text . '\', CAPTION, \'' . T_('Checked Out') . '\', BELOW, RIGHT);" onMouseOut="return nd();"';
     }
     $checked = '<img src="images/checked_out.png" ' . $hover . '/>';
     return $checked;
 }
/**
* Saves the typed content item
*/
function save($option, $task)
{
    global $database, $my, $mosConfig_offset;
    josSpoofCheck();
    $nullDate = $database->getNullDate();
    $menu = strval(mosGetParam($_POST, 'menu', 'mainmenu'));
    $menuid = intval(mosGetParam($_POST, 'menuid', 0));
    $row = new mosContent($database);
    if (!$row->bind($_POST)) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    if ($row->id) {
        $row->modified = date('Y-m-d H:i:s');
        $row->modified_by = $my->id;
    }
    $row->created_by = $row->created_by ? $row->created_by : $my->id;
    if ($row->created && strlen(trim($row->created)) <= 10) {
        $row->created .= ' 00:00:00';
    }
    $row->created = $row->created ? mosFormatDate($row->created, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset) : date('Y-m-d H:i:s');
    if (strlen(trim($row->publish_up)) <= 10) {
        $row->publish_up .= ' 00:00:00';
    }
    $row->publish_up = mosFormatDate($row->publish_up, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    if (trim($row->publish_down) == 'Never' || trim($row->publish_down) == '') {
        $row->publish_down = $nullDate;
    } else {
        if (strlen(trim($row->publish_down)) <= 10) {
            $row->publish_down .= ' 00:00:00';
        }
        $row->publish_down = mosFormatDate($row->publish_down, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    }
    $row->state = intval(mosGetParam($_REQUEST, 'published', 0));
    // Save Parameters
    $params = mosGetParam($_POST, 'params', '');
    if (is_array($params)) {
        $txt = array();
        foreach ($params as $k => $v) {
            $txt[] = "{$k}={$v}";
        }
        $row->attribs = implode("\n", $txt);
    }
    // code cleaner for xhtml transitional compliance
    $row->introtext = str_replace('<br>', '<br />', $row->introtext);
    $row->title = ampReplace($row->title);
    if (!$row->check()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    if (!$row->store()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    $row->checkin();
    // clean any existing cache files
    mosCache::cleanCache('com_content');
    switch ($task) {
        case 'go2menu':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu);
            break;
        case 'go2menuitem':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu . '&task=edit&hidemainmenu=1&id=' . $menuid);
            break;
        case 'menulink':
            menuLink($option, $row->id);
            break;
        case 'resethits':
            resethits($option, $row->id);
            break;
        case 'save':
            $msg = 'Typed Content Item saved';
            mosRedirect('index2.php?option=' . $option, $msg);
            break;
        case 'apply':
        default:
            $msg = 'Changes to Typed Content Item saved';
            mosRedirect('index2.php?option=' . $option . '&task=edit&hidemainmenu=1&id=' . $row->id, $msg);
            break;
    }
}
Example #4
0
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
global $mosConfig_offset;
$count = intval($params->get('count', 10));
$moduleclass_sfx = $params->get('moduleclass_sfx');
$now = date('Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60);
$query = "SELECT MONTH(created) AS created_month, created, id, sectionid, title, YEAR(created) AS created_year" . "\n FROM #__content" . "\n WHERE ( state='-1' AND checked_out='0' AND sectionid > '0' )" . "\n GROUP BY created_year DESC, created_month DESC LIMIT {$count}";
$database->setQuery($query);
$rows = $database->loadObjectList();
if (is_array($rows)) {
    ?>
<ul>
<?php 
    foreach ($rows as $row) {
        $created_month = mosFormatDate($row->created, "%m");
        $month_name = mosFormatDate($row->created, "%B");
        $created_year = mosFormatDate($row->created, "%Y");
        $link = sefRelToAbs('index.php?option=com_content&amp;task=archivecategory&amp;year=' . $created_year . '&amp;month=' . $created_month . '&amp;module=1');
        $text = $month_name . ', ' . $created_year;
        ?>
	<li>
	<a href="<?php 
        echo $link;
        ?>
">
	<?php 
        echo $text;
        ?>
	</a>
	</li>
	<?php 
    }
Example #5
0
 public static function formatDate($date = 'now', $format = null, $offset = null)
 {
     if ($format == 'DATETIME_FORMAT') {
         $format = null;
     }
     if (JCOMMENTS_JVERSION != '1.0') {
         if (empty($format)) {
             $format = JText::_('DATE_FORMAT_LC1');
         }
         if (JCOMMENTS_JVERSION == '1.7') {
             return JHTML::_('date', $date, $format);
         } else {
             return JHTML::_('date', $date, $format, $offset);
         }
     } else {
         if (!is_string($date)) {
             $date = strftime($format, (int) $date);
         }
         return mosFormatDate($date, $format, $offset);
     }
 }
Example #6
0
function AuthorDateLine(&$row, &$params)
{
    global $database;
    $text = '';
    if ($params->get('author')) {
        // Display Author name
        //Find Author Name
        $users_rows = new mosUser($database);
        $users_rows->load($row->created_by);
        $row->author = $users_rows->name;
        $row->usertype = $users_rows->usertype;
        if ($row->usertype == 'administrator' || $row->usertype == 'superadministrator') {
            $text .= "\n";
            $text .= _WRITTEN_BY . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
        } else {
            $text .= "\n";
            $text .= _AUTHOR_BY . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
        }
    }
    if ($params->get('createdate') && $params->get('author')) {
        // Display Separator
        $text .= "\n";
    }
    if ($params->get('createdate')) {
        // Display Created Date
        if (intval($row->created)) {
            $create_date = mosFormatDate($row->created);
            $text .= $create_date;
        }
    }
    if ($params->get('modifydate') && ($params->get('author') || $params->get('createdate'))) {
        // Display Separator
        $text .= "\n";
    }
    if ($params->get('modifydate')) {
        // Display Modified Date
        if (intval($row->modified)) {
            $mod_date = mosFormatDate($row->modified);
            $text .= _LAST_UPDATED . ' ' . $mod_date;
        }
    }
    $text .= "\n\n";
    return $text;
}
Example #7
0
    function _showTabPermissions(&$row, &$lists, &$last, &$created)
    {
        ?>
    	<table class="adminform">
    	<tr>
			<th colspan="2"><?php 
        echo _DML_TITLE_DOCPERMISSIONS;
        ?>
</th>
		<tr>
    	<tr>
    		<td width="250" align="right"><?php 
        echo _DML_OWNER;
        ?>
</td>
    		<td>
    		<?php 
        echo $lists['viewer'];
        echo DOCMAN_Utils::mosToolTip(_DML_OWNER_TOOLTIP . '</span>', _DML_OWNER);
        ?>
        	</td>
    	</tr>
    	<tr>
    		<td valign="top" align="right"><?php 
        echo _DML_MAINTAINER;
        ?>
</td>
    		<td>
    		<?php 
        echo $lists['maintainer'];
        echo DOCMAN_Utils::mosToolTip(_DML_MANT_TOOLTIP . '</span>', _DML_MAINTAINER);
        ?>
        	</td>
    	</tr>
    	<tr>
    		<td valign="top" align="right"><?php 
        echo _DML_CREATED_BY;
        ?>
</td>
    		<td>[<?php 
        echo $created[0]->name;
        ?>
] <i>on
    		<?php 
        echo mosFormatDate($row->dmdate_published);
        ?>
    		</i> </td>
    	</tr>
    	<tr>
    		<td valign="top" align="right"><?php 
        echo _DML_UPDATED_BY;
        ?>
</td>
    		<td>[<?php 
        echo $last[0]->name;
        ?>
]
    		<?php 
        if ($row->dmlastupdateon) {
            echo " <i>on " . mosFormatDate($row->dmlastupdateon);
        }
        ?>
    		</i>
    		</td>
    	</tr>
    	</table>
    	<?php 
    }
Example #8
0
/**
* Saves the content item an edit form submit
* @param database A database connector object
*/
function saveContent($sectionid, $task)
{
    global $database, $my, $mainframe, $mosConfig_offset;
    josSpoofCheck();
    $menu = strval(mosGetParam($_POST, 'menu', 'mainmenu'));
    $menuid = intval(mosGetParam($_POST, 'menuid', 0));
    $nullDate = $database->getNullDate();
    $row = new mosContent($database);
    if (!$row->bind($_POST)) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    // sanitise id field
    $row->id = (int) $row->id;
    if ($row->id) {
        $row->modified = date('Y-m-d H:i:s');
        $row->modified_by = $my->id;
    }
    $row->created_by = $row->created_by ? $row->created_by : $my->id;
    if ($row->created && strlen(trim($row->created)) <= 10) {
        $row->created .= ' 00:00:00';
    }
    $row->created = $row->created ? mosFormatDate($row->created, '%Y-%m-%d %H:%M:%S', -$mosConfig_offset) : date('Y-m-d H:i:s');
    if (strlen(trim($row->publish_up)) <= 10) {
        $row->publish_up .= ' 00:00:00';
    }
    $row->publish_up = mosFormatDate($row->publish_up, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    if (trim($row->publish_down) == 'Never' || trim($row->publish_down) == '') {
        $row->publish_down = $nullDate;
    } else {
        if (strlen(trim($row->publish_down)) <= 10) {
            $row->publish_down .= ' 00:00:00';
        }
        $row->publish_down = mosFormatDate($row->publish_down, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    }
    $row->state = intval(mosGetParam($_REQUEST, 'published', 0));
    $params = mosGetParam($_POST, 'params', '');
    if (is_array($params)) {
        $txt = array();
        foreach ($params as $k => $v) {
            if (get_magic_quotes_gpc()) {
                $v = stripslashes($v);
            }
            $txt[] = "{$k}={$v}";
        }
        $row->attribs = implode("\n", $txt);
    }
    // code cleaner for xhtml transitional compliance
    $row->introtext = str_replace('<br>', '<br />', $row->introtext);
    $row->fulltext = str_replace('<br>', '<br />', $row->fulltext);
    // remove <br /> take being automatically added to empty fulltext
    $length = strlen($row->fulltext) < 9;
    $search = strstr($row->fulltext, '<br />');
    if ($length && $search) {
        $row->fulltext = NULL;
    }
    $row->title = ampReplace($row->title);
    if (!$row->check()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    $row->version++;
    if (!$row->store()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    // manage frontpage items
    require_once $mainframe->getPath('class', 'com_frontpage');
    $fp = new mosFrontPage($database);
    if (intval(mosGetParam($_REQUEST, 'frontpage', 0))) {
        // toggles go to first place
        if (!$fp->load((int) $row->id)) {
            // new entry
            $query = "INSERT INTO #__content_frontpage" . "\n VALUES ( " . (int) $row->id . ", 1 )";
            $database->setQuery($query);
            if (!$database->query()) {
                echo "<script> alert('" . $database->stderr() . "');</script>\n";
                exit;
            }
            $fp->ordering = 1;
        }
    } else {
        // no frontpage mask
        if (!$fp->delete((int) $row->id)) {
            $msg .= $fp->stderr();
        }
        $fp->ordering = 0;
    }
    $fp->updateOrder();
    $row->checkin();
    $row->updateOrder("catid = " . (int) $row->catid . " AND state >= 0");
    // clean any existing cache files
    mosCache::cleanCache('com_content');
    $redirect = mosGetParam($_POST, 'redirect', $sectionid);
    switch ($task) {
        case 'go2menu':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu);
            break;
        case 'go2menuitem':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu . '&task=edit&hidemainmenu=1&id=' . $menuid);
            break;
        case 'menulink':
            menuLink($redirect, $row->id);
            break;
        case 'resethits':
            resethits($redirect, $row->id);
            break;
        case 'apply':
            $msg = 'Successfully Saved changes to Item: ' . $row->title;
            mosRedirect('index2.php?option=com_content&sectionid=' . $redirect . '&task=edit&hidemainmenu=1&id=' . $row->id, $msg);
            break;
        case 'save':
        default:
            $msg = 'Successfully Saved Item: ' . $row->title;
            mosRedirect('index2.php?option=com_content&sectionid=' . $redirect, $msg);
            break;
    }
}
Example #9
0
    function showUsers(&$rows, $pageNav, $search, $option)
    {
        global $mosConfig_offset, $adminLanguage;
        ?>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="user">
			<?php 
        echo $adminLanguage->A_MENU_USER_MANAGE;
        ?>
			</th>
			<td>
			<?php 
        echo $adminLanguage->A_COMP_FILTER;
        ?>
:
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="inputbox" onChange="document.adminForm.submit();" />
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="2%" class="title">
			<?php 
        echo $adminLanguage->A_COMP_NB;
        ?>
			</th>
			<th width="3%" class="title">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th width="20%" class="title">
			<?php 
        echo $adminLanguage->A_COMP_NAME;
        ?>
			</th>
			<th width="10%" class="title">
			<?php 
        echo $adminLanguage->A_COMP_USERS_ID;
        ?>
			</th>
			<th width="5%" class="title" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_USERS_LOG_IN;
        ?>
			</th>
			<th width="15%" class="title">
			<?php 
        echo $adminLanguage->A_COMP_MASS_GROUP;
        ?>
			</th>
			<th width="15%" class="title">
			<?php 
        echo $adminLanguage->A_COMP_EMAIL;
        ?>
			</th>
			<th width="15%" class="title">
			<?php 
        echo $adminLanguage->A_COMP_USERS_LAST;
        ?>
			</th>
			<th width="10%" class="title">
			<?php 
        echo $adminLanguage->A_COMP_STAT_ENABLED;
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $img = $row->block ? 'publish_x.png' : 'tick.png';
            $task = $row->block ? 'unblock' : 'block';
            $alt = $row->block ? $adminLanguage->A_COMP_STAT_ENABLED : $adminLanguage->A_COMP_USERS_BLOCKED;
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
			<td>
			<?php 
            echo $i + 1 + $pageNav->limitstart;
            ?>
			</td>
			<td>
			<?php 
            echo mosHTML::idBox($i, $row->id);
            ?>
			</td>
			<td>
			<a href="#edit" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','edit')">
			<?php 
            echo $row->name;
            ?>
			</a>
			</td>
			<td>
			<?php 
            echo $row->username;
            ?>
			</td>
			<td align="center">
			<?php 
            echo $row->loggedin ? '<img src="images/tick.png" width="12" height="12" border="0" alt="" />' : '';
            ?>
			</td>
			<td>
			<?php 
            echo $row->groupname;
            ?>
			</td>
			<td>
			<a href="mailto:<?php 
            echo $row->email;
            ?>
">
			<?php 
            echo $row->email;
            ?>
			</a>
			</td>
			<td>
			<?php 
            echo mosFormatDate($row->lastvisitDate, "%Y-%m-%d %H:%M:%S");
            ?>
			</td>
			<td width="10%">
			<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
			<img src="images/<?php 
            echo $img;
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $alt;
            ?>
" />
			</a>
			</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
		<?php 
    }
Example #10
0
function dofreePDF($database)
{
    global $mosConfig_live_site, $mosConfig_sitename, $mosConfig_offset, $mosConfig_hideCreateDate, $mosConfig_hideAuthor, $mosConfig_hideModifyDate;
    $id = intval(mosGetParam($_REQUEST, 'id', 1));
    // Access check
    global $gid;
    $now = date('Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60);
    $query = "SELECT COUNT(a.id)" . "\n FROM #__content AS a" . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope='content'" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" . "\n WHERE a.id='" . $id . "' " . "\n AND (a.state = '1' OR a.state = '-1')" . "\n AND (publish_up = '0000-00-00 00:00:00' OR publish_up <= '{$now}')" . "\n AND (publish_down = '0000-00-00 00:00:00' OR publish_down >= '{$now}')" . "\n AND a.access <= " . intval($gid);
    $database->setQuery($query);
    if (!$database->loadResult()) {
        exit(T_('You are not authorized to view this resource.'));
    }
    include 'includes/class.ezpdf.php';
    $row = new mosContent($database);
    $row->load($id);
    //Find Author Name
    $users_rows = new mosUser($database);
    $users_rows->load($row->created_by);
    $row->author = $users_rows->name;
    $row->usertype = $users_rows->usertype;
    // Ugly but needed to get rid of all the stuff the PDF class cant handle
    $row->fulltext = str_replace('<p>', "\n\n", $row->fulltext);
    $row->fulltext = str_replace('<P>', "\n\n", $row->fulltext);
    $row->fulltext = str_replace('<br />', "\n", $row->fulltext);
    $row->fulltext = str_replace('<br>', "\n", $row->fulltext);
    $row->fulltext = str_replace('<BR />', "\n", $row->fulltext);
    $row->fulltext = str_replace('<BR>', "\n", $row->fulltext);
    $row->fulltext = str_replace('<li>', "\n - ", $row->fulltext);
    $row->fulltext = str_replace('<LI>', "\n - ", $row->fulltext);
    $row->fulltext = strip_tags($row->fulltext);
    $row->fulltext = str_replace('{mosimage}', '', $row->fulltext);
    $row->fulltext = str_replace('{mospagebreak}', '', $row->fulltext);
    $row->fulltext = decodeHTML($row->fulltext);
    $row->introtext = str_replace('<p>', "\n\n", $row->introtext);
    $row->introtext = str_replace('<P>', "\n\n", $row->introtext);
    $row->introtext = str_replace('<li>', "\n - ", $row->introtext);
    $row->introtext = str_replace('<LI>', "\n - ", $row->introtext);
    $row->introtext = strip_tags($row->introtext);
    $row->introtext = str_replace('{mosimage}', '', $row->introtext);
    $row->introtext = str_replace('{mospagebreak}', '', $row->introtext);
    $row->introtext = decodeHTML($row->introtext);
    $pdf =& new Cezpdf('a4', 'P');
    //A4 Portrait
    $pdf->ezSetCmMargins(2, 1.5, 1, 1);
    $pdf->selectFont('./fonts/Helvetica.afm');
    //choose font
    $all = $pdf->openObject();
    $pdf->saveState();
    $pdf->setStrokeColor(0, 0, 0, 1);
    // footer
    $pdf->line(10, 40, 578, 40);
    $pdf->line(10, 822, 578, 822);
    $pdf->addText(30, 34, 6, $mosConfig_live_site . ' - ' . $mosConfig_sitename);
    $pdf->addText(250, 34, 6, T_('Powered by Mambo'));
    $pdf->addText(450, 34, 6, T_('Generated:') . date('j F, Y, H:i', time() + $mosConfig_offset * 60 * 60));
    $pdf->restoreState();
    $pdf->closeObject();
    $pdf->addObject($all, 'all');
    $pdf->ezSetDy(30);
    $txt1 = $row->title;
    $pdf->ezText($txt1, 14);
    $txt2 = NULL;
    $mod_date = NULL;
    $create_date = NULL;
    if (intval($row->modified) != 0) {
        $mod_date = mosFormatDate($row->modified);
    }
    if (intval($row->created) != 0) {
        $create_date = mosFormatDate($row->created);
    }
    if ($mosConfig_hideCreateDate == '0') {
        $txt2 .= '(' . $create_date . ') - ';
    }
    if ($mosConfig_hideAuthor == "0") {
        if ($row->author != '' && $mosConfig_hideAuthor == '0') {
            if ($row->usertype == 'administrator' || $row->usertype == 'superadministrator') {
                $txt2 .= T_('Written by') . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
            } else {
                $txt2 .= T_('Contributed by') . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
            }
        }
    }
    if ($mosConfig_hideModifyDate == "0") {
        $txt2 .= ' - ' . T_('Last Updated') . ' (' . $mod_date . ') ';
    }
    $txt2 .= "\n\n";
    $pdf->ezText($txt2, 8);
    $txt3 = $row->introtext . "\n" . $row->fulltext;
    $pdf->ezText($txt3, 10);
    $pdf->ezStream();
}
Example #11
0
File: pdf.php Project: cwcw/cms
function dofreePDF($database)
{
    global $mosConfig_live_site, $mosConfig_sitename, $mosConfig_offset, $mosConfig_hideCreateDate, $mosConfig_hideAuthor, $mosConfig_hideModifyDate;
    $id = intval(mosGetParam($_REQUEST, 'id', 1));
    include 'includes/class.ezpdf.php';
    $row = new mosContent($database);
    $row->load($id);
    //Find Author Name
    $users_rows = new mosUser($database);
    $users_rows->load($row->created_by);
    $row->author = $users_rows->name;
    $row->usertype = $users_rows->usertype;
    // Ugly but needed to get rid of all the stuff the PDF class cant handle
    $row->fulltext = str_replace('<p>', "\n\n", $row->fulltext);
    $row->fulltext = str_replace('<P>', "\n\n", $row->fulltext);
    $row->fulltext = str_replace('<br />', "\n", $row->fulltext);
    $row->fulltext = str_replace('<br>', "\n", $row->fulltext);
    $row->fulltext = str_replace('<BR />', "\n", $row->fulltext);
    $row->fulltext = str_replace('<BR>', "\n", $row->fulltext);
    $row->fulltext = str_replace('<li>', "\n - ", $row->fulltext);
    $row->fulltext = str_replace('<LI>', "\n - ", $row->fulltext);
    $row->fulltext = strip_tags($row->fulltext);
    $row->fulltext = str_replace('{mosimage}', '', $row->fulltext);
    $row->fulltext = str_replace('{mospagebreak}', '', $row->fulltext);
    $row->fulltext = decodeHTML($row->fulltext);
    $row->introtext = str_replace('<p>', "\n\n", $row->introtext);
    $row->introtext = str_replace('<P>', "\n\n", $row->introtext);
    $row->introtext = str_replace('<li>', "\n - ", $row->introtext);
    $row->introtext = str_replace('<LI>', "\n - ", $row->introtext);
    $row->introtext = strip_tags($row->introtext);
    $row->introtext = str_replace('{mosimage}', '', $row->introtext);
    $row->introtext = str_replace('{mospagebreak}', '', $row->introtext);
    $row->introtext = decodeHTML($row->introtext);
    $pdf =& new Cezpdf('a4', 'P');
    //A4 Portrait
    $pdf->ezSetCmMargins(2, 1.5, 1, 1);
    $pdf->selectFont('./fonts/Helvetica.afm');
    //choose font
    $all = $pdf->openObject();
    $pdf->saveState();
    $pdf->setStrokeColor(0, 0, 0, 1);
    // footer
    $pdf->line(10, 40, 578, 40);
    $pdf->line(10, 822, 578, 822);
    $pdf->addText(30, 34, 6, $mosConfig_live_site . ' - ' . $mosConfig_sitename);
    $pdf->addText(250, 34, 6, 'Powered by Mambo');
    $pdf->addText(450, 34, 6, 'Generated: ' . date('j F, Y, H:i', time() + $mosConfig_offset * 60 * 60));
    $pdf->restoreState();
    $pdf->closeObject();
    $pdf->addObject($all, 'all');
    $pdf->ezSetDy(30);
    $txt1 = $row->title;
    $pdf->ezText($txt1, 14);
    $txt2 = NULL;
    $mod_date = NULL;
    $create_date = NULL;
    if (intval($row->modified) != 0) {
        $mod_date = mosFormatDate($row->modified);
    }
    if (intval($row->created) != 0) {
        $create_date = mosFormatDate($row->created);
    }
    if ($mosConfig_hideCreateDate == '0') {
        $txt2 .= '(' . $create_date . ') - ';
    }
    if ($mosConfig_hideAuthor == "0") {
        if ($row->author != '' && $mosConfig_hideAuthor == '0') {
            if ($row->usertype == 'administrator' || $row->usertype == 'superadministrator') {
                $txt2 .= _WRITTEN_BY . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
            } else {
                $txt2 .= _AUTHOR_BY . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
            }
        }
    }
    if ($mosConfig_hideModifyDate == "0") {
        $txt2 .= ' - ' . _LAST_UPDATED . ' (' . $mod_date . ') ';
    }
    $txt2 .= "\n\n";
    $pdf->ezText($txt2, 8);
    $txt3 = $row->introtext . "\n" . $row->fulltext;
    $pdf->ezText($txt3, 10);
    $pdf->ezStream();
}
Example #12
0
 function checkedOut(&$row, $overlib = 1)
 {
     $hover = '';
     if ($overlib) {
         $date = mosFormatDate($row->checked_out_time, '%A, %d %B %Y');
         $time = mosFormatDate($row->checked_out_time, '%H:%M');
         $editor = addslashes(htmlspecialchars(html_entity_decode($row->editor, ENT_QUOTES)));
         $checked_out_text = '<table>';
         $checked_out_text .= '<tr><td>' . $editor . '</td></tr>';
         $checked_out_text .= '<tr><td>' . $date . '</td></tr>';
         $checked_out_text .= '<tr><td>' . $time . '</td></tr>';
         $checked_out_text .= '</table>';
         $hover = 'onMouseOver="return overlib(\'' . $checked_out_text . '\', CAPTION, \'Bloqueado\', BELOW, RIGHT);" onMouseOut="return nd();"';
     }
     $checked = '<img src="images/checked_out.png" ' . $hover . '/>';
     return $checked;
 }
Example #13
0
    function showUsers(&$rows, $pageNav, $search, $option, $lists)
    {
        global $mosConfig_offset;
        ?>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="user">
			<?php 
        echo T_('User Manager');
        ?>
			</th>
			<td>
			<?php 
        echo T_('Filter:');
        ?>
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="inputbox" onChange="document.adminForm.submit();" />
			</td>
			<td width="right">
			<?php 
        echo $lists['type'];
        ?>
			</td>
			<td width="right">
			<?php 
        echo $lists['logged'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="2%" class="title">
			#
			</th>
			<th width="3%" class="title">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			<?php 
        echo T_('Name');
        ?>
			</th>
			<th width="5%" class="title" nowrap="nowrap">
			<?php 
        echo T_('Logged In');
        ?>
			</th>
			<th width="5%" class="title">
			<?php 
        echo T_('Enabled');
        ?>
			</th>
			<th width="15%" class="title" >
			<?php 
        echo T_('UserID');
        ?>
			</th>
			<th width="15%" class="title">
			<?php 
        echo T_('Group');
        ?>
			</th>
			<th width="15%" class="title">
			<?php 
        echo T_('E-Mail');
        ?>
			</th>
			<th width="10%" class="title">
			<?php 
        echo T_('Last Visit');
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $img = $row->block ? 'publish_x.png' : 'tick.png';
            $task = $row->block ? 'unblock' : 'block';
            $alt = $row->block ? 'Enabled' : 'Blocked';
            $link = 'index2.php?option=com_users&amp;task=editA&amp;id=' . $row->id . '&amp;hidemainmenu=1';
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $i + 1 + $pageNav->limitstart;
            ?>
				</td>
				<td>
				<?php 
            echo mosHTML::idBox($i, $row->id);
            ?>
				</td>
				<td>
				<a href="<?php 
            echo $link;
            ?>
">
				<?php 
            echo $row->name;
            ?>
				</a>
				</td>
				<td align="center">
				<?php 
            echo $row->loggedin ? '<img src="images/tick.png" width="12" height="12" border="0" alt="" />' : '';
            ?>
				</td>
				<td>
				<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
				<img src="images/<?php 
            echo $img;
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $alt;
            ?>
" />
				</a>
				</td>
				<td>
				<?php 
            echo $row->username;
            ?>
				</td>
				<td>
				<?php 
            echo $row->groupname;
            ?>
				</td>
				<td>
				<a href="mailto:<?php 
            echo $row->email;
            ?>
">
				<?php 
            echo $row->email;
            ?>
				</a>
				</td>
				<td nowrap="nowrap">
				<?php 
            echo mosFormatDate($row->lastvisitDate, "%Y-%m-%d %H:%M:%S");
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		</form>
		<?php 
    }
    function edit(&$row, &$images, &$lists, &$params, $option, &$menus)
    {
        global $database;
        mosMakeHtmlSafe($row);
        $create_date = null;
        $mod_date = null;
        $nullDate = $database->getNullDate();
        if ($row->created != $nullDate) {
            $create_date = mosFormatDate($row->created, '%A, %d %B %Y %H:%M', '0');
        }
        if ($row->modified != $nullDate) {
            $mod_date = mosFormatDate($row->modified, '%A, %d %B %Y %H:%M', '0');
        }
        $tabs = new mosTabs(1);
        // used to hide "Reset Hits" when hits = 0
        if (!$row->hits) {
            $visibility = "style='display: none; visibility: hidden;'";
        } else {
            $visibility = "";
        }
        mosCommonHTML::loadOverlib();
        mosCommonHTML::loadCalendar();
        ?>
		<script language="javascript" type="text/javascript">
		var folderimages = new Array;
		<?php 
        $i = 0;
        foreach ($images as $k => $items) {
            foreach ($items as $v) {
                echo "folderimages[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "' );\t";
            }
        }
        ?>
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}

			if ( pressbutton ==' resethits' ) {
				if (confirm('Tem certeza que deseja reiniciar o contador de Acessos ? \nQualquer alteração não salva deste conteúdo será perdida.')){
					submitform( pressbutton );
					return;
				} else {
					return;
				}
			}

			if ( pressbutton == 'menulink' ) {
				if ( form.menuselect.value == "" ) {
					alert( "Por favor, selecione um menu" );
					return;
				} else if ( form.link_name.value == "" ) {
					alert( "Por favor, informe um nome para este item do menu" );
					return;
				}
			}

			var temp = new Array;
			for (var i=0, n=form.imagelist.options.length; i < n; i++) {
				temp[i] = form.imagelist.options[i].value;
			}
			form.images.value = temp.join( '\n' );

			try {
				document.adminForm.onsubmit();
			}
			catch(e){}
			if (trim(form.title.value) == ""){
				alert( "Item de conteúdo deve possuir um título" );
			} else if (trim(form.name.value) == ""){
				alert( "Item de conteúdo deve possuir um nome" );
			} else {
				if ( form.reset_hits.checked ) {
					form.hits.value = 0;
				} else {
				}
				<?php 
        getEditorContents('editor1', 'introtext');
        ?>
				submitform( pressbutton );
			}
		}
		</script>

		<table class="adminheading">
		<tr>
			<th class="edit">
			Item de Conteúdo Estático:
			<small>
			<?php 
        echo $row->id ? 'Editar' : 'Novo';
        ?>
			</small>
			</th>
		</tr>
		</table>

		<form action="index2.php" method="post" name="adminForm">

		<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td width="60%" valign="top">
				<table class="adminform">
				<tr>
					<th colspan="3">
					Detalhes do Item
					</th>
				</tr>
				<tr>
					<td align="left">
					Título:
					</td>
					<td>
					<input class="inputbox" type="text" name="title" size="30" maxlength="100" value="<?php 
        echo $row->title;
        ?>
" />
					</td>
				</tr>
				<tr>
					<td align="left">
					Sub-título:
					</td>
					<td>
					<input class="inputbox" type="text" name="title_alias" size="30" maxlength="100" value="<?php 
        echo $row->title_alias;
        ?>
" />
					</td>
				</tr>
				<tr>
					<td valign="top" align="left" colspan="2">
					Texto: (necessário)<br />
					<?php 
        // parameters : areaname, content, hidden field, width, height, rows, cols
        editorArea('editor1', $row->introtext, 'introtext', '100%;', '500', '75', '50');
        ?>
					</td>
				</tr>
				</table>
			</td>
			<td width="40%" valign="top">
				<?php 
        $tabs->startPane("content-pane");
        $tabs->startTab("Publicar", "publish-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Info da Publicação
					</th>
				</tr>
				<tr>
					<td valign="top" align="right" width="120">
					State:
					</td>
					<td>
					<?php 
        echo $row->state > 0 ? 'Publicado' : 'Rascunho Não Publicado';
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Publicado:
					</td>
					<td>
					<input type="checkbox" name="published" value="1" <?php 
        echo $row->state ? 'checked="checked"' : '';
        ?>
 />
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Nível de Acesso:
					</td>
					<td>
					<?php 
        echo $lists['access'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Apelido do Autor:
					</td>
					<td>
					<input type="text" name="created_by_alias" size="30" maxlength="100" value="<?php 
        echo $row->created_by_alias;
        ?>
" class="inputbox" />
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Alterar Autor:
					</td>
					<td>
					<?php 
        echo $lists['created_by'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Alterar Data de Criação
					</td>
					<td>
					<input class="inputbox" type="text" name="created" id="created" size="25" maxlength="19" value="<?php 
        echo $row->created;
        ?>
" />
					<input name="reset" type="reset" class="button" onClick="return showCalendar('created', 'y-mm-dd');" value="...">
					</td>
				</tr>
				<tr>
					<td align="right">
					Início da Publicação:
					</td>
					<td>
					<input class="inputbox" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php 
        echo $row->publish_up;
        ?>
" />
					<input type="reset" class="button" value="..." onclick="return showCalendar('publish_up', 'y-mm-dd');">
					</td>
				</tr>
				<tr>
					<td align="right">
					Fim da Publicação:
					</td>
					<td>
					<input class="inputbox" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php 
        echo $row->publish_down;
        ?>
" />
					<input type="reset" class="button" value="..." onclick="return showCalendar('publish_down', 'y-mm-dd');">
					</td>
				</tr>
				</table>
				<br />
				<table class="adminform" width="100%">
				<?php 
        if ($row->id) {
            ?>
					<tr>
						<td>
						<strong>ID Conteúdo:</strong>
						</td>
						<td>
						<?php 
            echo $row->id;
            ?>
						</td>
					</tr>
					<?php 
        }
        ?>
				<tr>
					<td width="120" valign="top" align="right">
					  <strong>Estado:</strong> </td>
					</td>
					<td>
					<?php 
        echo $row->state > 0 ? 'Publicado' : ($row->state < 0 ? 'Arquivado' : 'Rascunho Não Publicado');
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>Acessos:</strong>
					</td>
					<td>
					<?php 
        echo $row->hits;
        ?>
					<div <?php 
        echo $visibility;
        ?>
>
					<input name="reset_hits" type="button" class="button" value="Reiniciar Contagem" onClick="submitbutton('resethits');">
					</div>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>Revisão:</strong>
					</td>
					<td>
					<?php 
        echo $row->version;
        ?>
 vez(es)
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>Criado:</strong>
					</td>
					<td>
						<?php 
        if (!$create_date) {
            ?>
							novo documento
							<?php 
        } else {
            echo $create_date;
        }
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>Última Alteração</strong>
					</td>
					<td>
						<?php 
        if (!$mod_date) {
            ?>
							não alterado
							<?php 
        } else {
            echo $mod_date;
            ?>
							<br />
							<?php 
            echo $row->modifier;
        }
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>Expira</strong>
					</td>
					<td>
					<?php 
        echo "{$row->publish_down}";
        ?>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Images", "images-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
						Controle de MOSImage
					</th>
				</tr>
				<tr>
					<td colspan="2">
						<table width="100%">
						<tr>
							<td width="48%" valign="top">
								<div align="center">
									Imagens na Galeria:
									<br />
									<?php 
        echo $lists['imagefiles'];
        ?>
								</div>
							</td>
							<td width="2%">
								<input class="button" type="button" value=">>" onclick="addSelectedToList('adminForm','imagefiles','imagelist')" title="Adicionar"/>
								<br/>
								<input class="button" type="button" value="<<" onclick="delSelectedFromList('adminForm','imagelist')" title="Remover"/>
							</td>
							<td width="48%">
								<div align="center">
									Imagens no Artigo:
									<br />
									<?php 
        echo $lists['imagelist'];
        ?>
									<br />
									<input class="button" type="button" value="Para cima" onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,-1)" />
									<input class="button" type="button" value="Para baixo" onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,+1)" />
								</div>
							</td>
						</tr>
						</table>
						Sub-folder: <?php 
        echo $lists['folders'];
        ?>
					</td>
				</tr>
				<tr valign="top">
					<td>
						<div align="center">
							Imagem de amostra:<br/>
							<img name="view_imagefiles" src="../images/M_images/blank.png" width="100" />
						</div>
					</td>
					<td valign="top">
						<div align="center">
							Imagem Ativa:<br/>
							<img name="view_imagelist" src="../images/M_images/blank.png" width="100" />
						</div>
					</td>
				</tr>
				<tr>
					<td>
					<b>Editar a imagem selecionada:</b>
						<table>
						<tr>
							<td align="right">
							Fonte:
							</td>
							<td>
							<input type="text" name= "_source" value="" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Alinhamento:
							</td>
							<td>
							<?php 
        echo $lists['_align'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							Texto Alt:
							</td>
							<td>
							<input type="text" name="_alt" value="" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Borda:
							</td>
							<td>
							<input type="text" name="_border" value="" size="3" maxlength="1" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Legenda:
							</td>
							<td>
							<input class="text_area" type="text" name="_caption" value="" size="30" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Legenda - Posição:
							</td>
							<td>
							<?php 
        echo $lists['_caption_position'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							Legenda - Alinhamento:
							</td>
							<td>
							<?php 
        echo $lists['_caption_align'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							Legenda - Largura:
							</td>
							<td>
							<input class="text_area" type="text" name="_width" value="" size="5" maxlength="5" />
							</td>
						</tr>
						<tr>
							<td colspan="2">
							<input class="button" type="button" value="Aplicar" onClick="applyImageProps()" />
							</td>
						</tr>
						</table>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Parâmetros", "params-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Controle de Parâmetros
					</th>
				</tr>
				<tr>
					<td>
					<?php 
        echo $params->render();
        ?>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Meta dados", "metadata-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Meta Dados
					</th>
				</tr>
				<tr>
					<td align="left">
					Descrição:<br />
					<textarea class="inputbox" cols="40" rows="5" name="metadesc" style="width:300px"><?php 
        echo str_replace('&', '&amp;', $row->metadesc);
        ?>
</textarea>
					</td>
				</tr>
				<tr>
					<td align="left">
					Palavras Chaves:<br />
					<textarea class="inputbox" cols="40" rows="5" name="metakey" style="width:300px"><?php 
        echo str_replace('&', '&amp;', $row->metakey);
        ?>
</textarea>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Link para Menu", "link-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Link para Menu
					</th>
				</tr>
				<tr>
					<td colspan="2">
					Isto irá criar um 'Link - Item de Conteúdo' no menu que você selecionou
					<br /><br />
					</td>
				</tr>
				<tr>
					<td valign="top" width="90px">
					Selecione um Menu
					</td>
					<td>
					<?php 
        echo $lists['menuselect'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" width="90px">
					Nome do menu
					</td>
					<td>
					<input type="text" name="link_name" class="inputbox" value="" size="30" />
					</td>
				</tr>
				<tr>
					<td>
					</td>
					<td>
					<input name="menu_link" type="button" class="button" value="Link para Menu" onClick="submitbutton('menulink');" />
					</td>
				</tr>
				<tr>
					<th colspan="2">
					Links de Menu Existentes
					</th>
				</tr>
				<?php 
        if ($menus == NULL) {
            ?>
					<tr>
						<td colspan="2">
						Nenhum
						</td>
					</tr>
					<?php 
        } else {
            mosCommonHTML::menuLinksContent($menus);
        }
        ?>
				<tr>
					<td colspan="2">
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->endPane();
        ?>
			</td>
		</tr>
		</table>

		<input type="hidden" name="images" value="" />
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="hits" value="<?php 
        echo $row->hits;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }
    function JLMS_showCertificatesList(&$rows, &$pageNav, $option, &$lists)
    {
        ?>
<form action="index.php" method="post" name="adminForm">
<table width="100%" >
	<tr>
		<td valign="top" width="220">
		<div>
			<?php 
        echo joomla_lms_adm_html::JLMS_menu();
        ?>
		</div>
		</td>
		<td valign="top" align="right">		
		<?php 
        if (!class_exists('JToolBarHelper')) {
            ?>
		<table class="adminheading" cellpadding="0" cellspacing="0" border="0" style="width: 30%;">
		<tr>
			<th class="categories">
			<?php 
            echo _JOOMLMS_COMP_NAME;
            ?>
: <small><?php 
            echo _JLMS_CERTS_LIST;
            ?>
</small>
			</th>
			<td width="right">
				<table class="adminlist" ><tr class="row1">			
					<td align="left" width="100%">&nbsp;</td>		
					<td><?php 
            echo _JLMS_CERTS_FILTER;
            ?>
</td>
					<td><input name="filt_crtf" class="text_area" size="10" value="<?php 
            echo $lists['jlms_crtfs'];
            ?>
" /></td>
					<td><?php 
            echo $lists['jlms_users'];
            ?>
</td>
					<td><?php 
            echo $lists['jlms_courses'];
            ?>
</td>
				</tr></table>
			</td>
		</tr>
		</table>
		<?php 
        } else {
            JToolBarHelper::title(_JOOMLMS_COMP_NAME . ': ' . _JLMS_CERTS_LIST);
            ?>
		
		<table cellpadding="0" cellspacing="0" border="0" class="adminlist" style="width: 30%;">
		<tr class="row1">
			<td align="left" width="100%">&nbsp;</td>			
			<td><?php 
            echo _JLMS_CERTS_FILTER;
            ?>
</td>
			<td><input name="filt_crtf" class="text_area" size="10" value="<?php 
            echo $lists['jlms_crtfs'];
            ?>
" /></td>
			<td><?php 
            echo $lists['jlms_users'];
            ?>
</td>
			<td><?php 
            echo $lists['jlms_courses'];
            ?>
</td>
		</tr>
		</table>
		<?php 
        }
        ?>
		
		<table width="100%" border="0">
			<tr>
				<td valign="top">
					<table class="adminlist">
					<thead>
						<tr>
							<th width="20" align="center">#</th>
							<th class="title"><?php 
        echo _JLMS_CERTS_SN;
        ?>
</th>
							<th class="title"><?php 
        echo _JLMS_CERTS_DATE;
        ?>
</th>
							<th class="title"><?php 
        echo _JLMS_CERTS_USER;
        ?>
</th>
							<th class="title"><?php 
        echo _JLMS_CERTS_COURSE_NAME;
        ?>
</th>
							<th class="title"><?php 
        echo _JLMS_CERTS_QUIZ_NAME;
        ?>
</th>
							<th class="title"><?php 
        echo _JLMS_CERTS_LAST_PRINTED;
        ?>
</th>
							<th class="title" width="20"><?php 
        echo _JLMS_CERTS_TYPE;
        ?>
</th>
						</tr>
					</thead>
					<tfoot>
						<tr>
							<td colspan="8">
							<?php 
        echo $pageNav->getListFooter();
        ?>
							</td>
						</tr>
					</tfoot>
					<tbody>
					<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            ?>
						<tr class="<?php 
            echo "row{$k}";
            ?>
">
							<td align="center"><?php 
            echo $pageNav->rowNumber($i);
            ?>
</td>
							<td><?php 
            echo $row->uniq_id;
            ?>
</td>
							<td><?php 
            echo mosFormatDate($row->crtf_date, '%Y-%m-%d');
            ?>
</td>
							<td><?php 
            $usually = true;
            if (!$row->cur_user) {
                echo "<span style='color:red'>" . _JLMS_CERTS_USER_REMOVED . "</span><br />";
                $usually = false;
            } elseif ($row->cur_name != $row->name || $row->cur_username != $row->username) {
                echo "<span style='color:green'>{$row->cur_name} ({$row->cur_username})</span><br />";
                $usually = false;
            }
            if (!$usually) {
                echo _JLMS_CERTS_PRINTED_AS . " <span style='color:red'>";
            }
            echo $row->name . " (" . $row->username . ")";
            if (!$usually) {
                echo "</span>";
            }
            ?>
							</td>
							<td><?php 
            $usually = true;
            if (!$row->course_name) {
                $row->course_name = $row->cur_course_name;
            }
            if (!$row->cur_course_name) {
                echo "<span style='color:red'>" . _JLMS_CERTS_REMOVED . "</span><br />";
                $usually = false;
            } elseif ($row->cur_course_name != $row->course_name) {
                echo "<span style='color:green'>{$row->cur_course_name}</span><br />";
                $usually = false;
            }
            if ($row->course_name) {
                if (!$usually) {
                    echo _JLMS_CERTS_OLD_NAME . " <span style='color:red'>";
                }
                echo $row->course_name;
                if (!$usually) {
                    echo "</span>";
                }
            }
            ?>
							</td>
							<td>
							<?php 
            if (!$row->quiz_id) {
                echo '-';
            } else {
                $usually = true;
                if (!$row->quiz_name) {
                    $row->quiz_name = $row->cur_quiz_name;
                }
                if (!$row->cur_quiz_name) {
                    echo "<span style='color:red'>" . _JLMS_CERTS_REMOVED . "</span><br />";
                    $usually = false;
                } elseif ($row->cur_quiz_name != $row->quiz_name) {
                    echo "<span style='color:green'>{$row->cur_quiz_name}</span><br />";
                    $usually = false;
                }
                if ($row->quiz_name) {
                    if (!$usually) {
                        echo _JLMS_CERTS_OLD_NAME . " <span style='color:red'>";
                    }
                    echo $row->quiz_name;
                    if (!$usually) {
                        echo "</span>";
                    }
                }
            }
            ?>
							</td>
							<td><?php 
            echo mosFormatDate($row->last_printed, '%Y-%m-%d');
            ?>
</td>
							<td><?php 
            $timg = $row->quiz_id ? 'tlb_quiz.png' : 'tlb_courses.png';
            echo "<img width='16' height='16' border='0' src='" . JURI::root() . "components/com_joomla_lms/lms_images/toolbar/{$timg}' alt='{$timg}' />";
            ?>
</td>
						</tr>
						<?php 
            $k = 1 - $k;
        }
        ?>
					</tbody>
					</table>
				</td>
			</tr>
		</table>
	</td></tr></table>	
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="certificates" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />		
		</form>
		<?php 
    }
Example #16
0
/**
* Saves the content item an edit form submit
*/
function saveContent(&$access, $task)
{
    global $database, $mainframe, $my;
    global $mosConfig_absolute_path, $mosConfig_offset, $Itemid;
    // simple spoof check security
    josSpoofCheck();
    $nullDate = $database->getNullDate();
    $row = new mosContent($database);
    if (!$row->bind($_POST)) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    // sanitise id field
    $row->id = (int) $row->id;
    $isNew = $row->id < 1;
    if ($isNew) {
        // new record
        if (!($access->canEdit || $access->canEditOwn)) {
            mosNotAuth();
            return;
        }
        $row->created = date('Y-m-d H:i:s');
        $row->created_by = $my->id;
    } else {
        // existing record
        if (!($access->canEdit || $access->canEditOwn && $row->created_by == $my->id)) {
            mosNotAuth();
            return;
        }
        $row->modified = date('Y-m-d H:i:s');
        $row->modified_by = $my->id;
    }
    if (strlen(trim($row->publish_up)) <= 10) {
        $row->publish_up .= ' 00:00:00';
    }
    $row->publish_up = mosFormatDate($row->publish_up, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    if (trim($row->publish_down) == 'Never' || trim($row->publish_down) == '') {
        $row->publish_down = $nullDate;
    } else {
        if (strlen(trim($row->publish_down)) <= 10) {
            $row->publish_down .= ' 00:00:00';
        }
        $row->publish_down = mosFormatDate($row->publish_down, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    }
    // code cleaner for xhtml transitional compliance
    $row->introtext = str_replace('<br>', '<br />', $row->introtext);
    $row->fulltext = str_replace('<br>', '<br />', $row->fulltext);
    // remove <br /> take being automatically added to empty fulltext
    $length = strlen($row->fulltext) < 9;
    $search = strstr($row->fulltext, '<br />');
    if ($length && $search) {
        $row->fulltext = NULL;
    }
    $row->title = ampReplace($row->title);
    // Publishing state hardening for Authors
    if (!$access->canPublish) {
        if ($isNew) {
            // For new items - author is not allowed to publish - prevent them from doing so
            $row->state = 0;
        } else {
            // For existing items keep existing state - author is not allowed to change status
            $query = "SELECT state" . "\n FROM #__content" . "\n WHERE id = " . (int) $row->id;
            $database->setQuery($query);
            $state = $database->loadResult();
            if ($state) {
                $row->state = 1;
            } else {
                $row->state = 0;
            }
        }
    }
    if (!$row->check()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    $row->version++;
    if (!$row->store()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    // manage frontpage items
    require_once $mainframe->getPath('class', 'com_frontpage');
    $fp = new mosFrontPage($database);
    if (intval(mosGetParam($_REQUEST, 'frontpage', 0))) {
        // toggles go to first place
        if (!$fp->load((int) $row->id)) {
            // new entry
            $query = "INSERT INTO #__content_frontpage" . "\n VALUES ( " . (int) $row->id . ", 1 )";
            $database->setQuery($query);
            if (!$database->query()) {
                echo "<script> alert('" . $database->stderr() . "');</script>\n";
                exit;
            }
            $fp->ordering = 1;
        }
    } else {
        // no frontpage mask
        if (!$fp->delete((int) $row->id)) {
            $msg .= $fp->stderr();
        }
        $fp->ordering = 0;
    }
    $fp->updateOrder();
    $row->checkin();
    $row->updateOrder("catid = " . (int) $row->catid);
    // gets section name of item
    $query = "SELECT s.title" . "\n FROM #__sections AS s" . "\n WHERE s.scope = 'content'" . "\n AND s.id = " . (int) $row->sectionid;
    $database->setQuery($query);
    // gets category name of item
    $section = $database->loadResult();
    $query = "SELECT c.title" . "\n FROM #__categories AS c" . "\n WHERE c.id = " . (int) $row->catid;
    $database->setQuery($query);
    $category = $database->loadResult();
    $category = stripslashes($category);
    if ($isNew) {
        // messaging for new items
        require_once $mosConfig_absolute_path . '/components/com_messages/messages.class.php';
        $query = "SELECT id" . "\n FROM #__users" . "\n WHERE sendEmail = 1";
        $database->setQuery($query);
        $users = $database->loadResultArray();
        foreach ($users as $user_id) {
            $msg = new mosMessage($database);
            $msg->send($my->id, $user_id, "New Item", sprintf(_ON_NEW_CONTENT, $my->username, $row->title, $section, $category));
        }
    }
    $msg = $isNew ? _THANK_SUB : _E_ITEM_SAVED;
    $msg = $my->usertype == 'Publisher' ? _THANK_SUB_PUB : $msg;
    switch ($task) {
        case 'apply':
            $link = $_SERVER['HTTP_REFERER'];
            break;
        case 'apply_new':
            $Itemid = intval(mosGetParam($_POST, 'Returnid', $Itemid));
            $link = 'index.php?option=com_content&task=edit&id=' . $row->id . '&Itemid=' . $Itemid;
            break;
        case 'save':
        default:
            $Itemid = mosGetParam($_POST, 'Returnid', '');
            if ($Itemid) {
                if ($access->canEdit) {
                    $link = 'index.php?option=com_content&task=view&id=' . $row->id . '&Itemid=' . $Itemid;
                } else {
                    $link = 'index.php';
                }
            } else {
                $link = strval(mosGetParam($_POST, 'referer', ''));
            }
            break;
    }
    mosRedirect($link, $msg);
}
Example #17
0
 function sendSchedule($d, $showHTML, $receivers, $list, &$message, &$max, $tags = null)
 {
     static $countEmails = 0;
     $mailing = $d['mailing'];
     $h = '';
     $xf = new xonfig();
     if (empty($mailing)) {
         $message = _ACA_NO_MAILING_ENTERED;
         return false;
     } elseif (empty($receivers)) {
         $message = _ACA_NO_ADDRESS_ENTERED;
         return false;
     } elseif (empty($list)) {
         $message = _ACA_NO_LIST_ENTERED;
         return false;
     } else {
         $message = '';
     }
     $mailingId = $mailing->id;
     $issue_nb = $mailing->issue_nb;
     $subject = $mailing->subject;
     $content = $mailing->htmlcontent;
     $textonly = $mailing->textonly;
     $fromname = $mailing->fromname;
     $fromemail = $mailing->fromemail;
     $images = $mailing->images;
     $listId = $list->id;
     $html = $list->html;
     $layout = $list->layout;
     $totalsofar = number_format(0, 4, ',', '');
     $nbPause = 0;
     $tags['issuenb'] = $issue_nb;
     //Just in case of...
     @ini_set('max_execution_time', 0);
     @ini_set('memory_limit', '128M');
     ignore_user_abort(true);
     ### create the mail
     $mail = acajoom_mail::getMailer($mailing);
     ### create content
     acajoom_mail::getContent($images, $layout, $content, $textonly, true);
     $mtime = microtime();
     $mtime = explode(" ", $mtime);
     $mtime = $mtime[1] + $mtime[0];
     $starttime = $mtime;
     $html_sent = 0;
     $text_sent = 0;
     $size = sizeof($receivers);
     $format = defined('_DATE_FORMAT_LC') ? _DATE_FORMAT_LC : JText::_('DATE_FORMAT_LC');
     $log_detailed = "\r\n" . "\r\n" . '*** ' . strftime($format) . ' ***' . "\r\n";
     //variables used in integration of jLinks
     $mailCatID = null;
     $convertedLinks = null;
     foreach ($receivers as $receiver) {
         $tags['user_id'] = $receiver->user_id;
         if ($html && intval($receiver->receive_html) == 1) {
             $mail->IsHTML(true);
             $ashtml = 1;
             $Altbody = acajoom_mail::replaceTags($textonly, $receiver, $list, $mailingId, 0, $tags);
             $mail->AltBody = acajoom_mail::safe_utf8_encode($Altbody, $mail->CharSet);
             $html_sent++;
             $mail->Body = acajoom_mail::replaceTags($content, $receiver, $list, $mailingId, $ashtml, $tags);
             acajoom_mail::replaceClass($mail->Body, $mail->AltBody, $receiver);
         } else {
             $mail->IsHTML(false);
             $mail->AltBody = '';
             $ashtml = 0;
             $text_sent++;
             $mail->Body = acajoom_mail::replaceTags($textonly, $receiver, $list, $mailingId, $ashtml, $tags);
             $simpleText = '';
             acajoom_mail::replaceClass($mail->Body, $simpleText, $receiver);
         }
         $tname = explode(" ", $receiver->name);
         $firstname = $tname[0];
         $toUser = $GLOBALS[ACA . 'minisendmail'] ? '' : $receiver->name;
         $mail->AddAddress($receiver->email, $toUser);
         if (!empty($receiver->id)) {
             $mail->addCustomHeader("X-SubscriberID: {$receiver->id}");
         }
         $username = empty($receiver->username) ? $firstname : $receiver->username;
         $date = ACA_CMSTYPE ? JHTML::_('date', acajoom::getNow(), JText::_('DATE_FORMAT_LC1'), 0) : mosFormatDate(acajoom::getNow(), '', 0);
         $replaceWhat = array('[NAME]', '[FIRSTNAME]', '[USERNAME]', '[DATE]');
         $replaceBy = array($receiver->name, $firstname, $username, $date);
         $sujetReplaced = str_replace($replaceWhat, $replaceBy, $subject);
         if (class_exists('auto')) {
             auto::tags($sujetReplaced, $tags);
         }
         $mail->Subject = $sujetReplaced;
         if ($GLOBALS[ACA . 'embed_images']) {
             acajoom_mail::embedImages($mail);
         }
         $mailssend = $mail->Send();
         $countEmails++;
         if ($countEmails >= $GLOBALS[ACA . 'cron_max_emails']) {
             $max = true;
         }
         if (!$mailssend || $mail->error_count > 0) {
             static $info = false;
             if (!$info and acajoom::checkPermissions('admin')) {
                 echo '<br/>Mailer Error : ' . $mail->ErrorInfo;
                 echo " : Newsletter '{$sujetReplaced}' to {$receiver->email}";
                 $info = true;
             }
             $log_detailed .= '[' . $mailingId . '] ' . $subject . ' : ' . $receiver->email . ' -> ' . _ACA_MESSAGE_NOT . "\r\n" . _ACA_MAILER_ERROR . ': ' . $mail->ErrorInfo . "\r\n";
             if ($html && intval($receiver->receive_html) == 1) {
                 $html_sent--;
             } else {
                 $text_sent--;
             }
             if (!subscribers::validEmail($receiver->email, true)) {
                 $deleteQueue = array();
                 $deleteQueue[0] = queue::whatQID($mailingId, $receiver->id, $d['listype']);
                 queue::deleteQueues($deleteQueue);
             }
         } else {
             $log_detailed .= '[' . $mailingId . '] ' . $subject . ' : ' . $receiver->email . ' -> ' . _ACA_MESSAGE_SENT_SUCCESSFULLY . "\r\n";
             if ($GLOBALS[ACA . 'enable_statistics'] == 1 and $GLOBALS[ACA . 'statistics_per_subscriber'] == 1) {
                 xmailing::insertStats($mailingId, $receiver->id, $ashtml);
             }
             $d['qids'] = array();
             $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
             if ($d['listype'] == '2') {
                 $d['qids'][0] = queue::whatQID($mailingId, $receiver->id, $d['listype']);
                 $erro->ck = auto::updateAutoresponderSent($d);
                 $erro->Eck(__LINE__, '8137', $d);
             } elseif ($d['listype'] == '1' || $d['listype'] == '7') {
                 $d['qids'][0] = queue::whatQID($mailingId, $receiver->id, $d['listype']);
                 $erro->ck = queue::deleteQueues($d['qids']);
                 $erro->Eck(__LINE__, '8127', $d);
             }
         }
         $mail->ClearAddresses();
     }
     if ($GLOBALS[ACA . 'enable_statistics'] == 1) {
         xmailing::updateStatsGlobal($mailingId, $html_sent, $text_sent, false);
     }
     $mtime = microtime();
     $mtime = explode(" ", $mtime);
     $mtime = $mtime[1] + $mtime[0];
     $endtime = $mtime;
     if ($totalsofar > 0) {
         $totaltime = $totalsofar;
         $totalstr = strval($totaltime);
     } else {
         $totaltime = number_format($endtime - $starttime - $nbPause * $GLOBALS[ACA . 'pause_time'], 4, ',', '');
         $totalstr = strval($totaltime);
     }
     $xf->plus('totalmailingsent' . $list->list_type, $html_sent + $text_sent);
     $xf->plus('totalmailingsent0', $html_sent + $text_sent);
     $log_simple = 'Time to send: ' . $totalstr . ' ' . _ACA_SECONDS . "\r\n" . 'Number of subscribers: ' . ($text_sent + $html_sent) . "\r\n" . 'HTML format: ' . $html_sent . "\r\n" . 'Text format: ' . $text_sent . "\r\n";
     $log_detailed = $log_simple . 'Details: ' . "\r\n" . $log_detailed . "\r\n";
     if (class_exists('lisType')) {
         acajoom_mail::writeLogs($list, $log_simple, $log_detailed);
     }
     if ($d['listype'] == '2') {
         echo '<br/>' . _ACA_QUEUE_AUTO_PROCESSED;
     } elseif ($d['listype'] == '1') {
         echo '<br/>' . _ACA_QUEUE_NEWS_PROCESSED;
     }
     if ($html_sent + $text_sent > 0) {
         return true;
     } else {
         $message = xmailing::M('no', _ACA_NO_MAILING_SENT);
         return false;
     }
 }
    public static function edit(&$row, &$images, &$lists, &$params, $option, &$menus)
    {
        global $database;
        mosMakeHtmlSafe($row);
        $create_date = null;
        $mod_date = null;
        $nullDate = $database->getNullDate();
        if ($row->created != $nullDate) {
            $create_date = mosFormatDate($row->created, '%A, %d %B %Y %H:%M', '0');
        }
        if ($row->modified != $nullDate) {
            $mod_date = mosFormatDate($row->modified, '%A, %d %B %Y %H:%M', '0');
        }
        $tabs = new mosTabs(1);
        // used to hide "Reset Hits" when hits = 0
        if (!$row->hits) {
            $visibility = "style='display: none; visibility: hidden;'";
        } else {
            $visibility = "";
        }
        mosCommonHTML::loadOverlib();
        mosCommonHTML::loadCalendar();
        ?>
		<script language="javascript" type="text/javascript">
		var folderimages = new Array;
		<?php 
        $i = 0;
        foreach ($images as $k => $items) {
            foreach ($items as $v) {
                echo "folderimages[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "' );\t";
            }
        }
        ?>
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}

			if ( pressbutton ==' resethits' ) {
				if (confirm('Are you sure you want to reset the Hits to Zero? \nAny unsaved changes to this content will be lost.')){
					submitform( pressbutton );
					return;
				} else {
					return;
				}
			}

			if ( pressbutton == 'menulink' ) {
				if ( form.menuselect.value == "" ) {
					alert( "Please select a Menu" );
					return;
				} else if ( form.link_name.value == "" ) {
					alert( "Please enter a Name for this menu item" );
					return;
				}
			}

			var temp = new Array;
			for (var i=0, n=form.imagelist.options.length; i < n; i++) {
				temp[i] = form.imagelist.options[i].value;
			}
			form.images.value = temp.join( '\n' );

			try {
				document.adminForm.onsubmit();
			}
			catch(e){}
			if (trim(form.title.value) == ""){
				alert( "Content item must have a title" );
			} else if (trim(form.name.value) == ""){
				alert( "Content item must have a name" );
			} else {
				if ( form.reset_hits.checked ) {
					form.hits.value = 0;
				} else {
				}
				<?php 
        getEditorContents('editor1', 'introtext');
        ?>
				submitform( pressbutton );
			}
		}
		</script>

		<table class="adminheading">
		<tr>
			<th class="edit">
			Static Content Item:
			<small>
			<?php 
        echo $row->id ? 'Edit' : 'New';
        ?>
			</small>
			</th>
		</tr>
		</table>

		<form action="index2.php" method="post" name="adminForm">

		<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td width="60%" valign="top">
				<table class="adminform">
				<tr>
					<th colspan="3">
					Item Details
					</th>
				</tr>
				<tr>
					<td align="left">
					Title:
					</td>
					<td>
					<input class="inputbox" type="text" name="title" size="30" maxlength="100" value="<?php 
        echo $row->title;
        ?>
" />
					</td>
				</tr>
				<tr>
					<td align="left">
					Title Alias:
					</td>
					<td>
					<input class="inputbox" type="text" name="title_alias" size="30" maxlength="100" value="<?php 
        echo $row->title_alias;
        ?>
" />
					</td>
				</tr>
				<tr>
					<td valign="top" align="left" colspan="2">
					Text: (required)<br />
					<?php 
        // parameters : areaname, content, hidden field, width, height, rows, cols
        editorArea('editor1', $row->introtext, 'introtext', '100%;', '500', '75', '50');
        ?>
					</td>
				</tr>
				</table>
			</td>
			<td width="40%" valign="top">
				<?php 
        $tabs->startPane("content-pane");
        $tabs->startTab("Publishing", "publish-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Publishing Info
					</th>
				</tr>
				<tr>
					<td valign="top" align="right" width="120">
					State:
					</td>
					<td>
					<?php 
        echo $row->state > 0 ? 'Published' : 'Draft Unpublished';
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Published:
					</td>
					<td>
					<input type="checkbox" name="published" value="1" <?php 
        echo $row->state ? 'checked="checked"' : '';
        ?>
 />
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Access Level:
					</td>
					<td>
					<?php 
        echo $lists['access'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Author Alias:
					</td>
					<td>
					<input type="text" name="created_by_alias" size="30" maxlength="100" value="<?php 
        echo $row->created_by_alias;
        ?>
" class="inputbox" />
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Change Creator:
					</td>
					<td>
					<?php 
        echo $lists['created_by'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Override Created Date
					</td>
					<td>
					<input class="inputbox" type="text" name="created" id="created" size="25" maxlength="19" value="<?php 
        echo $row->created;
        ?>
" />
					<input name="reset" type="reset" class="button" onClick="return showCalendar('created', 'y-mm-dd');" value="...">
					</td>
				</tr>
				<tr>
					<td align="right">
					Start Publishing:
					</td>
					<td>
					<input class="inputbox" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php 
        echo $row->publish_up;
        ?>
" />
					<input type="reset" class="button" value="..." onclick="return showCalendar('publish_up', 'y-mm-dd');">
					</td>
				</tr>
				<tr>
					<td align="right">
					Finish Publishing:
					</td>
					<td>
					<input class="inputbox" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php 
        echo $row->publish_down;
        ?>
" />
					<input type="reset" class="button" value="..." onclick="return showCalendar('publish_down', 'y-mm-dd');">
					</td>
				</tr>
				</table>
				<br />
				<table class="adminform" width="100%">
				<?php 
        if ($row->id) {
            ?>
					<tr>
						<td>
						<strong>Content ID:</strong>
						</td>
						<td>
						<?php 
            echo $row->id;
            ?>
						</td>
					</tr>
					<?php 
        }
        ?>
				<tr>
					<td width="120" valign="top" align="right">
					<strong>State</strong>
					</td>
					<td>
					<?php 
        echo $row->state > 0 ? 'Published' : ($row->state < 0 ? 'Archived' : 'Draft Unpublished');
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>Hits</strong>
					</td>
					<td>
					<?php 
        echo $row->hits;
        ?>
					<div <?php 
        echo $visibility;
        ?>
>
					<input name="reset_hits" type="button" class="button" value="Reset Hit Count" onClick="submitbutton('resethits');">
					</div>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>Version</strong>
					</td>
					<td>
					<?php 
        echo $row->version;
        ?>
 times
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>Created</strong>
					</td>
					<td>
						<?php 
        if (!$create_date) {
            ?>
							New document
							<?php 
        } else {
            echo $create_date;
        }
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>Last Modified</strong>
					</td>
					<td>
						<?php 
        if (!$mod_date) {
            ?>
							Not modified
							<?php 
        } else {
            echo $mod_date;
            ?>
							<br />
							<?php 
            echo $row->modifier;
        }
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>Expires</strong>
					</td>
					<td>
					<?php 
        echo "{$row->publish_down}";
        ?>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Images", "images-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
						MOSImage Control
					</th>
				</tr>
				<tr>
					<td colspan="2">
						<table width="100%">
						<tr>
							<td width="48%" valign="top">
								<div align="center">
									Gallery Images:
									<br />
									<?php 
        echo $lists['imagefiles'];
        ?>
								</div>
							</td>
							<td width="2%">
								<input class="button" type="button" value=">>" onclick="addSelectedToList('adminForm','imagefiles','imagelist')" title="Add"/>
								<br/>
								<input class="button" type="button" value="<<" onclick="delSelectedFromList('adminForm','imagelist')" title="Remove"/>
							</td>
							<td width="48%">
								<div align="center">
									Content Images:
									<br />
									<?php 
        echo $lists['imagelist'];
        ?>
									<br />
									<input class="button" type="button" value="Up" onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,-1)" />
									<input class="button" type="button" value="Down" onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,+1)" />
								</div>
							</td>
						</tr>
						</table>
						Sub-folder: <?php 
        echo $lists['folders'];
        ?>
					</td>
				</tr>
				<tr valign="top">
					<td>
						<div align="center">
							Sample Image:<br/>
							<img name="view_imagefiles" src="../images/M_images/blank.png" width="100" />
						</div>
					</td>
					<td valign="top">
						<div align="center">
							Active Image:<br/>
							<img name="view_imagelist" src="../images/M_images/blank.png" width="100" />
						</div>
					</td>
				</tr>
				<tr>
					<td>
					Edit the image selected:
						<table>
						<tr>
							<td align="right">
							Source
							</td>
							<td>
							<input type="text" name= "_source" value="" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Align
							</td>
							<td>
							<?php 
        echo $lists['_align'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							Alt Text
							</td>
							<td>
							<input type="text" name="_alt" value="" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Border
							</td>
							<td>
							<input type="text" name="_border" value="" size="3" maxlength="1" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Caption:
							</td>
							<td>
							<input class="text_area" type="text" name="_caption" value="" size="30" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Caption Position:
							</td>
							<td>
							<?php 
        echo $lists['_caption_position'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							Caption Align:
							</td>
							<td>
							<?php 
        echo $lists['_caption_align'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							Width:
							</td>
							<td>
							<input class="text_area" type="text" name="_width" value="" size="5" maxlength="5" />
							</td>
						</tr>
						<tr>
							<td colspan="2">
							<input class="button" type="button" value="Apply" onClick="applyImageProps()" />
							</td>
						</tr>
						</table>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Parameters", "params-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Parameter Control
					</th>
				</tr>
				<tr>
					<td>
					<?php 
        echo $params->render();
        ?>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Meta Info", "metadata-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Meta Data
					</th>
				</tr>
				<tr>
					<td align="left">
					Description:<br />
					<textarea class="inputbox" cols="40" rows="5" name="metadesc" style="width:300px"><?php 
        echo str_replace('&', '&amp;', $row->metadesc);
        ?>
</textarea>
					</td>
				</tr>
				<tr>
					<td align="left">
					Keywords:<br />
					<textarea class="inputbox" cols="40" rows="5" name="metakey" style="width:300px"><?php 
        echo str_replace('&', '&amp;', $row->metakey);
        ?>
</textarea>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Link to Menu", "link-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Link to Menu
					</th>
				</tr>
				<tr>
					<td colspan="2">
					This will create a 'Link - Static Content' in the menu you select
					<br /><br />
					</td>
				</tr>
				<tr>
					<td valign="top" width="90px">
					Select a Menu
					</td>
					<td>
					<?php 
        echo $lists['menuselect'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" width="90px">
					Menu Item Name
					</td>
					<td>
					<input type="text" name="link_name" class="inputbox" value="" size="30" />
					</td>
				</tr>
				<tr>
					<td>
					</td>
					<td>
					<input name="menu_link" type="button" class="button" value="Link to Menu" onClick="submitbutton('menulink');" />
					</td>
				</tr>
				<tr>
					<th colspan="2">
					Existing Menu Links
					</th>
				</tr>
				<?php 
        if ($menus == NULL) {
            ?>
					<tr>
						<td colspan="2">
						None
						</td>
					</tr>
					<?php 
        } else {
            mosCommonHTML::menuLinksContent($menus);
        }
        ?>
				<tr>
					<td colspan="2">
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->endPane();
        ?>
			</td>
		</tr>
		</table>

		<input type="hidden" name="images" value="" />
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="hits" value="<?php 
        echo $row->hits;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }
Example #19
0
File: poll.php Project: cwcw/cms
function pollresult($uid)
{
    global $database, $mosConfig_offset, $mosConfig_live_site, $Itemid;
    global $mainframe;
    $poll = new mosPoll($database);
    $poll->load($uid);
    if (empty($poll->title)) {
        $poll->id = '';
        $poll->title = _SELECT_POLL;
    }
    $first_vote = '';
    $last_vote = '';
    if (isset($poll->id) && $poll->id != "") {
        $query = "SELECT MIN(date) AS mindate, MAX(date) AS maxdate" . "\n FROM #__poll_date" . "\n WHERE poll_id='{$poll->id}'";
        $database->setQuery($query);
        $dates = $database->loadObjectList();
        if (isset($dates[0]->mindate)) {
            $first_vote = mosFormatDate($dates[0]->mindate, _DATE_FORMAT_LC2);
            $last_vote = mosFormatDate($dates[0]->maxdate, _DATE_FORMAT_LC2);
        }
    }
    $query = "SELECT a.text, count( DISTINCT b.id ) AS hits, count( DISTINCT b.id )/COUNT( DISTINCT c.id )*100.0 AS percent" . "\n FROM #__poll_data AS a" . "\n LEFT JOIN #__poll_date AS b ON b.vote_id = a.id" . "\n LEFT JOIN #__poll_date AS c ON c.poll_id = a.pollid" . "\n WHERE a.pollid='{$poll->id}' AND a.text <> ''" . "\n GROUP BY a.id" . "\n ORDER BY a.id";
    $database->setQuery($query);
    $votes = $database->loadObjectList();
    $query = "SELECT id, title" . "\n FROM #__polls" . "\n WHERE published=1" . "\n ORDER BY id";
    $database->setQuery($query);
    $polls = $database->loadObjectList();
    reset($polls);
    $link = sefRelToAbs('index.php?option=com_poll&amp;task=results&amp;id=\' + this.options[selectedIndex].value + \'');
    $pollist = '<select name="id" class="inputbox" size="1" style="width:200px" onchange="if (this.options[selectedIndex].value != \'\') {document.location.href=\'' . $link . '\'}">';
    $pollist .= '<option value="">' . _SELECT_POLL . '</option>';
    for ($i = 0, $n = count($polls); $i < $n; $i++) {
        $k = $polls[$i]->id;
        $t = $polls[$i]->title;
        $sel = $k == intval($poll->id) ? " selected=\"selected\"" : '';
        $pollist .= "\n\t<option value=\"" . $k . "\"{$sel}>" . $t . "</option>";
    }
    $pollist .= '</select>';
    // Adds parameter handling
    $menu =& new mosMenu($database);
    $menu->load($Itemid);
    $params =& new mosParameters($menu->params);
    $params->def('page_title', 1);
    $params->def('pageclass_sfx', '');
    $params->def('back_button', $mainframe->getCfg('back_button'));
    $mainframe->SetPageTitle($poll->title);
    poll_html::showResults($poll, $votes, $first_vote, $last_vote, $pollist, $params);
}
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showContent(&$rows, &$pageNav, $option, $search, &$lists)
    {
        global $my, $acl;
        mosCommonHTML::loadOverlib();
        ?>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="edit">
			<?php 
        echo T_('Static Content Manager');
        ?>
			</th>
			<td>
			<?php 
        echo T_('Filter:');
        ?>
&nbsp;
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
			<td>
			&nbsp;&nbsp;&nbsp;<?php 
        echo T_('Order:');
        ?>
&nbsp;
			</td>
			<td>
			<?php 
        echo $lists['order'];
        ?>
			</td>
			<td width="right">
			<?php 
        echo $lists['authorid'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="5">
			#
			</th>
			<th width="5px">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			<?php 
        echo T_('Title');
        ?>
			</th>
			<th width="5%">
			<?php 
        echo T_('Published');
        ?>
			</th>
			<th nowrap="nowrap" width="5%">
			<?php 
        echo T_('Front Page');
        ?>
			</th>
			<th width="2%">
			<?php 
        echo T_('Order');
        ?>
			</th>
			<th width="1%">
			<a href="javascript: saveorder( <?php 
        echo count($rows) - 1;
        ?>
 )"><img src="images/filesave.png" border="0" width="16" height="16" alt="<?php 
        echo T_('Save Order');
        ?>
" /></a>
			</th>
			<th width="10%">
			<?php 
        echo T_('Access');
        ?>
			</th>
			<th width="5%">
			<?php 
        echo T_('ID');
        ?>
			</th>
			<th width="1%" align="left">
			<?php 
        echo T_('Links');
        ?>
			</th>
			<th width="20%" align="left">
			<?php 
        echo T_('Author');
        ?>
			</th>
			<th align="center" width="10">
			<?php 
        echo T_('Date');
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $now = date("Y-m-d H:i:s");
            if ($now <= $row->publish_up && $row->state == "1") {
                $img = 'publish_y.png';
                $alt = T_('Published');
            } else {
                if (($now <= $row->publish_down || $row->publish_down == "0000-00-00 00:00:00") && $row->state == "1") {
                    $img = 'publish_g.png';
                    $alt = T_('Published');
                } else {
                    if ($now > $row->publish_down && $row->state == "1") {
                        $img = 'publish_r.png';
                        $alt = T_('Expired');
                    } elseif ($row->state == "0") {
                        $img = "publish_x.png";
                        $alt = T_('Unpublished');
                    }
                }
            }
            $times = '';
            if (isset($row->publish_up)) {
                if ($row->publish_up == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . T_('Start:') . " " . T_('Always') . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . T_('Start:') . " {$row->publish_up}</td></tr>";
                }
            }
            if (isset($row->publish_down)) {
                if ($row->publish_down == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . T_('Finish:') . " " . T_('No Expiry') . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . T_('Finish:') . " {$row->publish_down}</td></tr>";
                }
            }
            if (!$row->access) {
                $color_access = 'style="color: green;"';
                $task_access = 'accessregistered';
            } else {
                if ($row->access == 1) {
                    $color_access = 'style="color: red;"';
                    $task_access = 'accessspecial';
                } else {
                    $color_access = 'style="color: black;"';
                    $task_access = 'accesspublic';
                }
            }
            $link = 'index2.php?option=com_typedcontent&task=edit&hidemainmenu=1&id=' . $row->id;
            if ($row->checked_out) {
                $checked = mosCommonHTML::checkedOut($row);
            } else {
                $checked = mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
            }
            if ($acl->acl_check('administration', 'manage', 'users', $my->usertype, 'components', 'com_users')) {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id=' . $row->created_by;
                    $author = '<a href="' . $linkA . '" title="' . T_('Edit User') . '">' . $row->creator . '</a>';
                }
            } else {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $author = $row->creator;
                }
            }
            $date = mosFormatDate($row->created, '%x');
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td>
				<?php 
            echo $checked;
            ?>
				</td>
				<td>
				<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                echo $row->title;
                if ($row->title_alias) {
                    echo ' (<i>' . $row->title_alias . '</i>)';
                }
            } else {
                ?>
					<a href="<?php 
                echo $link;
                ?>
" title="<?php 
                echo T_('Edit Static Content');
                ?>
">
					<?php 
                echo $row->title;
                if ($row->title_alias) {
                    echo ' (<i>' . $row->title_alias . '</i>)';
                }
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<?php 
            if ($times) {
                ?>
					<td align="center">
					<a href="javascript: void(0);" onMouseOver="return overlib('<table><?php 
                echo $times;
                ?>
</table>', CAPTION, '<?php 
                echo T_('Publish Information');
                ?>
', BELOW, RIGHT);" onMouseOut="return nd();" onClick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? "unpublish" : "publish";
                ?>
')">
					<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</a>
					</td>
					<?php 
            }
            ?>
				<td align="center">
				<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','toggle_frontpage')">
				<img src="images/<?php 
            echo $row->frontpage ? 'tick.png' : 'publish_x.png';
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $row->frontpage ? T_('Yes') : T_('No');
            ?>
" />
				</a>
				</td>
				<td align="center" colspan="2">
				<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" class="text_area" style="text-align: center" />
				</td>
				<td align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task_access;
            ?>
')" <?php 
            echo $color_access;
            ?>
>
				<?php 
            echo $row->groupname;
            ?>
				</a>
				</td>
				<td align="center">
				<?php 
            echo $row->id;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->links;
            ?>
				</td>
				<td align="left">
				<?php 
            echo $author;
            ?>
				</td>
				<td>
				<?php 
            echo $date;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>

		<?php 
        echo $pageNav->getListFooter();
        ?>
		<?php 
        mosCommonHTML::ContentLegend();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		</form>
		<?php 
    }
Example #21
0
    public static function display(&$rows, $params, $pageNav, $limitstart, $limit, $total, $totalRows, $searchword)
    {
        global $mosConfig_hideCreateDate;
        global $mosConfig_live_site, $option, $Itemid;
        $c = count($rows);
        $image = mosAdminMenus::ImageCheck('google.png', '/images/M_images/', NULL, NULL, 'Google', 'Google', 1);
        $searchword = urldecode($searchword);
        $searchword = htmlspecialchars($searchword, ENT_QUOTES);
        // number of matches found
        echo '<br/>';
        eval('echo "' . _CONCLUSION . '";');
        ?>
				<a href="http://www.google.com/search?q=<?php 
        echo $searchword;
        ?>
" target="_blank">
					<?php 
        echo $image;
        ?>
</a>
			</td>
		</tr>
		</table>

		<br />

		<div align="center">
			<?php 
        echo $pageNav->writePagesCounter();
        $ordering = strtolower(strval(mosGetParam($_REQUEST, 'ordering', 'newest')));
        $searchphrase = strtolower(strval(mosGetParam($_REQUEST, 'searchphrase', 'any')));
        $searchphrase = htmlspecialchars($searchphrase);
        $cleanWord = htmlspecialchars($searchword);
        $link = $mosConfig_live_site . "/index.php?option={$option}&amp;Itemid={$Itemid}&amp;searchword={$cleanWord}&amp;searchphrase={$searchphrase}&amp;ordering={$ordering}";
        echo $pageNav->getLimitBox($link);
        ?>
		</div>
		<table class="contentpaneopen<?php 
        echo $params->get('pageclass_sfx');
        ?>
">
		<tr class="<?php 
        echo $params->get('pageclass_sfx');
        ?>
">
			<td>
				<?php 
        $z = $limitstart + 1;
        $end = $limit + $z;
        if ($end > $total) {
            $end = $total + 1;
        }
        for ($i = $z; $i < $end; $i++) {
            $row = $rows[$i - 1];
            if ($row->created) {
                $created = mosFormatDate($row->created, _DATE_FORMAT_LC);
            } else {
                $created = '';
            }
            ?>
					<fieldset>
						<div>
							<span class="small<?php 
            echo $params->get('pageclass_sfx');
            ?>
">
								<?php 
            echo $i . '. ';
            ?>
							</span>
							<?php 
            if ($row->href) {
                $row->href = ampReplace($row->href);
                if ($row->browsernav == 1) {
                    ?>
									<a href="<?php 
                    echo sefRelToAbs($row->href);
                    ?>
" target="_blank">
									<?php 
                } else {
                    ?>
									<a href="<?php 
                    echo sefRelToAbs($row->href);
                    ?>
">
									<?php 
                }
            }
            echo $row->title;
            if ($row->href) {
                ?>
								</a>
								<?php 
            }
            if ($row->section) {
                ?>
								<br/>
								<span class="small<?php 
                echo $params->get('pageclass_sfx');
                ?>
">
									(<?php 
                echo $row->section;
                ?>
)
								</span>
								<?php 
            }
            ?>
						</div>

						<div>
							<?php 
            echo ampReplace($row->text);
            ?>
						</div>

						<?php 
            if (!$mosConfig_hideCreateDate) {
                ?>
							<div class="small<?php 
                echo $params->get('pageclass_sfx');
                ?>
">
								<?php 
                echo $created;
                ?>
							</div>
							<?php 
            }
            ?>
					</fieldset>
					<br/>
					<?php 
        }
        ?>
			</td>
		</tr>
		<?php 
    }
Example #22
0
    /**
     * Writes the edit form for new and existing content item
     *
     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
     * property set to 0.
     * @param mosContent The category object
     * @param string The html for the groups select list
     */
    function editContent(&$row, $section, &$lists, &$sectioncategories, &$images, $myid, &$params, $option, $redirect, &$menus)
    {
        global $mosConfig_live_site, $adminLanguage;
        $sec = $section;
        //used in metadata include
        mosMakeHtmlSafe($row);
        $mod_date = null;
        $create_date = null;
        if (intval($row->modified) != 0) {
            $mod_date = mosFormatDate($row->modified);
        }
        if (intval($row->created) != 0) {
            $create_date = mosFormatDate($row->created);
        }
        $tabs = new mosTabs(0);
        // used to hide "Reset Hits" when hits = 0
        if (!$row->hits) {
            $visibility = "style='display: none; visbility: hidden;'";
        } else {
            $visibility = "";
        }
        ?>
		<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
		<link rel="stylesheet" type="text/css" media="all" href="../includes/js/calendar/calendar-mos.css" title="green" />
		<!-- import the calendar script -->
		<script type="text/javascript" src="../includes/js/calendar/calendar.js"></script>
		<!-- import the language module -->
		<script type="text/javascript" src="../includes/js/calendar/lang/calendar-en.js"></script>
		<script language="javascript" type="text/javascript">

		var sectioncategories = new Array;
		<?php 
        $i = 0;
        foreach ($sectioncategories as $k => $items) {
            foreach ($items as $v) {
                echo "sectioncategories[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "' );\n\t\t";
            }
        }
        ?>


		var folderimages = new Array;
		<?php 
        $i = 0;
        foreach ($images as $k => $items) {
            foreach ($items as $v) {
                echo "folderimages[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "' );\n\t\t";
            }
        }
        ?>


		function submitbutton(pressbutton) {
			var form = document.adminForm;

			if (pressbutton =='resethits') {
				if (confirm("<?php 
        echo $adminLanguage->A_COMP_CONTENT_ZERO;
        ?>
")){
					submitform( pressbutton );
					return;
				} else {
					return;
				}
			}

			if ( pressbutton == 'menulink' ) {
				if ( form.menuselect.value == "" ) {
					alert( "<?php 
        echo $adminLanguage->A_COMP_SELECT_MENU;
        ?>
" );
					return;
				} else if ( form.link_name.value == "" ) {
					alert( "<?php 
        echo $adminLanguage->A_COMP_ENTER_MENU_NAME;
        ?>
" );
					return;
				} else if ( confirm("<?php 
        echo $adminLanguage->A_COMP_CREATE_MENU_LINK;
        ?>
") ){
					submitform( pressbutton );
				} else {
					return;
				}
			}

			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}
			// assemble the images back into one field
			var temp = new Array;
			for (var i=0, n=form.imagelist.options.length; i < n; i++) {
				temp[i] = form.imagelist.options[i].value;
			}
			form.images.value = temp.join( '\n' );

			// do field validation
			if (form.title.value == ""){
				alert( "<?php 
        echo $adminLanguage->A_COMP_CONTENT_MUST_TITLE;
        ?>
" );
			} else if (form.sectionid.value == "-1"){
				alert( "<?php 
        echo $adminLanguage->A_COMP_CONTENT_MUST_SECTION;
        ?>
" );
			} else if (form.catid.value == "-1"){
				alert( "<?php 
        echo $adminLanguage->A_COMP_CONTENT_MUST_CATEG;
        ?>
" );
			} else {
				<?php 
        getEditorContents('editor1', 'introtext');
        getEditorContents('editor2', 'fulltext');
        ?>
				submitform( pressbutton );
			}
		}
		</script>

		<form action="index2.php" method="post" name="adminForm">
		<input type="hidden" name="images" value="" />
		<table class="adminheading">
		<tr>
			<th class="edit">
			<?php 
        echo $row->id ? $adminLanguage->A_COMP_EDITING : $adminLanguage->A_COMP_ADDING;
        ?>
 <?php 
        echo $adminLanguage->A_COMP_CONTENT_IN;
        ?>
 <?php 
        echo $section;
        ?>
 <?php 
        echo $adminLanguage->A_COMP_SECTION;
        ?>
			</th>
		</tr>
		</table>

		<table cellspacing="0" cellpadding="0" width="100%">
		<tr>
			<td width="60%" valign="top">
				<table width="100%" class="adminform">
				<tr>
					<td width="100%">
						<table cellspacing="0" cellpadding="0" border="0" width="100%">
						<tr>
							<th colspan="4">
							<?php 
        echo $adminLanguage->A_COMP_CONTENT_ITEM_DETAILS;
        ?>
							</th>
						<tr>
						<tr>
							<td>
							<?php 
        echo $adminLanguage->A_COMP_TITLE;
        ?>
:
							</td>
							<td>
							<input class="text_area" type="text" name="title" size="30" maxlength="100" value="<?php 
        echo $row->title;
        ?>
" />
							</td>
							<td>
							<?php 
        echo $adminLanguage->A_COMP_SECTION;
        ?>
:
							</td>
							<td>
							<?php 
        echo $lists['sectionid'];
        ?>
							</td>
						</tr>
						<tr>
							<td>
							<?php 
        echo $adminLanguage->A_COMP_CONTENT_TITLE_ALIAS;
        ?>
:
							</td>
							<td>
							<input name="title_alias" type="text" class="text_area" id="title_alias" value="<?php 
        echo $row->title_alias;
        ?>
" size="30" maxlength="100" />
							</td>
							<td>
							<?php 
        echo $adminLanguage->A_COMP_CATEG;
        ?>
:
							</td>
							<td>
							<?php 
        echo $lists['catid'];
        ?>
							</td>
						</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td width="100%">
					<?php 
        echo $adminLanguage->A_COMP_CONTENT_INTRO;
        ?>
					<br /><?php 
        // parameters : areaname, content, hidden field, width, height, rows, cols
        editorArea('editor1', $row->introtext, 'introtext', 500, 200, '50', '15');
        ?>
					</td>
				</tr>
				<tr>
					<td width="100%">
					<?php 
        echo $adminLanguage->A_COMP_CONTENT_MAIN;
        ?>
					<br /><?php 
        // parameters : areaname, content, hidden field, width, height, rows, cols
        editorArea('editor2', $row->fulltext, 'fulltext', 500, 350, '50', '15');
        ?>
					</td>
				</tr>
				</table>
			</td>
			<td valign="top" width="40%">
				<table>
				<tr>
					<td>
					<?php 
        $tabs->startPane("content-pane");
        $tabs->startTab($adminLanguage->A_COMP_CONTENT_PUBLISHING, "publish-page");
        ?>
					<table class="adminform">
					<tr>
						<th colspan="2">
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_PUB_INFO;
        ?>
						</th>
					<tr>
					<tr>
						<td valign="top" align="right">
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_FRONTPAGE;
        ?>
:
						</td>
						<td>
						<input type="checkbox" name="frontpage" value="1" <?php 
        echo $row->frontpage ? 'checked="checked"' : '';
        ?>
 />
						</td>
					</tr>
					<tr>
						<td valign="top" align="right">
						<?php 
        echo $adminLanguage->A_COMP_PUBLISHED;
        ?>
:
						</td>
						<td>
						<input type="checkbox" name="published" value="1" <?php 
        echo $row->state ? 'checked="checked"' : '';
        ?>
 />
						</td>
					</tr>
					<tr>
						<td valign="top" align="right">
						<?php 
        echo $adminLanguage->A_COMP_ACCESS_LEVEL;
        ?>
:
						</td>
						<td>
						<?php 
        echo $lists['access'];
        ?>
 </td>
						</tr>
					<tr>
						<td valign="top" align="right">
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_AUTHOR;
        ?>
:
						</td>
						<td>
						<input type="text" name="created_by_alias" size="30" maxlength="100" value="<?php 
        echo $row->created_by_alias;
        ?>
" class="text_area" />
						</td>
					</tr>
					<tr>
						<td valign="top" align="right">
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_CREATOR;
        ?>
:
						</td>
						<td>
						<?php 
        echo $lists['created_by'];
        ?>
 </td>
					</tr>
					<tr>
						<td valign="top" align="right"><?php 
        echo $adminLanguage->A_COMP_ORDERING;
        ?>
:</td>
						<td>
						<?php 
        echo $lists['ordering'];
        ?>
 </td>
					</tr>
					<tr>
						<td valign="top" align="right">
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_OVERRIDE;
        ?>
						</td>
						<td>
						<input class="text_area" type="text" name="created" id="created" size="25" maxlength="19" value="<?php 
        echo $row->created;
        ?>
" />
						<input name="reset" type="reset" class="button" onClick="return showCalendar('created', 'y-mm-dd');" value="...">
						</td>
					</tr>
					<tr>
						<td valign="top" align="right">
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_START_PUB;
        ?>
:
						</td>
						<td>
						<input class="text_area" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php 
        echo $row->publish_up;
        ?>
" />
						<input type="reset" class="button" value="..." onClick="return showCalendar('publish_up', 'y-mm-dd');">
						</td>
					</tr>
					<tr>
						<td valign="top" align="right">
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_FINISH_PUB;
        ?>
:
						</td>
						<td>
						<input class="text_area" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php 
        echo $row->publish_down;
        ?>
" />
						<input type="reset" class="button" value="..." onClick="return showCalendar('publish_down', 'y-mm-dd');">
						</td>
					</tr>
					</table>
					<br />
					<table class="adminform">
					<tr>
						<td width="90px" valign="top" align="right">
						<strong><?php 
        echo $adminLanguage->A_COMP_STATE;
        ?>
:</strong>
						</td>
						<td>
						<?php 
        echo $row->state > 0 ? $adminLanguage->A_COMP_PUBLISHED : ($row->state < 0 ? $adminLanguage->A_COMP_ARCHIVED : $adminLanguage->A_COMP_CONTENT_DRAFT_UNPUB);
        ?>
						</td>
					</tr>
					<tr >
						<td valign="top" align="right">
						<strong>
						<?php 
        echo $adminLanguage->A_COMP_HITS;
        ?>
						</strong>:
						</td>
						<td>
						<?php 
        echo $row->hits;
        ?>
						<div <?php 
        echo $visibility;
        ?>
>
						<input name="reset_hits" type="button" class="button" value="<?php 
        echo $adminLanguage->A_COMP_CONTENT_RESET_HIT;
        ?>
" onClick="submitbutton('resethits');">
						</div>
						</td>
					</tr>
					<tr>
						<td valign="top" align="right">
						<strong>
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_REVISED;
        ?>
						</strong>:
						</td>
						<td>
						<?php 
        echo $row->version;
        echo $adminLanguage->A_COMP_CONTENT_TIMES;
        ?>
						</td>
					</tr>
					<tr>
						<td valign="top" align="right">
						<strong>
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_CREATED;
        ?>
						</strong>
						</td>
						<td>
						<?php 
        echo $row->created ? "{$create_date}</td></tr><tr><td valign='top' align='right'><strong>" . $adminLanguage->A_COMP_CONTENT_BY . "</strong></td><td>{$row->creator}" : $adminLanguage->A_COMP_CONTENT_NEW_DOC;
        ?>
						</td>
					</tr>
					<tr>
						<td valign="top" align="right">
						<strong>
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_LAST_MOD;
        ?>
						</strong>
						</td>
						<td>
						<?php 
        echo $row->modified ? "{$mod_date}</td></tr><tr><td valign='top' align='right'><strong>" . $adminLanguage->A_COMP_CONTENT_BY . "</strong></td><td>{$row->modifier}" : $adminLanguage->A_COMP_CONTENT_NOT_MOD;
        ?>
						</td>
					</tr>
					</table>
					<?php 
        $tabs->endTab();
        $tabs->startTab($adminLanguage->A_COMP_CONTENT_IMAGES2, $adminLanguage->A_COMP_CONT_IMG_PAGE);
        ?>
					<table class="adminform" width="100%">
					<tr>
						<th colspan="2">
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_MOSIMAGE;
        ?>
						</th>
					<tr>
					<tr>
						<td colspan="6"><?php 
        echo $adminLanguage->A_COMP_CONTENT_SUB_FOLDER;
        ?>
: <?php 
        echo $lists['folders'];
        ?>
</td>
					</tr>
					<tr>
						<td>
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_GALLERY;
        ?>
:
						<br />
						<?php 
        echo $lists['imagefiles'];
        ?>
						</td>
						<td valign="top">
						<img name="view_imagefiles" src="../images/M_images/blank.png" width="100" />
						</td>
					</tr>
					<tr>
						<td>
						<input class="button" type="button" value="<?php 
        echo $adminLanguage->A_COMP_ADD;
        ?>
" onClick="addSelectedToList('adminForm','imagefiles','imagelist')" />
						</td>
					</tr>
					<tr>
						<td>
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_IMAGES;
        ?>
:
						<br />
						<?php 
        echo $lists['imagelist'];
        ?>
						</td>
						<td valign="top">
						<img name="view_imagelist" src="../images/M_images/blank.png" width="100" />
						</td>
					</tr>
					<tr>
						<td>
						<input class="button" type="button" value="<?php 
        echo $adminLanguage->A_COMP_CONTENT_UP;
        ?>
" onClick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,-1)" />
						<input class="button" type="button" value="<?php 
        echo $adminLanguage->A_COMP_CONTENT_DOWN;
        ?>
" onClick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,+1)" />
						<input class="button" type="button" value="<?php 
        echo $adminLanguage->A_COMP_CONTENT_REMOVE;
        ?>
" onClick="delSelectedFromList('adminForm','imagelist')" />
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<?php 
        echo $adminLanguage->A_COMP_CONTENT_EDIT_IMAGE;
        ?>
:
							<table>
							<tr>
								<td align="right">
								<?php 
        echo $adminLanguage->A_COMP_SOURCE;
        ?>
:
								</td>
								<td>
								<input class="text_area" type="text" name= "_source" value="" />
								</td>
							</tr>
							<tr>
								<td align="right">
								<?php 
        echo $adminLanguage->A_COMP_CONTENT_ALIGN;
        ?>
:
								</td>
								<td>
								<?php 
        echo $lists['_align'];
        ?>
								</td>
							</tr>
							<tr>
								<td align="right">
								<?php 
        echo $adminLanguage->A_COMP_CONTENT_ALT;
        ?>
:
								</td>
								<td>
								<input class="text_area" type="text" name="_alt" value="" />
								</td>
							</tr>
							<tr>
								<td align="right">
								<?php 
        echo $adminLanguage->A_COMP_CONTENT_BORDER;
        ?>
:
								</td>
								<td>
								<input class="text_area" type="text" name="_border" value="" size="3" maxlength="1" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
								<input class="button" type="button" value="<?php 
        echo $adminLanguage->A_COMP_CONTENT_APPLY;
        ?>
" onClick="applyImageProps()" />
								</td>
							</tr>
							</table>
						</td>
					</tr>
					</table>
					<?php 
        $tabs->endTab();
        $tabs->startTab($adminLanguage->A_COMP_CONT_PARAMETERS, "params-page");
        ?>
					<table class="adminform">
					<tr>
						<th colspan="2">
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_PARAM;
        ?>
						</th>
					<tr>
					<tr>
						<td>
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_PARAM_MESS;
        ?>
						<br /><br />
						</td>
					</tr>
					<tr>
						<td>
						<?php 
        echo $params->render();
        ?>
						</td>
					</tr>
					</table>
					<?php 
        $tabs->endTab();
        $tabs->startTab($adminLanguage->A_COMP_CONTENT_META_INFO, $adminLanguage->A_COMP_CONF_META_PAGE);
        ?>
					<table class="adminform">
					<tr>
						<th colspan="2">
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_META_DATA;
        ?>
						</th>
					<tr>
					<tr>
						<td>
						<?php 
        echo $adminLanguage->A_COMP_DESCRIPTION;
        ?>
:
						<br />
						<textarea class="text_area" cols="30" rows="3" style="width:300px; height:50px" name="metadesc" width="500"><?php 
        echo str_replace('&', '&amp;', $row->metadesc);
        ?>
</textarea>
						</td>
					</tr>
						<tr>
						<td>
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_KEYWORDS;
        ?>
:
						<br />
						<textarea class="text_area" cols="30" rows="3" style="width:300px; height:50px" name="metakey" width="500"><?php 
        echo str_replace('&', '&amp;', $row->metakey);
        ?>
</textarea>
						</td>
					</tr>
					<tr>
						<td>
						<input type="button" class="button" value="<?php 
        echo $adminLanguage->A_COMP_CONTENT_ADD_ETC;
        ?>
" onClick="f=document.adminForm;f.metakey.value=document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].text+', '+getSelectedText('adminForm','catid')+', '+f.title.value+f.metakey.value;" />
						</td>
					</tr>
					</table>
					<?php 
        $tabs->endTab();
        $tabs->startTab($adminLanguage->A_COMP_CONTENT_LINK_TO_MENU, $adminLanguage->A_COMP_CONTENT_LINK_PAGE);
        ?>
					<table class="adminform">
					<tr>
						<th colspan="2">
						<?php 
        echo $adminLanguage->A_COMP_LINK_TO_MENU;
        ?>
						</th>
					<tr>
					<tr>
						<td colspan="2">
						<?php 
        echo $adminLanguage->A_COMP_CONTENT_LINK_CI;
        ?>
						<br /><br />
						</td>
					<tr>
					<tr>
						<td valign="top" width="90px">
						<?php 
        echo $adminLanguage->A_COMP_SELECT_MENU;
        ?>
						</td>
						<td>
						<?php 
        echo $lists['menuselect'];
        ?>
						</td>
					<tr>
					<tr>
						<td valign="top" width="90px">
						<?php 
        echo $adminLanguage->A_COMP_MENU_NAME;
        ?>
						</td>
						<td>
						<input type="text" name="link_name" class="inputbox" value="" size="30" />
						</td>
					<tr>
					<tr>
						<td>
						</td>
						<td>
						<input name="menu_link" type="button" class="button" value="<?php 
        echo $adminLanguage->A_COMP_LINK_TO_MENU;
        ?>
" onClick="submitbutton('menulink');" />
						</td>
					<tr>
					<tr>
						<th colspan="2">
						<?php 
        echo $adminLanguage->A_COMP_MENU_LINKS;
        ?>
						</th>
					</tr>
					<?php 
        if ($menus == NULL) {
            ?>
						<tr>
							<td colspan="2">
							<?php 
            echo $adminLanguage->A_COMP_NONE;
            ?>
							</td>
						</tr>
						<?php 
        } else {
            foreach ($menus as $menu) {
                ?>
							<tr>
								<td colspan="2">
								<hr/>
								</td>
							</tr>
							<tr>
								<td width="90px" valign="top">
								<?php 
                echo $adminLanguage->A_COMP_MENU;
                ?>
								</td>
								<td>
								<?php 
                echo $menu->menutype;
                ?>
								</td>
							</tr>
							<tr>
								<td width="90px" valign="top">
								<?php 
                echo $adminLanguage->A_COMP_CONTENT_LINK_NAME;
                ?>
								</td>
								<td>
								<strong>
								<?php 
                echo $menu->name;
                ?>
								</strong>
								</td>
							</tr>
							<tr>
								<td width="90px" valign="top">
								<?php 
                echo $adminLanguage->A_COMP_STATE;
                ?>
								</td>
								<td>
								<?php 
                switch ($menu->published) {
                    case -2:
                        echo "<font color=\"red\">" . $adminLanguage->A_COMP_TRASHED . "</font>";
                        break;
                    case 0:
                        echo $adminLanguage->A_COMP_UNPUBLISHED;
                        break;
                    case 1:
                    default:
                        echo "<font color=\"green\">" . $adminLanguage->A_COMP_PUBLISHED . "</font>";
                        break;
                }
                ?>
								</td>
							</tr>
							<?php 
            }
        }
        ?>
					<tr>
						<td colspan="2">
						</td>
					</tr>
					</table>
					<?php 
        $tabs->endTab();
        $tabs->endPane();
        ?>
					</td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="version" value="<?php 
        echo $row->version;
        ?>
" />
		<input type="hidden" name="mask" value="0" />
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="redirect" value="<?php 
        echo $redirect;
        ?>
" />
		<input type="hidden" name="task" value="" />
		</form>
		<script language="Javascript" src="<?php 
        echo $mosConfig_live_site;
        ?>
/includes/js/overlib_mini.js"></script>
		<?php 
    }
Example #23
0
    /**
     * Writes the edit form for new and existing content item
     *
     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
     * property set to 0.
     * @param mosContent The category object
     * @param string The html for the groups select list
     */
    function editContent(&$row, $section, &$lists, &$sectioncategories, &$images, &$params, $option, $redirect, &$menus)
    {
        global $mosConfig_live_site;
        mosMakeHtmlSafe($row);
        $create_date = null;
        if (intval($row->created) != 0) {
            $create_date = mosFormatDate($row->created, '%A, %d %B %Y %H:%M', '0');
        }
        $mod_date = null;
        if (intval($row->modified) != 0) {
            $mod_date = mosFormatDate($row->modified, '%A, %d %B %Y %H:%M', '0');
        }
        $tabs = new mosTabs(1);
        // used to hide "Reset Hits" when hits = 0
        if (!$row->hits) {
            $visibility = "style='display: none; visbility: hidden;'";
        } else {
            $visibility = "";
        }
        mosCommonHTML::loadOverlib();
        mosCommonHTML::loadCalendar();
        ?>
		<script language="javascript" type="text/javascript">
		<!--
		var sectioncategories = new Array;
		<?php 
        $i = 0;
        foreach ($sectioncategories as $k => $items) {
            foreach ($items as $v) {
                echo "sectioncategories[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "' );\n\t\t";
            }
        }
        ?>

		var folderimages = new Array;
		<?php 
        $i = 0;
        foreach ($images as $k => $items) {
            foreach ($items as $v) {
                echo "folderimages[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "' );\n\t\t";
            }
        }
        ?>

		function submitbutton(pressbutton) {
			var form = document.adminForm;

			if ( pressbutton == 'menulink' ) {
				if ( form.menuselect.value == "" ) {
					alert( "<?php 
        echo T_('Please select a Menu');
        ?>
" );
					return;
				} else if ( form.link_name.value == "" ) {
					alert( "<?php 
        echo T_('Please enter a Name for this menu item');
        ?>
" );
					return;
				}
			}

			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}
			// assemble the images back into one field
			var temp = new Array;
			for (var i=0, n=form.imagelist.options.length; i < n; i++) {
				temp[i] = form.imagelist.options[i].value;
			}
			form.images.value = temp.join( '\n' );

			// do field validation
			if (form.title.value == ""){
				alert( "<?php 
        echo T_('Content item must have a title');
        ?>
" );
			} else if (form.sectionid.value == "-1"){
				alert( "<?php 
        echo T_('You must select a Section.');
        ?>
" );
			} else if (form.catid.value == "-1"){
				alert( "<?php 
        echo T_('You must select a Category.');
        ?>
" );
 			} else if (form.catid.value == ""){
 				alert( "<?php 
        echo T_('You must select a Category.');
        ?>
" );
			} else {
				<?php 
        getEditorContents('editor1', 'introtext');
        ?>
				<?php 
        getEditorContents('editor2', 'fulltext');
        ?>
				submitform( pressbutton );
			}
		}
		
			// show / hide publishing information
			function displayParameterInfo()
			{
				
				if(document.getElementById('simpleediting').style.display == 'block')
				{
					document.getElementById('simpleediting').style.display = 'none';	
					document.getElementById('show').style.display = 'block';	
					document.getElementById('hide').style.display = 'none';
					document.adminForm.simple_editing.value ='on';
				}
				else
				{
					document.getElementById('simpleediting').style.display = 'block';
					document.getElementById('show').style.display = 'none';	
					document.getElementById('hide').style.display = 'block';
					document.adminForm.simple_editing.value ='off';
				}
				
			}
		//-->
		</script>
		
		<?php 
        if ($_SESSION['simple_editing'] == 'on') {
            $simpleediting = 'none';
            $simple = 'block';
            $advanced = 'none';
        } else {
            $advanced = 'block';
            $simple = 'none';
            $simpleediting = 'block';
        }
        ?>
		<form action="index2.php" method="post" name="adminForm">
		<input type ="hidden" name="simple_editing" value='' />
		<table class="adminheading" border="1">
		<tr>
			<th class="edit">
			<?php 
        echo T_('Content Item:');
        ?>
			<small>
			<?php 
        echo $row->id ? T_('Edit') : T_('New');
        ?>
			</small>
			<?php 
        if ($row->id) {
            ?>
				<small><small>
				[ <?php 
            echo T_('Section:');
            ?>
 <?php 
            echo $section;
            ?>
 ]
				</small></small>
				<?php 
        }
        ?>
			
			</th>
		</tr>
		</table>
		<table width="100%">
			<tr>
				<td valign="top" align="right">
				<div id = "show" style="display:<?php 
        echo $simple;
        ?>
">
				<a href="javascript:displayParameterInfo();"><?php 
        echo T_('Show Advanced Details');
        ?>
</a>
				</div>
				<div id = "hide" style="display:<?php 
        echo $advanced;
        ?>
">
				<a href="javascript:displayParameterInfo();"><?php 
        echo T_('Hide Advanced Details');
        ?>
</a>
				</div>
				</td>
			</tr>
		</table>
		<table cellspacing="0" cellpadding="0" width="100%" >
		<tr>
			<td valign="top">
			
				<table width="100%" class="adminform">
				<tr>
					<td width="500">
						<table cellspacing="0" cellpadding="0" border="0" width="100%">
						<tr >
							<th colspan="4">
							<?php 
        echo T_('Item Details');
        ?>
							</th>
						</tr>
						<tr>
							<td>
							<?php 
        echo T_('Title:');
        ?>
							</td>
							<td>
							<input class="text_area" type="text" name="title" size="30" maxlength="100" value="<?php 
        echo $row->title;
        ?>
" />
							</td>
							<td>
							<?php 
        echo T_('Section:');
        ?>
							</td>
							<td>
							<?php 
        echo $lists['sectionid'];
        ?>
							</td>
						</tr>
						<tr>
							<td>
							<?php 
        echo T_('Title Alias:');
        ?>
							</td>
							<td>
							<input name="title_alias" type="text" class="text_area" id="title_alias" value="<?php 
        echo $row->title_alias;
        ?>
" size="30" maxlength="100" />
							</td>
							<td>
							<?php 
        echo T_('Category:');
        ?>
							</td>
							<td>
							<?php 
        echo $lists['catid'];
        ?>
							</td>
						</tr>
						</table>
					</td>
				</tr>
			
				<tr>
					<td width="100%">
					<?php 
        echo T_('Intro Text:');
        ?>
 (<?php 
        echo T_('required');
        ?>
)
					<br /><?php 
        // parameters : areaname, content, hidden field, width, height, rows, cols
        editorArea('editor1', $row->introtext, 'introtext', '100%;', '200', '75', '20');
        ?>
					</td>
				</tr>
				<tr>
					<td width="100%">
					<?php 
        echo T_('Main Text:');
        ?>
 (<?php 
        echo T_('optional');
        ?>
)
					<br /><?php 
        // parameters : areaname, content, hidden field, width, height, rows, cols
        editorArea('editor2', $row->fulltext, 'fulltext', '100%;', '350', '75', '30');
        ?>
					</td>
				</tr>
				</table>
			</td>
			<td valign="top" align="right">
			<div id="simpleediting" style="display:<?php 
        echo $simpleediting;
        ?>
">
			<table width="100%" >
				<tr>
					<td width="200">
			
						<table width="400">
						<tr>
							<td >
							<?php 
        $tabs->startPane("content-pane");
        $tabs->startTab(T_("Publishing"), "publish-page");
        ?>
							<table class="adminform">
							<tr>
								<th colspan="2">
								<?php 
        echo T_('Publishing Info');
        ?>
								</th>
							</tr>
							<tr>
								<td valign="top" align="right">
								<?php 
        echo T_('Show on Frontpage:');
        ?>
								</td>
								<td>
								<input type="checkbox" name="frontpage" value="1" <?php 
        echo $row->frontpage ? 'checked="checked"' : '';
        ?>
 />
								</td>
							</tr>
							<tr>
								<td valign="top" align="right">
								<?php 
        echo T_('Published:');
        ?>
								</td>
								<td>
								<input type="checkbox" name="published" value="1" <?php 
        echo $row->state ? 'checked="checked"' : '';
        ?>
 />
								</td>
							</tr>
							<tr>
								<td valign="top" align="right">
								<?php 
        echo T_('Access Level:');
        ?>
								</td>
								<td>
								<?php 
        echo $lists['access'];
        ?>
 </td>
								</tr>
							<tr>
								<td valign="top" align="right">
								<?php 
        echo T_('Author Alias:');
        ?>
								</td>
								<td>
								<input type="text" name="created_by_alias" size="30" maxlength="100" value="<?php 
        echo $row->created_by_alias;
        ?>
" class="text_area" />
								</td>
							</tr>
							<tr>
								<td valign="top" align="right">
								<?php 
        // cause Mambo to be extremely slow w/ huge user table, comment out for now echo T_('Change Creator:');
        ?>
								</td>
								<td>
								<?php 
        // cause Mambo to be extremely slow w/ huge user table, comment out for now echo $lists['created_by'];
        ?>
 </td>
							</tr>
							<tr>
								<td valign="top" align="right"><?php 
        echo T_('Ordering:');
        ?>
</td>
								<td>
								<?php 
        echo $lists['ordering'];
        ?>
 </td>
							</tr>
							<tr>
								<td valign="top" align="right">
								<?php 
        echo T_('Override Created Date');
        ?>
								</td>
								<td>
								<input class="text_area" type="text" name="created" id="created" size="25" maxlength="19" value="<?php 
        echo $row->created;
        ?>
" />
								<input name="reset" type="reset" class="button" onClick="return showCalendar('created', 'y-mm-dd');" value="..." />
								</td>
							</tr>
							<tr>
								<td valign="top" align="right">
								<?php 
        echo T_('Start Publishing:');
        ?>
								</td>
								<td>
								<input class="text_area" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php 
        echo $row->publish_up;
        ?>
" />
								<input type="reset" class="button" value="..." onClick="return showCalendar('publish_up', 'y-mm-dd');" />
								</td>
							</tr>
							<tr>
								<td valign="top" align="right">
								<?php 
        echo T_('Finish Publishing:');
        ?>
								</td>
								<td>
								<input class="text_area" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php 
        echo $row->publish_down;
        ?>
" />
								<input type="reset" class="button" value="..." onClick="return showCalendar('publish_down', 'y-mm-dd');" />
								</td>
							</tr>
							</table>
							<br />
							<table class="adminform">
							<?php 
        if ($row->id) {
            ?>
								<tr>
									<td>
									<strong><?php 
            echo T_('Content ID:');
            ?>
</strong>
									</td>
									<td>
									<?php 
            echo $row->id;
            ?>
									</td>
								</tr>
								<?php 
        }
        ?>
							<tr>
								<td width="90px" valign="top" align="right">
								<strong><?php 
        echo T_('State:');
        ?>
</strong>
								</td>
								<td>
								<?php 
        echo $row->state > 0 ? T_('Published') : ($row->state < 0 ? T_('Archived') : T_('Draft Unpublished'));
        ?>
								</td>
							</tr>
							<tr >
								<td valign="top" align="right">
								<strong>
								<?php 
        echo T_('Hits');
        ?>
								</strong>:
								</td>
								<td>
								<?php 
        echo $row->hits;
        ?>
								<div <?php 
        echo $visibility;
        ?>
>
								<input name="reset_hits" type="button" class="button" value="<?php 
        echo T_('Reset Hit Count');
        ?>
" onClick="submitbutton('resethits');" />
								</div>
								</td>
							</tr>
							<tr>
								<td valign="top" align="right">
								<strong>
								<?php 
        echo T_('Revised');
        ?>
								</strong>:
								</td>
								<td>
								<?php 
        echo $row->version;
        ?>
 <?php 
        echo T_('times');
        ?>
								</td>
							</tr>
							<tr>
								<td valign="top" align="right">
								<strong>
								<?php 
        echo T_('Created');
        ?>
								</strong>
								</td>
								<td>
								<?php 
        echo $row->created ? "{$create_date}</td></tr><tr><td valign='top' align='right'><strong>" . T_('By') . "</strong></td><td>{$row->creator}" : "New document";
        ?>
								</td>
							</tr>
							<tr>
								<td valign="top" align="right">
								<strong>
								<?php 
        echo T_('Last Modified');
        ?>
								</strong>
								</td>
								<td>
								<?php 
        echo $row->modified ? "{$mod_date}</td></tr><tr><td valign='top' align='right'><strong>" . T_('By') . "</strong></td><td>{$row->modifier}" : "Not modified";
        ?>
								</td>
							</tr>
							</table>
							<?php 
        $tabs->endTab();
        $tabs->startTab(T_("Images"), "images-page");
        ?>
							<table class="adminform" width="100%">
							<tr>
								<th colspan="2">
								<?php 
        echo T_('MOSImage Control');
        ?>
								</th>
							</tr>
							<tr>
								<td colspan="6"><?php 
        echo T_('Sub-folder:');
        ?>
 <?php 
        echo $lists['folders'];
        ?>
</td>
							</tr>
							<tr>
								<td>
								<?php 
        echo T_('Gallery Images:');
        ?>
								<br />
								<?php 
        echo $lists['imagefiles'];
        ?>
								</td>
								<td valign="top">
								<img name="view_imagefiles" src="../images/M_images/blank.png" width="100" />
								</td>
							</tr>
							<tr>
								<td>
								<input class="button" type="button" value="<?php 
        echo T_('Add');
        ?>
" onClick="addSelectedToList('adminForm','imagefiles','imagelist')" />
								</td>
							</tr>
							<tr>
								<td>
								<?php 
        echo T_('Content Images:');
        ?>
								<br />
								<?php 
        echo $lists['imagelist'];
        ?>
								</td>
								<td valign="top">
								<img name="view_imagelist" src="../images/M_images/blank.png" width="100" />
								</td>
							</tr>
							<tr>
								<td>
								<input class="button" type="button" value="<?php 
        echo T_('up');
        ?>
" onClick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,-1)" />
								<input class="button" type="button" value="<?php 
        echo T_('down');
        ?>
" onClick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,+1)" />
								<input class="button" type="button" value="<?php 
        echo T_('remove');
        ?>
" onClick="delSelectedFromList('adminForm','imagelist')" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<?php 
        echo T_('Edit the image selected:');
        ?>
									<table>
									<tr>
										<td align="right">
										<?php 
        echo T_('Source:');
        ?>
										</td>
										<td>
										<input class="text_area" type="text" name= "_source" value="" />
										</td>
									</tr>
									<tr>
										<td align="right">
										<?php 
        echo T_('Image Align:');
        ?>
										</td>
										<td>
										<?php 
        echo $lists['_align'];
        ?>
										</td>
									</tr>
									<tr>
										<td align="right">
										<?php 
        echo T_('Alt Text:');
        ?>
										</td>
										<td>
										<input class="text_area" type="text" name="_alt" value="" />
										</td>
									</tr>
									<tr>
										<td align="right">
										<?php 
        echo T_('Border:');
        ?>
										</td>
										<td>
										<input class="text_area" type="text" name="_border" value="" size="3" maxlength="1" />
										</td>
									</tr>
									<tr>
										<td align="right">
										<?php 
        echo T_('Caption:');
        ?>
										</td>
										<td>
										<input class="text_area" type="text" name="_caption" value="" size="30" />
										</td>
									</tr>
									<tr>
										<td align="right">
										<?php 
        echo T_('Caption Position:');
        ?>
										</td>
										<td>
										<?php 
        echo $lists['_caption_position'];
        ?>
										</td>
									</tr>
									<tr>
										<td align="right">
										<?php 
        echo T_('Caption Align:');
        ?>
										</td>
										<td>
										<?php 
        echo $lists['_caption_align'];
        ?>
										</td>
									</tr>
									<tr>
										<td align="right">
										<?php 
        echo T_('Width:');
        ?>
										</td>
										<td>
										<input class="text_area" type="text" name="_width" value="" size="5" maxlength="5" />
										</td>
									</tr>
									<tr>
										<td colspan="2">
										<input class="button" type="button" value="<?php 
        echo T_('Apply');
        ?>
" onClick="applyImageProps()" />
										</td>
									</tr>
									</table>
								</td>
							</tr>
							</table>
							<?php 
        $tabs->endTab();
        $tabs->startTab(T_("Parameters"), "params-page");
        ?>
							<table class="adminform">
							<tr>
								<th colspan="2">
								<?php 
        echo T_('Parameter Control');
        ?>
								</th>
							</tr>
							<tr>
								<td>
								* <?php 
        echo T_('These Parameters only control what you see when you click to view an item fully');
        ?>
 *
								<br /><br />
								</td>
							</tr>
							<tr>
								<td>
								<?php 
        echo $params->render();
        ?>
								</td>
							</tr>
							</table>
							<?php 
        $tabs->endTab();
        $tabs->startTab(T_("Meta Info"), "metadata-page");
        ?>
							<table class="adminform">
							<tr>
								<th colspan="2">
								<?php 
        echo T_('Meta Data');
        ?>
								</th>
							</tr>
							<tr>
								<td>
								<?php 
        echo T_('Description:');
        ?>
								<br />
								<textarea class="text_area" cols="30" rows="3" style="width:300px; height:50px" name="metadesc" width="500"><?php 
        echo str_replace('&', '&amp;', $row->metadesc);
        ?>
</textarea>
								</td>
							</tr>
								<tr>
								<td>
								<?php 
        echo T_('Keywords:');
        ?>
								<br />
								<textarea class="text_area" cols="30" rows="3" style="width:300px; height:50px" name="metakey" width="500"><?php 
        echo str_replace('&', '&amp;', $row->metakey);
        ?>
</textarea>
								</td>
							</tr>
							<tr>
								<td>
								<input type="button" class="button" value="<?php 
        echo T_('Add Sect/Cat/Title');
        ?>
" onClick="f=document.adminForm;f.metakey.value=document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].text+', '+getSelectedText('adminForm','catid')+', '+f.title.value+f.metakey.value;" />
								</td>
							</tr>
							</table>
							<?php 
        $tabs->endTab();
        $tabs->startTab(T_("Link to Menu"), "link-page");
        ?>
							<table class="adminform">
							<tr>
								<th colspan="2">
								<?php 
        echo T_('Link to Menu');
        ?>
								</th>
							</tr>
							<tr>
								<td colspan="2">
								<?php 
        echo T_("This will create a 'Link - Content Item' in the menu you select");
        ?>
								<br /><br />
								</td>
							</tr>
							<tr>
								<td valign="top" width="90px">
								<?php 
        echo T_('Select a Menu');
        ?>
								</td>
								<td>
								<?php 
        echo $lists['menuselect'];
        ?>
								</td>
							</tr>
							<tr>
								<td valign="top" width="90px">
								<?php 
        echo T_('Menu Item Name');
        ?>
								</td>
								<td>
								<input type="text" name="link_name" class="inputbox" value="" size="30" />
								</td>
							</tr>
							<tr>
								<td>
								</td>
								<td>
								<input name="menu_link" type="button" class="button" value="<?php 
        echo T_('Link to Menu');
        ?>
" onClick="submitbutton('menulink');" />
								</td>
							</tr>
							<tr>
								<th colspan="2">
								<?php 
        echo T_('Existing Menu Links');
        ?>
								</th>
							</tr>
							<?php 
        if ($menus == NULL) {
            ?>
								<tr>
									<td colspan="2">
									<?php 
            echo T_('None');
            ?>
									</td>
								</tr>
								<?php 
        } else {
            mosCommonHTML::menuLinksContent($menus);
        }
        ?>
							<tr>
								<td colspan="2">
								</td>
							</tr>
							</table>
							<?php 
        $tabs->endTab();
        $tabs->endPane();
        ?>
							</td>
						</tr>		
						</table>
					</td>
					</tr>
					</table>
					</div>
					</td>	
				</tr>
			</table>
			<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
			<input type="hidden" name="version" value="<?php 
        echo $row->version;
        ?>
" />
			<input type="hidden" name="mask" value="0" />
			<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
			<input type="hidden" name="redirect" value="<?php 
        echo $redirect;
        ?>
" />
			<input type="hidden" name="task" value="" />
			<input type="hidden" name="images" value="" />
			<input type="hidden" name="hidemainmenu" value="0" />
			</form>
		</td>
	</tr>
</table>
		<?php 
    }
    function controlPanel()
    {
        //hack for JOomla 13 ADRIEN
        unset($GLOBALS["task"]);
        unset($_REQUEST["task"]);
        ?>

<link rel="stylesheet" href="components/com_acajoom/cssadmin/acajoom.css" type="text/css" >
<div align="center" class="centermain">
<div id="acajoom">
		<table class="acajoomcss">
            <tr>
         	<td width="58%" valign="top">
				<?php 
        echo backHTML::iconsPanel();
        ?>
			</td>
			<td width="42%" valign="top">

			<div style="width=100%;">
			<form action="index2.php" method="post" name="adminForm">
			<?php 
        $tabs = new mosTabs(1);
        $tabs->startPane('acaControlPanel');
        $tabs->startTab(_ACA_MENU_TAB_SUM, "acaControlPanel.Summary");
        ?>
			<table class="acajoom_stats" style="text-align: left; width: 100%; " cellpadding="2" cellspacing="0">
			<tbody>
				<tr>
					 <th style="text-align: center;"><?php 
        echo '#';
        ?>
					 </th>
					 <th style="text-align: center;"><?php 
        echo _ACA_MENU_TAB_LIST;
        ?>
</th>
					 <th style="text-align: center;"><?php 
        echo _ACA_MENU_MAILING_TITLE;
        ?>
</th>
					 <th style="text-align: center;"><?php 
        echo _ACA_SENT_MAILING;
        ?>
</th>
					 <th style="text-align: center;"><?php 
        echo _ACA_DESC_SUBSCRIBERS;
        ?>
</th>
				</tr>
			 <?php 
        $html = '';
        $totalist = 0;
        $totalmail = 0;
        $totalsub = 0;
        $totalsent = 0;
        $nb = explode(',', $GLOBALS[ACA . 'activelist']);
        $size = sizeof($nb);
        for ($i = 0; $i < $size; $i++) {
            $index = $nb[$i];
            if ($GLOBALS[ACA . 'listshow' . $index] > 0 and $GLOBALS[ACA . 'listype' . $index] == 1) {
                $html .= '<tr>';
                $html .= '<td><b>' . @constant($GLOBALS[ACA . 'listnames' . $index]) . '</b></td>';
                $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'act_totallist' . $index] . ' </td>';
                $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'act_totalmailing' . $index] . ' </td>';
                $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'totalmailingsent' . $index] . ' </td>';
                $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'act_totalsubcribers' . $index] . ' </td>';
                $html .= '</tr>';
                $totalist = $totalist + $GLOBALS[ACA . 'act_totallist' . $index];
                $totalmail = $totalmail + $GLOBALS[ACA . 'act_totalmailing' . $index];
                $totalsent = $totalsent + $GLOBALS[ACA . 'totalmailingsent' . $index];
                if ($GLOBALS[ACA . 'act_totalsubcribers' . $index] < $totalsub) {
                    $totalsub = $GLOBALS[ACA . 'act_totalsubcribers' . $index];
                }
            }
        }
        $html .= '<tr>';
        $html .= '<td><b>' . _ACA_CP_TOTAL . '</b></td>';
        $html .= '<td style="text-align: center; ">' . $totalist . ' </td>';
        $html .= '<td style="text-align: center; ">' . $totalmail . ' </td>';
        $html .= '<td style="text-align: center; ">' . $totalsent . ' </td>';
        $html .= '<td style="text-align: center; ">' . $totalsub . ' </td>';
        $html .= '</tr>';
        echo $html;
        ?>
			 </tbody></table>
			 <br />
			<?php 
        if (class_exists('auto')) {
            echo auto::showQueue();
        }
        $tabs->endTab();
        $tabs->startTab(_ACA_MENU_SUBSCRIBERS, "acaControlPanel.Subscribers");
        $emailsearch = '';
        $listId = 0;
        $start = mosGetParam($_REQUEST, 'start', 0);
        $limit = mosGetParam($_REQUEST, 'limit', 15);
        $order = mosGetParam($_REQUEST, 'order', 'date');
        $total = 0;
        $subscribers = subscribers::getSubscribers($start, $limit, $emailsearch, $total, $listId, '', 1, 1, 'sub_dateD');
        mosCommonHTML::loadOverlib();
        ?>
			<script type="text/javascript">
				function checkcid(myField) {
					myField.checked = true;
					isChecked(true);
				}
			</script>
<!--			<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>  -->

			<form action="index2.php" method="post" name="adminForm">
				<input type="hidden" name="option" value="com_acajoom" />
				<input type="hidden" name="act" value="acajoom" />
				<input type="hidden" name="task" value="" />
				<input type="hidden" name="userid" value="" />
		    	<input type="hidden" name="boxchecked" value="0" />
				<input type="hidden" name="listid" value="<?php 
        echo $listId;
        ?>
" />
				<input type="hidden" name="start" value="<?php 
        echo $start;
        ?>
" />
				<input type="hidden" name="limit" value="<?php 
        echo $limit;
        ?>
" />
				<input type="hidden" name="emailsearch" value="<?php 
        echo $emailsearch;
        ?>
" />
			<table width="100%"  border="0" cellspacing="0" cellpadding="4" class="adminlist">
				<tr>
					<th class="title">#</th>
					<th class="title" style="text-align: left;"><?php 
        echo _ACA_INPUT_NAME;
        ?>
</th>
					<th class="title" style="text-align: left;"><?php 
        echo _ACA_INPUT_EMAIL;
        ?>
</th>
					<th class="title" style="text-align: center;"><?php 
        echo _ACA_SIGNUP_DATE;
        ?>
</th>
				</tr>

				<?php 
        $i = 0;
        foreach ($subscribers as $subscriber) {
            ?>
				<tr class="row<?php 
            echo $i++ % 2;
            ?>
">
					<td><?php 
            echo $i + $start;
            ?>
</td>
					<td style="text-align: left;">
					<a href="index2.php?option=com_acajoom&act=subscribers&task=show&userid=<?php 
            echo $subscriber->id;
            ?>
" >
					<?php 
            echo $subscriber->name;
            ?>
</a></td>
					<td style="text-align: left;"><?php 
            echo $subscriber->email;
            ?>
</td>
					<td style="text-align: center;"><?php 
            echo mosFormatDate($subscriber->subscribe_date, '%x');
            ?>
</td>
				</tr>
				<?php 
        }
        ?>
			</table>
			</form>
			<?php 
        backHTML::footerCounts($start, $limit, $emailsearch, $total, 4, '', $listId, '');
        $tabs->endTab();
        $tabs->startTab(_ACA_MENU_TAB_LIST, "acaControlPanel.Lists");
        $lists = lists::getLists(0, 0, 1, '', false, false, false);
        ?>
			<table class="adminlist">
				<tr>
					<th class="title">#</th>
					<th class="title" width="65%"  style="text-align: left;"><?php 
        echo _ACA_LIST_NAME;
        ?>
</th>
					<th class="title" width="25%"  style="text-align: left;"><?php 
        echo _ACA_LIST_TYPE;
        ?>
</th>
					<th class="title"  style="text-align: center;">#id</th>
				</tr>
			<?php 
        $i = 0;
        foreach ($lists as $list) {
            $i++;
            $link = 'index2.php?option=com_acajoom&act=mailing&task=show&listid=' . $list->id;
            ?>
				<tr>
					<td><?php 
            echo $i;
            ?>
</td>
					<td  style="text-align: left;">
						<a href="<?php 
            echo $link;
            ?>
">
							<?php 
            echo $list->list_name;
            ?>
</a>
					</td>
					<td  style="text-align: left;"><a href='index2.php?option=com_acajoom&act=mailing&listype=<?php 
            echo $list->list_type;
            ?>
'><?php 
            echo @constant($GLOBALS[ACA . 'listname' . $list->list_type]);
            ?>
</a></td>
					<td  style="text-align: center;"><?php 
            echo $list->id;
            ?>
</td>
					</tr>
			<?php 
        }
        ?>
			<tr>
				<th colspan="4">
				</th>
			</tr>
			</table>
			<?php 
        $tabs->endTab();
        $tabs->endPane();
        ?>
			</form>
		</div>
		<div style="clear:both; float:left;">
		<?php 
        echo acajoom::printM('blue', _ACA_SERVER_LOCAL_TIME . ' :' . mosFormatDate(acajoom::getNow(), '%A, %d %B %Y %H:%M', 0));
        ?>
		</div>
   <td>
   </tr>
   </table>
   </div>
</div>
<?php 
    }
    /**
     * Writes Modified Date
     */
    function ModifiedDate(&$row, &$params)
    {
        $mod_date = null;
        if (intval($row->modified) != 0) {
            $mod_date = mosFormatDate($row->modified);
        }
        if ($mod_date != '' && $params->get('modifydate')) {
            ?>
			<tr>
				<td colspan="2" align="left" class="modifydate">
					<?php 
            echo _LAST_UPDATED;
            ?>
 ( <?php 
            echo $mod_date;
            ?>
 )
				</td>
			</tr>
			<?php 
        }
    }
Example #26
0
    function _showTabPermissions(&$row, &$lists, $last, $created)
    {
        global $_DOCMAN, $_DMUSER;
        ?>
    	<fieldset class="input">
        <p>
			<label for="dmowner"><?php 
        echo _DML_OWNER;
        ?>
</label><br />
			<?php 
        echo $lists['viewer'];
        ?>
			<?php 
        echo DOCMAN_Utils::mosToolTip(_DML_OWNER_TOOLTIP . '</span>', _DML_OWNER);
        ?>
		</p>
    	<p>
			<label for="dmmaintainedby"><?php 
        echo _DML_MAINTAINER;
        ?>
</label><br />
			<?php 
        echo $lists['maintainer'];
        ?>
			<?php 
        echo DOCMAN_Utils::mosToolTip(_DML_MANT_TOOLTIP . '</span>', _DML_MAINTAINER);
        ?>
		</p>
    	<p>
			<label for="dmcreatedby"> <?php 
        echo _DML_CREATED_BY;
        ?>
</label><br />
			[<?php 
        echo $created[0]->name;
        ?>
]&nbsp;
			<i>
			<?php 
        echo _DML_ON . "&nbsp;";
        ?>
			<?php 
        if ($row->dmdate_published) {
            echo mosFormatDate($row->dmdate_published);
        } else {
            $date = date("Y-m-d H:i:s", time("Y-m-d g:i:s"));
            echo mosFormatDate($row->dmdate_published);
        }
        ?>
   			</i>
		</p>
       	<p>
			<label for="dmupdatedby"> <?php 
        echo _DML_UPDATED_BY;
        ?>
</label><br />
			[<?php 
        echo $created[0]->name;
        ?>
]&nbsp;

			<?php 
        if ($row->dmlastupdateon) {
            echo "<i>" . _DML_ON . "&nbsp;" . mosFormatDate($row->dmlastupdateon) . "</i>";
        }
        ?>
		</p>
  		</fieldset>
  		<?php 
    }
Example #27
0
function pollresult($uid)
{
    global $database, $Itemid;
    global $mainframe;
    $poll = new mosPoll($database);
    $poll->load((int) $uid);
    // if id value is passed and poll not published then exit
    if ($poll->id != '' && !$poll->published) {
        mosNotAuth();
        return;
    }
    $first_vote = '';
    $last_vote = '';
    $votes = '';
    /*
    Check if there is a poll corresponding to id
    and if poll is published
    */
    if (isset($poll->id) && $poll->id != '' && $poll->published == 1) {
        if (empty($poll->title)) {
            $poll->id = '';
            $poll->title = _SELECT_POLL;
        }
        $query = "SELECT MIN( date ) AS mindate, MAX( date ) AS maxdate" . "\n FROM #__poll_date" . "\n WHERE poll_id = " . (int) $poll->id;
        $database->setQuery($query);
        $dates = $database->loadObjectList();
        if (isset($dates[0]->mindate)) {
            $first_vote = mosFormatDate($dates[0]->mindate, _DATE_FORMAT_LC2);
            $last_vote = mosFormatDate($dates[0]->maxdate, _DATE_FORMAT_LC2);
        }
        $query = "SELECT a.id, a.text, a.hits, b.voters" . "\n FROM #__poll_data AS a" . "\n INNER JOIN #__polls AS b ON b.id = a.pollid" . "\n WHERE a.pollid = " . (int) $poll->id . "\n AND a.text != ''" . "\n AND b.published = 1";
        $database->setQuery($query);
        $votes = $database->loadObjectList();
    }
    // list of polls for dropdown selection
    $query = "SELECT id, title" . "\n FROM #__polls" . "\n WHERE published = 1" . "\n ORDER BY id";
    $database->setQuery($query);
    $polls = $database->loadObjectList();
    // Itemid for dropdown
    $_Itemid = '';
    if ($Itemid && $Itemid != 99999999) {
        $_Itemid = '&amp;Itemid=' . $Itemid;
    }
    // dropdown output
    $link = sefRelToAbs('index.php?option=com_poll&amp;task=results&amp;id=\' + this.options[selectedIndex].value + \'' . $_Itemid . '\' + \'');
    $pollist = '<select name="id" class="inputbox" size="1" style="width:200px" onchange="if (this.options[selectedIndex].value != \'\') {document.location.href=\'' . $link . '\'}">';
    $pollist .= '<option value="">' . _SELECT_POLL . '</option>';
    for ($i = 0, $n = count($polls); $i < $n; $i++) {
        $k = $polls[$i]->id;
        $t = $polls[$i]->title;
        $sel = $k == intval($poll->id) ? " selected=\"selected\"" : '';
        $pollist .= "\n\t<option value=\"" . $k . "\"{$sel}>" . $t . "</option>";
    }
    $pollist .= '</select>';
    // Adds parameter handling
    $menu = $mainframe->get('menu');
    $params = new mosParameters($menu->params);
    $params->def('page_title', 1);
    $params->def('pageclass_sfx', '');
    $params->def('back_button', $mainframe->getCfg('back_button'));
    $params->def('header', $menu->name);
    $mainframe->SetPageTitle($poll->title);
    poll_html::showResults($poll, $votes, $first_vote, $last_vote, $pollist, $params);
}
    function showUsers(&$rows, $pageNav, $search, $option, $lists)
    {
        ?>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="user">
			Administrar Usuários 
			</th>
			<td>
			Filtro:
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo htmlspecialchars($search);
        ?>
" class="inputbox" onChange="document.adminForm.submit();" />
			</td>
			<td width="right">
			<?php 
        echo $lists['type'];
        ?>
			</td>
			<td width="right">
			<?php 
        echo $lists['logged'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="2%" class="title">
			nº
			</th>
			<th width="3%" class="title">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			Nome
			</th>
			<th width="15%" class="title" >
			Nome de Usuário
			</th>
			<th width="5%" class="title" nowrap="nowrap">
			Autenticado
			</th>
			<th width="5%" class="title">
			Ativo
			</th>
			<th width="15%" class="title">
			Grupo
			</th>
			<th width="15%" class="title">
			E-mail
			</th>
			<th width="10%" class="title">
			Última visita
			</th>
			<th width="1%" class="title">
			ID
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $img = $row->block ? 'publish_x.png' : 'tick.png';
            $task = $row->block ? 'unblock' : 'block';
            $alt = $row->block ? 'Ativado' : 'Bloqueado';
            $link = 'index2.php?option=com_users&amp;task=editA&amp;id=' . $row->id . '&amp;hidemainmenu=1';
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $i + 1 + $pageNav->limitstart;
            ?>
				</td>
				<td>
				<?php 
            echo mosHTML::idBox($i, $row->id);
            ?>
				</td>
				<td>
				<a href="<?php 
            echo $link;
            ?>
">
				<?php 
            echo $row->name;
            ?>
				</a>
				<td>
				<?php 
            echo $row->username;
            ?>
				</td>
				</td>
				<td align="center">
				<?php 
            echo $row->loggedin ? '<img src="images/tick.png" width="12" height="12" border="0" alt="" />' : '';
            ?>
				</td>
				<td>
				<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
				<img src="images/<?php 
            echo $img;
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $alt;
            ?>
" />
				</a>
				</td>
				<td>
				<?php 
            echo $row->groupname;
            ?>
				</td>
				<td>
				<a href="mailto:<?php 
            echo $row->email;
            ?>
">
				<?php 
            echo $row->email;
            ?>
				</a>
				</td>
				<td nowrap="nowrap">
				<?php 
            echo mosFormatDate($row->lastvisitDate, _CURRENT_SERVER_TIME_FORMAT);
            ?>
				</td>
				<td>
				<?php 
            echo $row->id;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }
    /**
     * Writes the edit form for new and existing content item
     *
     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
     * property set to 0.
     * @param mosContent The category object
     * @param string The html for the groups select list
     */
    function editContent(&$row, $section, &$lists, &$sectioncategories, &$images, &$params, $option, $redirect, &$menus)
    {
        global $database;
        mosMakeHtmlSafe($row);
        $nullDate = $database->getNullDate();
        $create_date = null;
        if ($row->created != $nullDate) {
            $create_date = mosFormatDate($row->created, '%A, %d %B %Y %H:%M', '0');
        }
        $mod_date = null;
        if ($row->modified != $nullDate) {
            $mod_date = mosFormatDate($row->modified, '%A, %d %B %Y %H:%M', '0');
        }
        $tabs = new mosTabs(1);
        // used to hide "Reset Hits" when hits = 0
        if (!$row->hits) {
            $visibility = "style='display: none; visibility: hidden;'";
        } else {
            $visibility = "";
        }
        mosCommonHTML::loadOverlib();
        mosCommonHTML::loadCalendar();
        ?>
		<script language="javascript" type="text/javascript">
		<!--
		var sectioncategories = new Array;
		<?php 
        $i = 0;
        foreach ($sectioncategories as $k => $items) {
            foreach ($items as $v) {
                echo "sectioncategories[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->id) . "','" . addslashes($v->name) . "' );\t";
            }
        }
        ?>

		var folderimages = new Array;
		<?php 
        $i = 0;
        foreach ($images as $k => $items) {
            foreach ($items as $v) {
                echo "folderimages[" . $i++ . "] = new Array( '{$k}','" . addslashes(ampReplace($v->value)) . "','" . addslashes(ampReplace($v->text)) . "' );\t";
            }
        }
        ?>

		function submitbutton(pressbutton) {
			var form = document.adminForm;

			if ( pressbutton == 'menulink' ) {
				if ( form.menuselect.value == "" ) {
					alert( "Selecione um menu" );
					return;
				} else if ( form.link_name.value == "" ) {
					alert( "Por favor, informe um nome para este item do menu" );
					return;
				}
			}

			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}
			// assemble the images back into one field
			var temp = new Array;
			for (var i=0, n=form.imagelist.options.length; i < n; i++) {
				temp[i] = form.imagelist.options[i].value;
			}
			form.images.value = temp.join( '\n' );

			// do field validation
			if (form.title.value == ""){
				alert( "Item de conteúdo deve ter um título" );
			} else if (form.sectionid.value == "-1"){
				alert( "Você deve selecionar uma seção." );
			} else if (form.catid.value == "-1"){
				alert( "Você deve selecionar uma categoria." );
 			} else if (form.catid.value == ""){
 				alert( "Você deve selecionar uma categoria." );
			} else {
				<?php 
        getEditorContents('editor1', 'introtext');
        ?>
				<?php 
        getEditorContents('editor2', 'fulltext');
        ?>
				submitform( pressbutton );
			}
		}
		//-->
		</script>
		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th class="edit">
			Itens de Conteúdo:
			<small>
			<?php 
        echo $row->id ? 'Editar' : 'Novo';
        ?>
			</small>
			<?php 
        if ($row->id) {
            ?>
				<small><small>
				[ Seção: <?php 
            echo $section;
            ?>
 ]
				</small></small>
				<?php 
        }
        ?>
			</th>
		</tr>
		</table>

		<table cellspacing="0" cellpadding="0" width="100%">
		<tr>
			<td width="60%" valign="top">
				<table width="100%" class="adminform">
				<tr>
					<td width="100%">
						<table cellspacing="0" cellpadding="0" border="0" width="100%">
						<tr>
							<th colspan="4">
							Detalhes do Item
							</th>
						</tr>
						<tr>
							<td>
							Título:
							</td>
							<td>
							<input class="text_area" type="text" name="title" size="30" maxlength="100" value="<?php 
        echo $row->title;
        ?>
" />
							</td>
							<td>
							Seção:
							</td>
							<td>
							<?php 
        echo $lists['sectionid'];
        ?>
							</td>
						</tr>
						<tr>
							<td>
							Sub-Título:
							</td>
							<td>
							<input name="title_alias" type="text" class="text_area" id="title_alias" value="<?php 
        echo $row->title_alias;
        ?>
" size="30" maxlength="100" />
							</td>
							<td>
							Categoria:
							</td>
							<td>
							<?php 
        echo $lists['catid'];
        ?>
							</td>
						</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td width="100%">
					Texto de Introdução: (necessário)
					<br /><?php 
        // parameters : areaname, content, hidden field, width, height, rows, cols
        editorArea('editor1', $row->introtext, 'introtext', '100%;', '350', '75', '20');
        ?>
					</td>
				</tr>
				<tr>
					<td width="100%">
					Texto principal: (opcional)
					<br /><?php 
        // parameters : areaname, content, hidden field, width, height, rows, cols
        editorArea('editor2', $row->fulltext, 'fulltext', '100%;', '400', '75', '30');
        ?>
					</td>
				</tr>
				</table>
			</td>
			<td valign="top" width="40%">
				<?php 
        $tabs->startPane("content-pane");
        $tabs->startTab("Publicação", "publish-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Info da Publicação
					</th>
				</tr>
				<tr>
					<td valign="top" align="right" width="120">
					Exibir na Página Inicial:
					</td>
					<td>
					<input type="checkbox" name="frontpage" value="1" <?php 
        echo $row->frontpage ? 'checked="checked"' : '';
        ?>
 />
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Publicado:
					</td>
					<td>
					<input type="checkbox" name="published" value="1" <?php 
        echo $row->state ? 'checked="checked"' : '';
        ?>
 />
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Nível de Acesso:
					</td>
					<td>
					<?php 
        echo $lists['access'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Apelido do Autor:
					</td>
					<td>
					<input type="text" name="created_by_alias" size="30" maxlength="100" value="<?php 
        echo $row->created_by_alias;
        ?>
" class="text_area" />
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Alterar Autor:
					</td>
					<td>
					<?php 
        echo $lists['created_by'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">Ordem:</td>
					<td>
					<?php 
        echo $lists['ordering'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Alterar Data de Criação 
					</td>
					<td>
					<input class="text_area" type="text" name="created" id="created" size="25" maxlength="19" value="<?php 
        echo $row->created;
        ?>
" />
					<input name="reset" type="reset" class="button" onclick="return showCalendar('created', 'y-mm-dd');" value="..." />
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Início da Publicação:
					</td>
					<td>
					<input class="text_area" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php 
        echo $row->publish_up;
        ?>
" />
					<input type="reset" class="button" value="..." onclick="return showCalendar('publish_up', 'y-mm-dd');" />
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					Fim da Publicação:
					</td>
					<td>
					<input class="text_area" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php 
        echo $row->publish_down;
        ?>
" />
					<input type="reset" class="button" value="..." onclick="return showCalendar('publish_down', 'y-mm-dd');" />
					</td>
				</tr>
				</table>
				<br />
				<table class="adminform">
				<?php 
        if ($row->id) {
            ?>
					<tr>
						<td>
						<strong>ID do conteúdo:</strong>
						</td>
						<td>
						<?php 
            echo $row->id;
            ?>
						</td>
					</tr>
					<?php 
        }
        ?>
				<tr>
					<td width="120" valign="top" align="right">
					<strong>Estado:</strong>
					</td>
					<td>
					<?php 
        echo $row->state > 0 ? 'Publicado' : ($row->state < 0 ? 'Arquivado' : 'Rascunho não publicado');
        ?>
					</td>
				</tr>
				<tr >
					<td valign="top" align="right">
					<strong>
					Acessos
					</strong>:
					</td>
					<td>
					<?php 
        echo $row->hits;
        ?>
					<div <?php 
        echo $visibility;
        ?>
>
					<input name="reset_hits" type="button" class="button" value="Reiniciar Contagem" onclick="submitbutton('resethits');" />
					</div>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>
					Revisão
					</strong>:
					</td>
					<td>
					<?php 
        echo $row->version;
        ?>
 vez(es)
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>
					Criado
					</strong>
					</td>
					<td>
						<?php 
        if (!$create_date) {
            ?>
							Novo documento
							<?php 
        } else {
            echo $create_date;
        }
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong>
					Última Alteração
					</strong>
					</td>
					<td>
						<?php 
        if (!$mod_date) {
            ?>
							Não alterado
							<?php 
        } else {
            echo $mod_date;
            ?>
							<br />
							<?php 
            echo $row->modifier;
        }
        ?>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Imagens", "images-page");
        ?>
				<table class="adminform" width="100%">
				<tr>
					<th colspan="2">
						Controle do MOSImage
					</th>
				</tr>
				<tr>
					<td colspan="2">
						<table width="100%">
						<tr>
							<td width="48%" valign="top">
								<div align="center">
									Imagens na Galeria:
									<br />
									<?php 
        echo $lists['imagefiles'];
        ?>
								</div>
							</td>
							<td width="2%">
								<input class="button" type="button" value=">>" onclick="addSelectedToList('adminForm','imagefiles','imagelist')" title="Adicionar"/>
								<br />
								<input class="button" type="button" value="<<" onclick="delSelectedFromList('adminForm','imagelist')" title="Remover"/>
							</td>
							<td width="48%">
								<div align="center">
									Imagens no Artigo:
									<br />
									<?php 
        echo $lists['imagelist'];
        ?>
									<br />
									<input class="button" type="button" value="Para cima" onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,-1)" />
									<input class="button" type="button" value="Para baixo" onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,+1)" />
								</div>
							</td>
						</tr>
						</table>
						Sub-pastas: <?php 
        echo $lists['folders'];
        ?>
					</td>
				</tr>
				<tr valign="top">
					<td>
						<div align="center">
							Imagem de amostra:<br/>
							<img name="view_imagefiles" src="../images/M_images/blank.png" alt="Imagem vazia padrão" width="100" />
						</div>
					</td>
					<td valign="top">
						<div align="center">
							Imagem Ativa:<br/>
							<img name="view_imagelist" src="../images/M_images/blank.png" alt="Imagem Ativa" width="100" />
						</div>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						Edite a imagem selecionada:
						<table>
						<tr>
							<td align="right">
							Fonte:
							</td>
							<td>
							<input class="text_area" type="text" name= "_source" value="" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Alinhamento:
							</td>
							<td>
							<?php 
        echo $lists['_align'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							Texto Alt:
							</td>
							<td>
							<input class="text_area" type="text" name="_alt" value="" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Borda:
							</td>
							<td>
							<input class="text_area" type="text" name="_border" value="" size="3" maxlength="1" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Sub-Título:
							</td>
							<td>
							<input class="text_area" type="text" name="_caption" value="" size="30" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Posição do Sub-Título:
							</td>
							<td>
							<?php 
        echo $lists['_caption_position'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							Alinhamento do Sub-Título:
							</td>
							<td>
							<?php 
        echo $lists['_caption_align'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							Largura Sub-Título:
							</td>
							<td>
							<input class="text_area" type="text" name="_width" value="" size="5" maxlength="5" />
							</td>
						</tr>
						<tr>
							<td colspan="2">
							<input class="button" type="button" value="Aplicar" onclick="applyImageProps()" />
							</td>
						</tr>
						</table>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Parâmetros", "params-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Controle de Parâmetros
					</th>
				</tr>
				<tr>
					<td>
					Estes parâmetros somente controlam o que você vê quando clica para visualizar um item completamente
					<br /><br />
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo $params->render();
        ?>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Meta dados", "metadata-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Meta Dados
					</th>
				</tr>
				<tr>
					<td>
					Descrição:
					<br />
					<textarea class="text_area" cols="30" rows="3" style="width: 350px; height: 50px" name="metadesc"><?php 
        echo str_replace('&', '&amp;', $row->metadesc);
        ?>
</textarea>
					</td>
				</tr>
					<tr>
					<td>
					Palavras Chaves:
					<br />
					<textarea class="text_area" cols="30" rows="3" style="width: 350px; height: 50px" name="metakey"><?php 
        echo str_replace('&', '&amp;', $row->metakey);
        ?>
</textarea>
					</td>
				</tr>
				<tr>
					<td>
					<input type="button" class="button" value="Adicionar titulo Seção/Categoria/Título" onclick="f=document.adminForm;f.metakey.value=document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].text+', '+getSelectedText('adminForm','catid')+', '+f.title.value+f.metakey.value;" />
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab("Link para o Menu", "link-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Link para o Menu
					</th>
				</tr>
				<tr>
					<td colspan="2">
					Isto irá criar um 'Link - Item de Conteúdo' no menu que você selecionou 
					<br /><br />
					</td>
				</tr>
				<tr>
					<td valign="top" width="90">
					Selecione um Menu
					</td>
					<td>
					<?php 
        echo $lists['menuselect'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" width="90">
					Nome do Menu
					</td>
					<td>
					<input type="text" name="link_name" class="inputbox" value="" size="30" />
					</td>
				</tr>
				<tr>
					<td>
					</td>
					<td>
					<input name="menu_link" type="button" class="button" value="Link para o Menu" onclick="submitbutton('menulink');" />
					</td>
				</tr>
				<tr>
					<th colspan="2">
					Links de Menu Existentes
					</th>
				</tr>
				<?php 
        if ($menus == NULL) {
            ?>
					<tr>
						<td colspan="2">
						Nenhum
						</td>
					</tr>
					<?php 
        } else {
            mosCommonHTML::menuLinksContent($menus);
        }
        ?>
				<tr>
					<td colspan="2">
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->endPane();
        ?>
			</td>
		</tr>
		</table>

		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="version" value="<?php 
        echo $row->version;
        ?>
" />
		<input type="hidden" name="mask" value="0" />
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="redirect" value="<?php 
        echo $redirect;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="images" value="" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }
Example #30
0
    function display(&$rows, $params)
    {
        global $mosConfig_offset;
        $c = count($rows);
        $tabclass = array("sectiontableentry1", "sectiontableentry2");
        $k = 0;
        // number of matches found
        printf(Tn_('returned %d match', 'returned %d matches', $c), $c);
        ?>
			</td>
		</tr>
		</table>
		<br />
		<table class="contentpaneopen<?php 
        echo $params->get('pageclass_sfx');
        ?>
">
		<?php 
        foreach ($rows as $row) {
            if ($row->created) {
                $created = mosFormatDate($row->created, '%d %B, %Y');
            } else {
                $created = '';
            }
            ?>
			<tr class="<?php 
            echo $tabclass[$k] . $params->get('pageclass_sfx');
            ?>
">
				<td>
				<?php 
            if ($row->browsernav == 1) {
                ?>
					<a href="<?php 
                echo sefRelToAbs($row->href);
                ?>
" target="_blank">
					<?php 
            } else {
                ?>
					<a href="<?php 
                echo sefRelToAbs($row->href);
                ?>
">
					<?php 
            }
            echo $row->title;
            ?>
				</a>
				<span class="small<?php 
            echo $params->get('pageclass_sfx');
            ?>
">
				(<?php 
            echo $row->section;
            ?>
)
				</span>
				</td>
			</tr>
			<tr class="<?php 
            echo $tabclass[$k] . $params->get('pageclass_sfx');
            ?>
">
				<td>
				<?php 
            echo $row->text;
            ?>
 &#133;
				</td>
			</tr>
			<tr>
				<td class="small<?php 
            echo $params->get('pageclass_sfx');
            ?>
">
				<?php 
            echo $created;
            ?>
				</td>
			</tr>
			<tr>
				<td>&nbsp;
				
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
    }