91
bumciach
Re: Could 'preference' navigation be improved when configuring modules ?
  • 2009/8/17 7:13

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Quote:

trabis wrote:
We need to build the API, modules really need one common admin interface. But I think it is not to come soon.

Exactly.
Practically every module uses the loadModuleAdminMenu Frameworks or his clone. Always taking me to why this is not the core thing.

Your vision of the future is great. But what can we do today...
Support preferences in module, however, depends on the modules developers.
If the system displays a preference it should at least put the title of the module to which it relates.

Doing it fast:
in /modules/system/admin/preferences/main.php after line 345 (xoops 2.3.2) add
echo '<h3>'._PREFERENCES.': <a href="'.XOOPS_URL.'/modules/'.$module->getVar('dirname').'/admin/">'.$module->getVar('name').'</a></h3>';

The user thus will not be so lost... so little need.



92
bumciach
Re: New image tool
  • 2009/8/15 17:56

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


I think that we should look at "Image Manager" in two aspects.

1. User front-end for uploading files (not only image type), which can be reused in any XOOPS module. It consists of:
- advanced file form to choose a file to upload, for examplehttp://www.uploadify.com/demo/
- directory listing to choose to which directory on server upload, likehttp://abeautifulsite.net/notebook_files/58/demo/

2. Tools for image manipulation (resizing, converting, etc.).



93
bumciach
Re: Form in form
  • 2009/8/14 12:35

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Quote:
I do not fully understand your question, (because the references to your example code is not always clear or consequent)

Maybe I show what I did before without OOP (in simplifying):
function form_to_include(&$formObj

  
$formObj->addElement(new XoopsFormText(_PF_COST'cost'2010$row_fromDB['cost']), false);
  return 
$formObj;
}

function 
mainform(&$formObj

  
$formObj->addElement(new XoopsFormText(_PF_TITLE'title'35255$row_fromDB['title']));
  
  
$tray = new XoopsFormElementTray'COST''' );    
  
$tray form_to_include$tray );
  
$formObj->addElement$trayfalse );

  
$formObj->addElement(new XoopsFormText(_PF_DETAILS'details'35255$row_fromDB['details']));

  return 
$formObj;
}

$cform = new XoopsThemeForm('MYFORM'"frmStage"'test.php');
$cform->setExtra('enctype="multipart/form-data"');
     
$mainform mainform($cform);
   
$cform-> addElement($mainformfalse);
   
$cform->addElement(new XoopsFormButton("""submit"'OK'"submit"));
     
$cform->display();

It is working what I expected.

Quote:

trabis wrote:
The Form class is dependent on this Object class. Actually, there was no need to have a form class. I could have build the form inside the object class.

I know that. But I like yours code and the way you have it organized. :)
I want to achieve this the definition of each form is included in a separate class. Simplicity and easy to maintain for me.

I think that this example with AddToForm method is the nearest what I want to and most flexible.

Thanks guys!



94
bumciach
Form in form
  • 2009/8/14 8:13

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Let's say we have two class to define form elements (for example, the module mytabs):
class MytabspageForm extends XoopsThemeForm {
    function 
createElements($target) {
        
$this->addElement(new XoopsFormText(_AM_MYTABS_TITLE'pagetitle'35255$target->getVar('pagetitle''e')));
       [...]
    }
}

class MytabsTabForm extends XoopsThemeForm {
    function 
createElements($target) {
        
$this->addElement(new XoopsFormText(_AM_MYTABS_TITLE'tabtitle'35255$target->getVar('tabtitle''e')));

        
$this->addElement(new XoopsFormDateTime(_AM_MYTABS_PUBLISHDATE'tabfromdate'15$target->getVar('tabfromdate''e')));

        [...]
    }
}

Is it possible to incorporate elements of the form in one class to another?
For example...
$form = new MytabsTabForm;
$form->createElements();
echo 
$form->render();

could show TabForm with elements from PageForm (between 'tabtitle' and 'tabfromdate').
You know... If you want to change the items in PageForm you need to modify this one class rather than two.

It does not concern me about this particular module, but the overall concept. How to solve for classes?



95
bumciach
Re: PHP-Debugging without XOOPS
  • 2009/8/12 16:02

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


So far, I only used xajax. I used it to connect to the database without having to reload the page. Such as modification of data or checking a single value (the download thousands of records from database to browser at a time would be pointless in this case). So I have not felt so much this disadvantages you mentioned.

But I recently started to interest jquery. A few days ago I started to play with module Publisher by Trabis which intrducing Tabs from jQueryUI. It's impressive! I must also be interested ajaxify. Thanks for tips!

And about interesting plugins. As I mentioned herehttps://xoops.org/modules/newbb/viewtopic.php?viewmode=flat&type=&topic_id=68797&forum=10 jqGrid plugin looks great. But I haven't found time to look into a bit more yet.



96
bumciach
Re: Structure and relational model of the XOOPS database
  • 2009/8/12 14:13

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


I'm sorry, I can not help here. I use this two progs on Windows only.



97
bumciach
Re: PHP-Debugging without XOOPS
  • 2009/8/12 9:35

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Sorry OT...
It seems to me that xajax has one advantage over the jquery. Using the XoopsDB or XoopsForm objects with xajax functions is more natural and easy. Am I wrong?



98
bumciach
Re: XoopsForm and ajax empty response
  • 2009/8/10 11:26

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Class XoopsThemeTabForm comes from the Publisher module by Trabis.
I am currently just testing different things, so I can show you only this:

index.php
$xajax = new xajax();

if ( 
_CHARSET == 'ISO-8859-2' ) {
  
$xajax->configure("characterEncoding"'ISO-8859-2');
  
$xajax->configure('decodeUTF8Input',true);
}
$xajax->setFlag("debug"false);
$xajax->register(XAJAX_FUNCTION,"symbolExist");
$xajax->processRequest();
$Xjavapath=BAZLE_AJAXLIB_URL;
$xajaxjava=$xajax->getJavascript($Xjavapath);

$xoopsOption['template_main'] = 'my_form_template.tpl';    

/**
 * XOOPS main header file
 */

require_once XOOPS_ROOT_PATH."/header.php";    


include_once 
XOOPS_ROOT_PATH."/class/xoopsformloader.php";
  include_once 
BAZLE_PATH '/class/themetabform.php';
  
$cform = new XoopsThemeTabForm('Title of form''frmObiekt''umenu0.php?op='.$akcja);
     
$cform->setExtra('enctype="multipart/form-data"');
  
$cform->startTab('Symbol');
    
//SYMBOL
    
$tray_symbol = new XoopsFormElementTray_BAZLE_SYMBOL'''symbol' );
    
$symbol_frm=new XoopsFormText('''symbol'2010$row_obiekt['symbol']);
    if(
$op=='new')
        
$symbol_frm->setExtra(' onBlur="xajax_symbolExist(xajax.getFormValues('."'frmObiekt'".'));"');
    
$tray_symbol->addElement($symbol_frmtrue);
      
$cform->addElement($tray_symboltrue);
    
    
$cform->startTab('Other');
      
//UWAGI
      
$cform->addElement(new XoopsFormTextArea(_BAZLE_UWAGI'uwagi'$row_obiekt['uwagi'], 4$cols=50), false);
      
$cform->endTabs();
    
      
//SUBMIT
      
$cform->addElement(new XoopsFormHidden('id'$id), false);
      
$cform->addElement(new XoopsFormHidden('op'$op), false); 
      
$button_tray = new XoopsFormElementTray('' ,'');
      
$submit_btn = new XoopsFormButton('''sbt'_SUBMIT'submit');
      
$button_tray->addElement($submit_btn);
      
$cancel_btn = new XoopsFormButton('''cancel'_CANCEL'button');
      
$cancel_btn->setExtra("onClick="document.location.href='".BAZLE_URL."/index_obiekty.php';"");
      
$button_tray->addElement($cancel_btn);
    
$cform->addElement($button_tray);
     
     
$cform->assign($xoopsTpl);

$xoopsTpl->assign('xajaxjava'$xajaxjava);

$xoTheme->addStylesheet(BAZLE_URL '/css/publisher.css');
$xoTheme->addStylesheet(BAZLE_URL '/css/jquery-ui-1.7.1.custom.css');

$xoTheme->addScript(BAZLE_URL '/js/jquery-1.3.2.min.js');
$xoTheme->addScript(BAZLE_URL '/js/jquery-easing-1.3.pack.js');
$xoTheme->addScript(BAZLE_URL '/js/jquery.lightbox-0.5.js');
$xoTheme->addScript(BAZLE_URL '/js/jquery.popeye-0.2.1.js');
$xoTheme->addScript(BAZLE_URL '/js/ui.core.js');
$xoTheme->addScript(BAZLE_URL '/js/ui.tabs.js');
$xoTheme->addScript(BAZLE_URL '/js/publisher.js');

include_once 
XOOPS_ROOT_PATH '/footer.php';


my_form_template.tpl
<div id="tabs">
<
ul>
<{foreach 
item=tab key=key from=$frmObiekt.tabs}>
  <
li><a href="#tab_<{$key}>"><span><{$tab}></span></a></li>
<{/foreach}>
</
ul>

<
form name="<{$frmObiekt.name}>" id="<{$frmObiekt.name}>" action="<{$frmObiekt.action}>" method="<{$frmObiekt.method}>" <{$frmObiekt.extra}>>
<!-- 
start of form elements loop -->
  <{foreach 
item=tab key=key from=$frmObiekt.tabs}>
  <
div id="tab_<{$key}>">
    <
table class="outer" cellspacing="1">
    <
tr><th colspan="2"><{$frmObiekt.title}></th></tr>
    <{foreach 
item=element from=$frmObiekt.elements}>
    <{if 
$element.tab == $key || $element.tab == -1}>
    <{if !
$element.hidden}>
      <
tr>
        <
td class="head">
        <{if 
$element.caption != ''}>
          <
div class="xoops-form-element-caption<{if $element.required}>-required<{/if}>">
            <
span class="caption-text"><{$element.caption}></span>
                  <
span class="caption-marker">*</span>
          </
div>
        <{/if}>
        <{if 
$element.description}>
            <
div class="xoops-form-element-help"><{$element.description}></div>
        <{/if}>
        </
td>
        <
td id="xoops-form-element-body_<{$element.name}>" class="even"><{$element.body}><div class="xoops-form-element-alert" id="xoops-form-element-alert_<{$element.name}>"></div></td>
      </
tr>
    <{/if}>
    <{/if}>
    <{/foreach}>
    <!-- 
end of form elements loop -->
    </
table>
  </
div>
  <{/foreach}>
  <{foreach 
item=element from=$frmObiekt.elements}>
      <{if 
$element.hidden}><{$element.body}><{/if}>
  <{/foreach}>
  
</
form>  <{$frmObiekt.javascript}>
</
div>
<{
$xajaxjava}>



99
bumciach
Re: XoopsForm and ajax empty response
  • 2009/8/10 8:00

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Now it's working on Firefox too! I have overlooked that no id attribute in the form element. Stupid :P



100
bumciach
Re: Is XOOPS a suitable CMS for this application?
  • 2009/8/8 19:57

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Quote:

bb2120 wrote:
Are you saying that once the module/hack is installed, the admin could simply enter all three translations in the appropriate brackets into the same textarea? That would be brilliant but sounds too good to be true! Would modules need to be rewritten or does it 'just work'?

Yes, it's true :)
I have played with xlanguage module some time ago. Generally you don't have to modify any module.
But there are some limitations.
For example, the titles of the blocks are 255 chars max. So you cannot overdo the length of the title or the number of languages




TopTop
« 1 ... 7 8 9 (10) 11 12 13 14 »



Login

Who's Online

187 user(s) are online (112 user(s) are browsing Support Forums)


Members: 0


Guests: 187


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits