Keyword

K2 Add new item window resize

More
13 years 7 months ago #87357 by juju
Replied by juju on topic K2 Add new item window resize
I don't know, it's easy to test, you put the value en percentage and you see if it's work :)

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #87358 by juju
Replied by juju on topic K2 Add new item window resize
Tafadzwa Makura : I apologize, it's not easy, the value are for example : size:{x:990,y:650} So for percentage I don't know how we can do it :/

 

I test with JS code, but I do something wrong and it doesn't work :/

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #87359 by Hanny
Replied by Hanny on topic K2 Add new item window resize
juju - I see the calender error you were getting when trying to use the javascript to send a user to a particular location now.

 

That has to do with the calender functions in the form.php (around lines 818-828)

If you comment those out, or remove them the calender error goes away and you can redirect users wherever you'd like with the javascript.  I haven't figured out a more clean way to do it unfortunately :(  I think it would require some digging into the core joomla stuff in the calender code - but I am not 100%.

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #87360 by Hanny
Replied by Hanny on topic K2 Add new item window resize
I've found that if you comment out the calender stuff mentioned above, and make the page redirect like this:

parent.$('sbox-window').close();                <?php $user = &JFactory::getUser($userID);?>        parent.window.location="<?php echo (JRoute::_(K2HelperRoute::getUserRoute($user->id))); ?>";                <?php    } ?>        </script>

It's not 100% however, at least with my particular site.  You guys can play with it and see if it works for you...

 

 

So - in summation - for me in form.php on lines 819-830 I now have this (calender bits commented out to get rid of the error):

<tr>                        <td align="right" class="key"><?php echo JText::_('Creation date'); ?></td>                        <td class="k2ItemFormDateField"><?php /*echo JHTML::_( 'calendar',$this->row->created, 'created', 'created', '%Y-%m-%d %H:%M:%S'); */ ?></td>                      </tr>                      <tr>                        <td align="right" class="key"><?php echo JText::_('Start publishing'); ?></td>                        <td class="k2ItemFormDateField"><?php /*echo JHTML::_( 'calendar',$this->row->publish_up, 'publish_up', 'publish_up', '%Y-%m-%d %H:%M:%S'); */ ?></td>                      </tr>                      <tr>                        <td align="right" class="key"><?php echo JText::_('Finish publishing'); ?></td>                        <td class="k2ItemFormDateField"><?php /* echo JHTML::_( 'calendar',$this->row->publish_down, 'publish_down', 'publish_down', '%Y-%m-%d %H:%M:%S'); */ ?></td>                      </tr>


 

And my redirect now reads like this:

parent.$('sbox-window').close();                 <?php $user = &JFactory::getUser($userID);?>         parent.window.location="<?php echo (JRoute::_(K2HelperRoute::getUserRoute($user->id))); ?>";

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #87361 by juju
Replied by juju on topic K2 Add new item window resize
Really cool, i'm going to test that tomorrow ;)

 

For now, I have a little system and it works pretty good :

I'll do a little test :

- If the user can publish item, I display an alert box message, who said :"Thanks, Your item has been published." , the pop up close, and I refresh the page.

- If the user can't publish, I display an alert box message, who said :"Thanks, Your item was submitted to a moderator, it will be published after verification." the pop up close, and I refresh the page.

 

Now, if your trick work, I will be able to redirect the user to his article instead of refresh the page (for user who can publish only).

 

But, one question, with your trick we hide this Calendar warning, but do you think the warning isn't here for a good reason ? Or it's just a bug so we can hide it without fear a futur problem ?

 

I wanted to get to stop using pop-up for the add form, but, it's too difficult. So I adapt my JCE editor and I managed to do exactly the same editor like on this site, exactly ! 

So now I have a very clean editor, with one simple line with button, and it's pretty good.

 

One last problem : Display a little pop up while the article is saved (on my website I installed K2 Multi Notify so it takes a little longer time because I need to send several emails to moderator). And for that, I don't know at all how I can do that :/

 

Thanks again ;)

 

Thanks ;)

 

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #87362 by Hanny
Replied by Hanny on topic K2 Add new item window resize
juju said:
But, one question, with your trick we hide this Calendar warning, but do you think the warning isn't here for a good reason ? Or it's just a bug so we can hide it without fear a futur problem ?




Honestly, I have no idea. If you allow your users to mess with the calenders/publish dates it will affect that - commenting them out essentially disables the calenders from what I can tell. I don't use the sidebar at all (it doesn't show on my site - I've disabled it) - so it doesn't affect me. If you've got a site where people do utilize dates and such it will probably be a pointless fix that won't help you.

I wish I had a better fix than commenting out the calender features.... but I don't.  If you google that calender error you can see a good number of users/threads on the Joomla forums having the same issue with no solutions found.

One last problem : Display a little pop up while the article is saved (on my website I installed K2 Multi Notify so it takes a little longer time because I need to send several emails to moderator). And for that, I don't know at all how I can do that :/


Yea, I don't know anything about the multi-notify or any of that stuff... not sure how to go about that yet.

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #87363 by juju
Replied by juju on topic K2 Add new item window resize
Thanks ;)

 

For the last problem, it's totally unrelated to K2 Multi Notify.

In fact, try simply to add few images to your article, or a video, or attached files... It takes more time to save when you do this, sometimes more than 5 or 10 seconds...

 

So the user have to wait and doesn't know if all is ok... I want to display a little pop-up box while the item is saved in K2 (while all images, video, attached files... are uploaded). Simply display this pop-up while Firefox is loading something, maybe it's a solution I don't know...

 

Do you understand ?

 

Thanks again ;)

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #87364 by Hanny
Replied by Hanny on topic K2 Add new item window resize
Yea, I understand... just a little animation that goes on while the user is sitting there waiting.  I'm not real sure how to do that at all... I've looked into (very briefly) but didn't have any luck at first.  I'll take a look at it again...

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #87365 by juju
Replied by juju on topic K2 Add new item window resize
Thanks, i'll do the same ;)

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #87366 by juju
Replied by juju on topic K2 Add new item window resize
I just try to comment out the line you specified and it works great now, I can redirect the user to his article.

 

Maybe users are interested so I put my code here :

 

Between <div class="k2Frontend"> (line 253) and <table class="toolbar" cellpadding="2" cellspacing="4"> (line 294) in form.php

 

 

I have :

 

<?php if (JRequest::getInt('step')=='1') { ?>        <script language="javascript">                                var XHRCheckin = new Ajax('index.php?option=com_k2&view=item&task=checkin&cid=<?php echo $this->row->id; ?>', {            method: 'post'        });        dummy = $time() + $random(0, 100);        XHRCheckin.request("t"+dummy);        parent.$('sbox-window').close();                <?php                         $user = &JFactory::getUser();        $db = & JFactory::getDBO();        $query = "SELECT * FROM #__k2_users  WHERE userID=".(int)$user->id;        $db->setQuery($query, 0, 1);        $profile = $db->loadObject();                    require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'permissions'.'.php');            if (K2HelperPermissions::canPublishItem($this->row->catid)) {                ?> alert('Votre article a été publié sur le site, vous allez être redirigé vers celui-ci..');                window.parent.location='index.php?option=com_k2&view=item&id=<?php echo $this->row->id; ?>';                 <?php            }else{                 ?> alert('Votre article a été envoyé à un administrateur, il sera publié après vérification.'); window.parent.location.reload(); <?php                            }                ?>                        </script>        <?php    } ?>

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum