Fork me on GitHub

replacing _EDIT and _DELETE with icons  Bottom

  • this is the normal code:

    Code

    foreach ($camps as $key => $camp) {

            if (pnSecAuthAction(0, 'roqCamps::', "$camp[campname]::$camp[cid]", ACCESS_READ)) {
       
                $options = array();
                if (pnSecAuthAction(0, 'roqCamps::', "$camp[campname]::$camp[cid]", ACCESS_EDIT)) {
                    $options[] = array('url'   => pnModURL('roqCamps', 'admin', 'modify', array('cid' => $camp['cid'])),
                                       'title' => _EDIT);
                    if (pnSecAuthAction(0, 'roqCamps::', "$camp[campname]::$camp[cid]", ACCESS_DELETE)) {
                        $options[] = array('url'   => pnModURL('roqCamps', 'admin', 'delete', array('cid' => $camp['cid'])),
                                           'title' => _DELETE);
                    }
                }

                $camps[$key]['options'] = $options;
            }
        }


    I added a value to the options array:

    Code

    $options[] = array('url'   => pnModURL('roqCamps', 'admin', 'modify', array('cid' => $camp['cid'])),
                                       'title' => _EDIT,
                                       'pic'   => 'edit.ico');


    this is the output:

    Code

    <!--[assign var="options" value=$roqCamps[roqCamps].options]-->
    <!--[section name=options loop=$options]-->
    <a href="<!--[$options[options].url|pnvarprephtmldisplay]-->">
    <!--[pnimg src=$options[options].pic  alt=$options[options].title]--></a>
    <!--[/section]-->


    but i get this error

    "Warning: Smarty error: pnimg: image edit.ico is not a valid image file..blah blah blah"

    any ideas?
  • Can you use icons in a web browser?
    Try it as a gif?

    --
    Zikula Themes
  • I converted them to gifs, and the same process worked. I guess i just assumed that since ico worked for bookmark header icons, that they would be viewable within a page.
  • Glad to hear it worked out. :)

    --
    Zikula Themes

This list is based on users active over the last 60 minutes.