homejoomlablogministries
articles
guides
tutorials
all
forum

Learning Joomla! for the first time? Buy the Joomla! 1.5 Essential training CD-ROM or watch it on Lynda.com.

 

I am speaking at OpenCamp 2010 in Addison, TX


Welcome to Joseph LeBlanc's Joomla development forum. This forum is primairly intended to discuss the development of components I've authored, such as the podcasting suite and Daily Message tutorial. Although I happily answer general questions about Joomla, you may get quicker answers by searching the Joomla forums.

Due to spam abuse, you must register to post in the forums. However, you are allowed to browse the forums without registration. Commercially-oriented, off-topic messages are $100 per word, thank you for understanding!






FireBoard
Welcome, Guest
Please Login or Register.    Lost Password?
Component publishing (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Component publishing
#2403
Ben (User)
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
Component publishing 1 Year, 8 Months ago Karma: 0  
Hey Joseph,
I've ran through the Extension Development book and have run into an issue with Joomla! 1.5. When creating components, I can not seem to get the publish/unpublish icon to function as intended and was wondering if you had a solution or any tips. Here is my display function:

function showKinesisAvailable($option, &$rows)
{
echo '<form action="index.php" method="post" name="adminForm">';
echo '<table class="adminlist">';

echo '<thead>';
echo '<tr>';

echo '<th width="20">';
echo '<input type="checkbox" name="toggle" value="" onclick="checkAll('.count($rows).';" />';
echo '</th>';

echo '<th class="title">Name</th>';
echo '<th width="20%" nowrap="nowrap">Page title</th>';
echo '<th width="5%" nowrap="nowrap">Published</th>';

echo '</tr>';
echo '</thead>';

jimport('joomla.filter.output';
$k = 0;
$i = 0;
$n=count($rows);
while($i < $n)
{
$row = $rows[$i];
$checked = JHTML::_('grid.id',$i,$row->id);
$published = JHTML::_('grid.published',$row,$i);
$link = JFilterOutput::ampReplace('index.php?option='.$option.'&task=edit&cid[]=&#039;.$row-&gt;id);
echo &#039;&lt;tr class=&quot;row&quot;&#039;.$k.&#039;&quot;&gt;&#039;;
echo &#039;&lt;td&gt;&#039;;
echo $checked;
echo &#039;&lt;/td&gt;&#039;;

echo &#039;&lt;td&gt;&#039;;
echo &#039;&lt;a href=&quot;&#039;.$link.&#039;&quot;&gt;&#039;;
echo $row-&gt;name;
echo &#039;&lt;/a&gt;&#039;;
echo &#039;&lt;/td&gt;&#039;;

echo &#039;&lt;td&gt;&#039;;
echo $row-&gt;title;
echo &#039;&lt;/td&gt;&#039;;

echo &#039;&lt;td align=&quot;center&quot;&gt;&#039;;
echo $published;
echo &#039;&lt;/td&gt;&#039;;

echo &#039;&lt;/tr&gt;&#039;;

$k = 1 - $k;
$i++;
}

echo &#039;&lt;/table&gt;&#039;;
echo &#039;&lt;input type=&quot;hidden&quot; name=&quot;option&quot; value=&quot;&#039;.$option.&#039;&quot; /&gt;&#039;;
echo &#039;&lt;input type=&quot;hidden&quot; name=&quot;task&quot; value=&quot;&quot; /&gt;&#039;;
echo &#039;&lt;input type=&quot;hidden&quot; name=&quot;boxchecked&quot; value=&quot;0&quot; /&gt;&#039;;

echo &#039;&lt;/form&gt;&#039;;
}

I had to change JOutputFilter to JFilt;
$checked = JHTML::_('grid.id',$i,$row->id);
$published = JHTML::_('grid.published',$row,$i);
$link = JFilterOutput::ampReplace('index.php?option='.$option.'&task=edit&cid[]='.$row->id);
echo '<tr class="row"'.$k.'">';
echo '<td>';
echo $checked;
echo '</td>';

echo '<td>';
echo '<a href="'.$link.'">';
echo $row->name;
echo '</a>';
echo '</td>';

echo '<td>';
echo $row->title;
echo '</td>';

echo '<td align="center">';
echo $published;
echo '</td>';

echo '</tr>';

$k = 1 - $k;
$i++;
}

echo '</table>';
echo '<input type="hidden" name="option" value="'.$option.'" />';
echo '<input type="hidden" name="task" value="" />';
echo '<input type="hidden" name="boxchecked" value="0" />';

echo '</form>';
}

I had to change JOutputFilter to JFilterOutput in order to find the class. Other than that, I couldn't really find any thing glaring in the differences between the code and book. Any help/tips would be appreciated. Thanks!
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
      Topics Author Date
    thread link
Component publishing
Ben 2008/12/10 14:08
    thread link
thread linkthread link Re:Component publishing
jleblanc 2008/12/17 13:44
    thread link
thread linkthread link Re:Component publishing
kernel52 2010/02/04 09:43
    thread link
thread linkthread linkthread link Re:Component publishing
jleblanc 2010/02/07 09:24
    thread link
thread linkthread link Re:Component publishing
kernel52 2010/02/07 10:56
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop